From a0e1e16f17e6c79ed5c0a24cc394388f0fc64aff Mon Sep 17 00:00:00 2001 From: ericholguin Date: Fri, 26 May 2023 13:48:07 -0600 Subject: [PATCH] gradients: add damus logo gradient --- damus.xcodeproj/project.pbxproj | 5 ++++ .../Gradients/DamusLogoGradient.swift | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 damus/Components/Gradients/DamusLogoGradient.swift diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj index 6d77cbf9..46fa5523 100644 --- a/damus.xcodeproj/project.pbxproj +++ b/damus.xcodeproj/project.pbxproj @@ -274,6 +274,7 @@ 50A50A8D29A09E1C00C01BE7 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A50A8C29A09E1C00C01BE7 /* RequestTests.swift */; }; 50B5685329F97CB400A23243 /* CredentialHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B5685229F97CB400A23243 /* CredentialHandler.swift */; }; 50DA11262A16A23F00236234 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50DA11252A16A23F00236234 /* Launch.storyboard */; }; + 5C0707D12A1ECB38004E7B51 /* DamusLogoGradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0707D02A1ECB38004E7B51 /* DamusLogoGradient.swift */; }; 5C42E78C29DB76D90086AAC1 /* EmptyUserSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C42E78B29DB76D90086AAC1 /* EmptyUserSearchView.swift */; }; 5C513FBA297F72980072348F /* CustomPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C513FB9297F72980072348F /* CustomPicker.swift */; }; 5C513FCC2984ACA60072348F /* QRCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C513FCB2984ACA60072348F /* QRCodeView.swift */; }; @@ -718,6 +719,7 @@ 50A50A8C29A09E1C00C01BE7 /* RequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; 50B5685229F97CB400A23243 /* CredentialHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialHandler.swift; sourceTree = ""; }; 50DA11252A16A23F00236234 /* Launch.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = ""; }; + 5C0707D02A1ECB38004E7B51 /* DamusLogoGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusLogoGradient.swift; sourceTree = ""; }; 5C42E78B29DB76D90086AAC1 /* EmptyUserSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyUserSearchView.swift; sourceTree = ""; }; 5C513FB9297F72980072348F /* CustomPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomPicker.swift; sourceTree = ""; }; 5C513FCB2984ACA60072348F /* QRCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeView.swift; sourceTree = ""; }; @@ -1075,6 +1077,7 @@ 4C7D09712A0AEF5E00943473 /* DamusGradient.swift */, 4C7D09732A0AEF9000943473 /* AlbyGradient.swift */, 4C2859612A12A7F0004746F7 /* GoldSupportGradient.swift */, + 5C0707D02A1ECB38004E7B51 /* DamusLogoGradient.swift */, ); path = Gradients; sourceTree = ""; @@ -1254,6 +1257,7 @@ 4C1A9A2229DDDB8100516EAC /* IconLabel.swift */, 4C8D00C929DF80350036AF10 /* TruncatedText.swift */, 4C28595F2A12A2BE004746F7 /* SupporterBadge.swift */, + 5C6E1DAC2A193EC2008FC15A /* GradientButtonStyle.swift */, ); path = Components; sourceTree = ""; @@ -1825,6 +1829,7 @@ 4CB88396296F7F8B00DC99E7 /* ReactionView.swift in Sources */, 4CFF8F6B29CD0079008DB934 /* RepostedEvent.swift in Sources */, 4C8682872814DE470026224F /* ProfileView.swift in Sources */, + 5C0707D12A1ECB38004E7B51 /* DamusLogoGradient.swift in Sources */, 4C5F9114283D694D0052CD1C /* FollowTarget.swift in Sources */, 4CF0ABD629817F5B00D66079 /* ReportView.swift in Sources */, 4C1A9A2729DDE31900516EAC /* TranslationSettingsView.swift in Sources */, diff --git a/damus/Components/Gradients/DamusLogoGradient.swift b/damus/Components/Gradients/DamusLogoGradient.swift new file mode 100644 index 00000000..2f1e337d --- /dev/null +++ b/damus/Components/Gradients/DamusLogoGradient.swift @@ -0,0 +1,29 @@ +// +// DamusLogoGradient.swift +// damus +// +// Created by eric on 5/24/23. +// + +import SwiftUI + +fileprivate let damus_logo_grad_c1 = hex_col(r: 0x30, g: 0xb3, b: 0xf1) +fileprivate let damus_logo_grad_c2 = hex_col(r: 0xc5, g: 0x39, b: 0xf9) +fileprivate let damus_logo_grad = [damus_logo_grad_c1, damus_logo_grad_c2] + +struct DamusLogoGradient: View { + var body: some View { + DamusLogoGradient.gradient + .edgesIgnoringSafeArea([.top,.bottom]) + } + + static var gradient: LinearGradient { + LinearGradient(colors: damus_logo_grad, startPoint: .leading, endPoint: .trailing) + } +} + +struct DamusLogoGradient_Previews: PreviewProvider { + static var previews: some View { + DamusLogoGradient() + } +}