Splash Screen

This commit is contained in:
Francisco Gindre 2020-06-22 11:40:48 -03:00
parent c83e05c2fb
commit 57a04decd6
9 changed files with 82 additions and 25 deletions

View File

@ -23,6 +23,7 @@
0D1366B824991A6100F0EB54 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0D1366B624991A6100F0EB54 /* LaunchScreen.storyboard */; };
0D1366C324991A6200F0EB54 /* ZirclesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1366C224991A6200F0EB54 /* ZirclesTests.swift */; };
0D1366CE24991A6200F0EB54 /* ZirclesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1366CD24991A6200F0EB54 /* ZirclesUITests.swift */; };
0D5142C324A0F0B800F9AE2E /* Zboto.otf in Resources */ = {isa = PBXBuildFile; fileRef = 0D5142C224A0F0B800F9AE2E /* Zboto.otf */; };
0D6A22C0249A9C3000B4E946 /* Colors+Zircles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D6A22BF249A9C3000B4E946 /* Colors+Zircles.swift */; };
0D6A22C5249AB1FC00B4E946 /* ZcashSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D6A22C4249AB1FC00B4E946 /* ZcashSymbol.swift */; };
0D6A22C7249AB36100B4E946 /* ZcashButtonBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D6A22C6249AB36100B4E946 /* ZcashButtonBackground.swift */; };
@ -70,6 +71,7 @@
0D1366C924991A6200F0EB54 /* ZirclesUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZirclesUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
0D1366CD24991A6200F0EB54 /* ZirclesUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZirclesUITests.swift; sourceTree = "<group>"; };
0D1366CF24991A6200F0EB54 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0D5142C224A0F0B800F9AE2E /* Zboto.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Zboto.otf; sourceTree = "<group>"; };
0D6A22BF249A9C3000B4E946 /* Colors+Zircles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Colors+Zircles.swift"; sourceTree = "<group>"; };
0D6A22C4249AB1FC00B4E946 /* ZcashSymbol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZcashSymbol.swift; sourceTree = "<group>"; };
0D6A22C6249AB36100B4E946 /* ZcashButtonBackground.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZcashButtonBackground.swift; sourceTree = "<group>"; };
@ -135,6 +137,7 @@
0D1366AA24991A6000F0EB54 /* Zircles */ = {
isa = PBXGroup;
children = (
0D5142C224A0F0B800F9AE2E /* Zboto.otf */,
0D11D3D5249D2E0400223146 /* Utils */,
0D6A22CC249ACD6C00B4E946 /* Neumorphic */,
0D6A22C1249AB12200B4E946 /* Components */,
@ -313,6 +316,7 @@
files = (
0D1366B824991A6100F0EB54 /* LaunchScreen.storyboard in Resources */,
0D1366B524991A6100F0EB54 /* Preview Assets.xcassets in Resources */,
0D5142C324A0F0B800F9AE2E /* Zboto.otf in Resources */,
0D1366B224991A6100F0EB54 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -160,7 +160,7 @@ struct ZcashChamferedButtonBackground: Shape {
struct ZcashButton_Previews: PreviewProvider {
static var previews: some View {
ZStack {
Color.black
Color.background
VStack {
ZcashButton(color: Color.buttonBlue, fill: Color.clear, text: "Create New Wallet")
.frame(width: 300, height: 60)

View File

@ -9,12 +9,12 @@
import SwiftUI
struct ZircleProgress: View {
var progress: Double = 0
var stroke: StrokeStyle
var body: some View {
Wedge(startAngle: Angle(radians: 0),
endAngle: Angle(radians: 2 * Double.pi * progress),
clockwise: false)
.stroke(style: .init(lineWidth: 40, lineCap: .round))
.stroke(style: stroke)
.fill(LinearGradient.zButtonGradient)
.rotationEffect(Angle(radians: -Double.pi / 2))
}
@ -26,7 +26,7 @@ struct Wedge_Previews: PreviewProvider {
ZStack {
Color.background
VStack {
ZircleProgress(progress: progress)
ZircleProgress(progress: progress, stroke: .init(lineWidth: 40, lineCap: .round))
.glow(vibe: .heavy, soul: .split(left: Color.gradientPink, right: Color.gradientOrange))
.animation(.easeIn)
Button(action: {

View File

@ -56,5 +56,9 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>Zboto.otf</string>
</array>
</dict>
</plist>

View File

@ -23,7 +23,7 @@ struct Card<Content: View>: View {
Toggle(isOn: $isToggled) {
content
}
.toggleStyle(SimpleToggleStyle(cornerRadius: cornerRadius, padding: padding))
.toggleStyle(SimpleToggleStyle(shape: RoundedRectangle(cornerRadius: cornerRadius), padding: padding))
}
}

View File

@ -167,19 +167,19 @@ struct ColorfulButtonStyle: ButtonStyle {
.animation(nil)
}
}
struct SimpleToggleStyle: ToggleStyle {
var cornerRadius: CGFloat = 5
struct SimpleToggleStyle<S :Shape>: ToggleStyle {
let shape: S
var padding: CGFloat = 30
func makeBody(configuration: Self.Configuration) -> some View {
Button(action: {
configuration.isOn.toggle()
}) {
configuration.label
.contentShape(RoundedRectangle(cornerRadius: cornerRadius))
.contentShape(shape)
.padding(padding)
}
.background(
SimpleBackground(isHighlighted: configuration.isOn, shape: RoundedRectangle(cornerRadius: cornerRadius))
SimpleBackground(isHighlighted: configuration.isOn, shape: shape)
)
}
}
@ -240,9 +240,9 @@ struct NeumorphicContentView: View {
Toggle(isOn: $isToggled) {
Image(systemName: "heart.fill")
.foregroundColor(.gray)
.frame(width: 200, height: 200)
}
.toggleStyle(SimpleToggleStyle(cornerRadius: 50))
.toggleStyle(SimpleToggleStyle(shape: RoundedRectangle(cornerRadius: 5)))
}
}
}

View File

@ -23,14 +23,30 @@ struct Pie<Content: View>: View {
Toggle(isOn: $isToggled) {
content
}
.toggleStyle(SimpleToggleStyle(cornerRadius: cornerRadius, padding: padding))
.toggleStyle(SimpleToggleStyle(shape: Circle(), padding: padding))
}
}
struct Pie_Previews: PreviewProvider {
static var previews: some View {
Pie(isOn: .constant(false)) {
Text("hello")
ZStack {
Color.background
VStack(spacing: 20) {
Pie(isOn: .constant(true)) {
Text("hello")
.padding()
}
Pie(isOn: .constant(false)) {
Text("good bye")
.padding()
}
Pie(isOn: .constant(true)) {
Pie(isOn: .constant(false)) {
Text("good bye")
.padding()
}
}
}
}
}
}

View File

@ -15,8 +15,24 @@ struct SplashScreen: View {
ZStack {
Color.background
.edgesIgnoringSafeArea(.all)
FancyLogo()
.frame(width: 100, height: 200)
VStack {
Spacer()
FancyLogo()
.frame(width: 200, height: 200)
Spacer()
Button(action: {}) {
Text("Create New")
.font(.system(size: 20, weight: .bold, design: .default))
.shadow(color:Color(red: 0.2, green: 0.2, blue: 0.2).opacity(0.2), radius: 1, x: 0, y: 2)
.foregroundColor(Color.background)
.modifier(ZcashButtonBackground(buttonShape: .roundedCorners(fillStyle: .solid(color: Color.buttonBlue))))
.shadow(color: Color(red: 0.2, green: 0.2, blue: 0.2).opacity(0.5), radius: 25, x: 10, y: 10)
.frame(height: 50)
}
}.padding(30)
}.navigationBarTitle(Text("Welcome to Zircles"))
}
@ -25,16 +41,33 @@ struct SplashScreen: View {
struct FancyLogo: View {
var body: some View {
GeometryReader { geometry in
ZStack {
ZcashSymbol().path(in: geometry.frame(in: .local))
.fill(Color.gray)
ZircleProgress(progress: 0.75)
.glow(vibe: .heavy, soul: .split(left: Color.gradientPink, right: Color.gradientOrange))
ZStack {
Pie(isOn: .constant(false),padding: 16) {
Pie(isOn: .constant(true), padding: 40) {
Pie(isOn: .constant(false)) {
Text("")
.padding(40)
}
}
.overlay(
ZircleProgress(progress: 0.75, stroke: .init(lineWidth: 40, lineCap: .round))
.padding(23)
)
}
Text("$")
.foregroundColor(.buttonGray)
.font(
.custom("Zboto", size: 200)
).padding()
.frame(alignment: .center)
.contentShape(Circle())
.offset(x: 0, y: 50)
}
}
}

BIN
Zircles/Zboto.otf Normal file

Binary file not shown.