88import SwiftUI
99
1010struct WuxiaInfoView : View {
11+ @Binding var isShowWuxiaInfo : Bool
1112 var body : some View {
1213 ZStack {
1314 DefaultBackgroundAnimationView ( )
1415 . ignoresSafeArea ( )
1516 Color . black. opacity ( 0.6 )
1617 . ignoresSafeArea ( )
1718 . background ( . ultraThinMaterial. opacity ( 0.4 ) )
18- ScrollView {
19- VStack ( alignment : . leading , spacing : 80 ) {
19+ VStack {
20+ HStack {
2021 Spacer ( )
21- . frame ( height: 100 )
22- HStack {
22+ Button {
23+ isShowWuxiaInfo = false
24+ } label: {
25+ Image ( systemName: " xmark.circle " )
26+ . imageScale ( . large)
27+
28+ }
29+ }
30+ . padding ( )
31+ . foregroundStyle ( . white)
32+ ScrollView {
33+ VStack ( alignment: . leading, spacing: 80 ) {
2334 Spacer ( )
24- VStack ( spacing: 24 ) {
25- Text ( " 運氣調息 " )
26- . font ( . system( size: 80 ) )
27- VStack ( alignment: . leading, spacing: 8 ) {
28- Text ( " 운기조식(運氣調息)은 기(氣)의 흐름을 조절하고 마음을 다스리는 명상입니다. " )
29- . multilineTextAlignment ( . center)
35+ . frame ( height: 100 )
36+ HStack {
37+ Spacer ( )
38+ VStack ( spacing: 24 ) {
39+ Text ( " 運氣調息 " )
40+ . font ( . system( size: 80 ) )
41+ VStack ( alignment: . leading, spacing: 8 ) {
42+ Text ( " 운기조식(運氣調息)은 기(氣)의 흐름을 조절하고 마음을 다스리는 명상입니다. " )
43+ . multilineTextAlignment ( . center)
44+ }
45+ . font ( . customBody)
3046 }
31- . font ( . customBody )
47+ Spacer ( )
3248 }
33- Spacer ( )
34- }
35- ForEach ( WuxiaInfo . dummyInfoList) { info in
36- VStack ( alignment: . leading, spacing: 26 ) {
37- Text ( info. title)
38- . font ( . customTitle3Bold)
39- ForEach ( info. infoList) { subInfo in
40- VStack ( alignment: . leading, spacing: 8 ) {
41- if let subTitle = subInfo. title {
42- Text ( subTitle)
43- }
44- VStack ( alignment: . leading, spacing: 20 ) {
45- ForEach ( subInfo. description, id: \. self) { desciption in
46- Text ( desciption)
49+ ForEach ( WuxiaInfo . dummyInfoList) { info in
50+ VStack ( alignment: . leading, spacing: 26 ) {
51+ Text ( info. title)
52+ . font ( . customTitle3Bold)
53+ ForEach ( info. infoList) { subInfo in
54+ VStack ( alignment: . leading, spacing: 8 ) {
55+ if let subTitle = subInfo. title {
56+ Text ( subTitle)
57+ }
58+ VStack ( alignment: . leading, spacing: 20 ) {
59+ ForEach ( subInfo. description, id: \. self) { desciption in
60+ Text ( desciption)
61+ }
4762 }
63+ . opacity ( 0.7 )
4864 }
49- . opacity ( 0.7 )
5065 }
5166 }
67+ . font ( . customBody)
5268 }
53- . font ( . customBody)
5469 }
70+ . padding ( )
71+ . foregroundStyle ( . white)
72+ . lineSpacing ( 8 )
5573 }
56- . padding ( )
57- . foregroundStyle ( . white)
58- . lineSpacing ( 8 )
5974 }
6075 }
6176 }
@@ -64,5 +79,5 @@ struct WuxiaInfoView: View {
6479
6580
6681#Preview {
67- WuxiaInfoView ( )
82+ WuxiaInfoView ( isShowWuxiaInfo : . constant ( true ) )
6883}
0 commit comments