-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Design] CTA Border Button * [WEAV-69] 스플래시 및 인트로 View * [WEAV-69] 기본 뷰, Layout 설정
- Loading branch information
1 parent
1040074
commit aeb2d17
Showing
31 changed files
with
414 additions
and
33 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Projects/App/Resources/Assets.xcassets/heart_letter.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "heart_letter.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.68 KB
Projects/App/Resources/Assets.xcassets/heart_letter.imageset/heart_letter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.67 KB
Projects/App/Resources/Assets.xcassets/heart_letter.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.7 KB
Projects/App/Resources/Assets.xcassets/heart_letter.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
// | ||
// SplashAnimatedView.swift | ||
// three-days-dev | ||
// | ||
// Created by 김지수 on 9/24/24. | ||
// Copyright © 2024 com.weave. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import DesignCore | ||
|
||
enum SplashAnimationStep: CaseIterable { | ||
case first, second, third, fourth, fifth, sixth | ||
|
||
var color: Color { | ||
switch self { | ||
case .first: Color(hex: 0xE4DED7) | ||
case .second: Color(hex: 0xDFE7D1) | ||
case .third: Color(hex: 0xD7D7EA) | ||
case .fourth: Color(hex: 0xECDAE3) | ||
default: Color(hex: 0xF5F1EE) | ||
} | ||
} | ||
|
||
var interval: Double { | ||
switch self { | ||
case .first: 1.0 | ||
default: 0.5 | ||
} | ||
} | ||
} | ||
|
||
struct IconState: Identifiable { | ||
let id: Int | ||
var offset: CGSize | ||
var rotation: Angle | ||
var opacity: Double | ||
} | ||
|
||
struct SplashAnimatedView: View { | ||
@State private var animationStep: SplashAnimationStep = .first | ||
@State private var cycleCompleted = false | ||
@State private var otherViewOpacity: CGFloat = 0.0 | ||
@State private var showLetterAnimation = false | ||
@State private var iconStates: [IconState] = [ | ||
IconState( | ||
id: 0, | ||
offset: .zero, | ||
rotation: .degrees( | ||
0 | ||
), | ||
opacity: 1 | ||
), | ||
IconState( | ||
id: 1, | ||
offset: .zero, | ||
rotation: .degrees( | ||
-5.47 | ||
), | ||
opacity: 0 | ||
), | ||
IconState( | ||
id: 2, | ||
offset: .zero, | ||
rotation: .degrees( | ||
4.98 | ||
), | ||
opacity: 0 | ||
), | ||
IconState( | ||
id: 3, | ||
offset: .zero, | ||
rotation: .degrees(15.52), | ||
opacity: 0 | ||
) | ||
] | ||
|
||
var body: some View { | ||
VStack(spacing: 84) { | ||
Spacer() | ||
|
||
Text("3일동안 딱 한 사람만 알아가는\n새로운 설렘의 시작") | ||
.typography(.semibold_24) | ||
.multilineTextAlignment(.center) | ||
.foregroundStyle(DesignCore.Colors.grey500) | ||
.opacity(otherViewOpacity) | ||
|
||
ZStack { | ||
DesignCore.Images.logoSmall.image | ||
.offset(iconStates[0].offset) | ||
.rotationEffect(iconStates[0].rotation) | ||
.opacity(iconStates[0].opacity) | ||
|
||
DesignCore.Images.day1.image | ||
.offset(iconStates[1].offset) | ||
.rotationEffect(iconStates[1].rotation) | ||
.opacity(iconStates[1].opacity) | ||
|
||
DesignCore.Images.day2.image | ||
.offset(iconStates[2].offset) | ||
.rotationEffect(iconStates[2].rotation) | ||
.opacity(iconStates[2].opacity) | ||
|
||
DesignCore.Images.day3.image | ||
.offset(iconStates[3].offset) | ||
.rotationEffect(iconStates[3].rotation) | ||
.opacity(iconStates[3].opacity) | ||
} | ||
|
||
CTABorderButton( | ||
title: "휴대폰 번호로 시작하기", | ||
backgroundStyle: LinearGradient.gradientA, | ||
isActive: true, | ||
isShowLetter: $showLetterAnimation | ||
) { | ||
|
||
} | ||
.frame(height: 70) | ||
.padding(.horizontal, 50) | ||
.opacity(otherViewOpacity) | ||
|
||
Spacer() | ||
} | ||
.textureBackground(animationStep.color) | ||
.task { | ||
await runSingleCycle() | ||
} | ||
} | ||
|
||
private func runSingleCycle() async { | ||
for step in SplashAnimationStep.allCases.dropFirst() { | ||
guard !cycleCompleted else { break } | ||
try? await Task.sleep(for: .seconds(step.interval)) | ||
withAnimation(.interactiveSpring(duration: 0.75)) { | ||
updateIconStates(for: step) | ||
animationStep = step | ||
} | ||
} | ||
cycleCompleted = true | ||
withAnimation { | ||
showLetterAnimation = true | ||
} | ||
} | ||
|
||
private func updateIconStates(for step: SplashAnimationStep) { | ||
switch step { | ||
case .second: | ||
iconStates[0].opacity = 0 | ||
iconStates[1].opacity = 1 | ||
case .third: | ||
iconStates[2].opacity = 1 | ||
case .fourth: | ||
iconStates[3].opacity = 1 | ||
case .fifth: | ||
iconStates[1].offset = CGSize(width: -28, height: -8) | ||
iconStates[2].offset = .zero | ||
iconStates[3].offset = CGSize(width: 28, height: 8) | ||
iconStates[1].rotation = .zero | ||
iconStates[2].rotation = .zero | ||
iconStates[3].rotation = .zero | ||
otherViewOpacity = 0.3 | ||
case .sixth: | ||
iconStates[1].offset = CGSize(width: -64, height: -24) | ||
iconStates[2].offset = .zero | ||
iconStates[3].offset = CGSize(width: 64, height: 24) | ||
otherViewOpacity = 1.0 | ||
default: | ||
break | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
SplashAnimatedView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/Splash/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...signSystem/DesignCore/Resources/Images/Images.xcassets/Splash/day1.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "day1.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+12.3 KB
...ystem/DesignCore/Resources/Images/Images.xcassets/Splash/day1.imageset/day1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.2 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day1.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.6 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day1.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...signSystem/DesignCore/Resources/Images/Images.xcassets/Splash/day2.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "day2.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+12.6 KB
...ystem/DesignCore/Resources/Images/Images.xcassets/Splash/day2.imageset/day2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.4 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day2.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.5 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day2.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...signSystem/DesignCore/Resources/Images/Images.xcassets/Splash/day3.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "day3.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+12.8 KB
...ystem/DesignCore/Resources/Images/Images.xcassets/Splash/day3.imageset/day3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.9 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day3.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.2 KB
...em/DesignCore/Resources/Images/Images.xcassets/Splash/day3.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...stem/DesignCore/Resources/Images/Images.xcassets/Splash/logo_small.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "logo_small.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+7.47 KB
...Core/Resources/Images/Images.xcassets/Splash/logo_small.imageset/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.8 KB
...e/Resources/Images/Images.xcassets/Splash/logo_small.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.1 KB
...e/Resources/Images/Images.xcassets/Splash/logo_small.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...ignSystem/DesignCore/Resources/Images/Images.xcassets/heart_letter.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "heart_letter.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+3.93 KB
...ignCore/Resources/Images/Images.xcassets/heart_letter.imageset/heart_letter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.8 KB
...Core/Resources/Images/Images.xcassets/heart_letter.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20 KB
...Core/Resources/Images/Images.xcassets/heart_letter.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.