File tree 1 file changed +24
-10
lines changed
1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change 9
9
import SwiftUI
10
10
11
11
struct ContentView : View {
12
+
13
+ @State var show = false
14
+
12
15
var body : some View {
13
16
ZStack {
14
17
15
18
TitleView ( )
16
- . blur ( radius: 20 )
19
+ . blur ( radius: show ? 20 : 0 )
20
+ . animation ( . default)
17
21
18
22
CardBottomView ( )
19
- . blur ( radius: 20 )
23
+ . blur ( radius: show ? 20 : 0 )
24
+ . animation ( . default)
20
25
21
26
CardView ( )
22
- . offset ( x: 0 , y: - 40 )
27
+ . background ( show ? Color . red : Color ( " background9 " ) )
28
+ . cornerRadius ( 10 )
29
+ . shadow ( radius: 20 )
30
+ . offset ( x: 0 , y: show ? - 400 : - 40 )
23
31
. scaleEffect ( 0.85 )
24
- . rotationEffect ( Angle ( degrees: 15 ) )
32
+ . rotationEffect ( Angle ( degrees: show ? 15 : 0 ) )
25
33
. blendMode ( . hardLight)
34
+ . animation ( . basic( duration: 0.7 , curve: . easeInOut) )
26
35
27
36
CardView ( )
28
- . offset ( x: 0 , y: - 20 )
37
+ . background ( show ? Color . red : Color ( " background8 " ) )
38
+ . cornerRadius ( 10 )
39
+ . shadow ( radius: 20 )
40
+ . offset ( x: 0 , y: show ? - 200 : - 20 )
29
41
. scaleEffect ( 0.9 )
30
- . rotationEffect ( Angle ( degrees: 10 ) )
42
+ . rotationEffect ( Angle ( degrees: show ? 10 : 0 ) )
31
43
. blendMode ( . hardLight)
44
+ . animation ( . basic( duration: 0.5 , curve: . easeInOut) )
32
45
33
46
CertificateView ( )
34
47
. scaleEffect ( 0.95 )
35
- . rotationEffect ( Angle ( degrees: 5 ) )
48
+ . rotationEffect ( Angle ( degrees: show ? 5 : 0 ) )
49
+ . animation ( . spring( ) )
50
+ . tapAction {
51
+ self . show. toggle ( )
52
+ }
36
53
}
37
54
}
38
55
}
@@ -51,9 +68,6 @@ struct CardView: View {
51
68
Text ( " Card Back " )
52
69
}
53
70
. frame ( width: 340.0 , height: 220.0 )
54
- . background ( Color . blue)
55
- . cornerRadius ( 10 )
56
- . shadow ( radius: 20 )
57
71
}
58
72
}
59
73
You can’t perform that action at this time.
0 commit comments