Skip to content

Commit a36f794

Browse files
authored
Merge pull request #11 from moonkey48/fix/#10
Fix/#10: 명상 화면 UI 정렬 및 SettingView UI 수정
2 parents 9fdc544 + 75b3d86 commit a36f794

File tree

8 files changed

+233
-54
lines changed

8 files changed

+233
-54
lines changed

WuxiaMeditation.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
3A42B9F22C63AFA200F8CEC7 /* WuxiaInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A42B9F12C63AFA200F8CEC7 /* WuxiaInfoView.swift */; };
11+
3A42B9F42C63CD0000F8CEC7 /* WuxiaInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A42B9F32C63CD0000F8CEC7 /* WuxiaInfo.swift */; };
1012
3A5AFB6B2C1CA6FD0093D449 /* WuxiaMeditationApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5AFB6A2C1CA6FD0093D449 /* WuxiaMeditationApp.swift */; };
1113
3A5AFB6D2C1CA6FD0093D449 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5AFB6C2C1CA6FD0093D449 /* ContentView.swift */; };
1214
3A5AFB712C1CA6FE0093D449 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A5AFB702C1CA6FE0093D449 /* Assets.xcassets */; };
@@ -36,6 +38,8 @@
3638
/* End PBXBuildFile section */
3739

3840
/* Begin PBXFileReference section */
41+
3A42B9F12C63AFA200F8CEC7 /* WuxiaInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WuxiaInfoView.swift; sourceTree = "<group>"; };
42+
3A42B9F32C63CD0000F8CEC7 /* WuxiaInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WuxiaInfo.swift; sourceTree = "<group>"; };
3943
3A5AFB672C1CA6FD0093D449 /* WuxiaMeditation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WuxiaMeditation.app; sourceTree = BUILT_PRODUCTS_DIR; };
4044
3A5AFB6A2C1CA6FD0093D449 /* WuxiaMeditationApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WuxiaMeditationApp.swift; sourceTree = "<group>"; };
4145
3A5AFB6C2C1CA6FD0093D449 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@@ -124,6 +128,7 @@
124128
3AF108AC2C20809300A956A1 /* NotificationSelectDateView.swift */,
125129
3A5AFB852C1CAC8B0093D449 /* MainView.swift */,
126130
3AF108AE2C21B9AF00A956A1 /* SettingView.swift */,
131+
3A42B9F12C63AFA200F8CEC7 /* WuxiaInfoView.swift */,
127132
);
128133
path = View;
129134
sourceTree = "<group>";
@@ -135,6 +140,7 @@
135140
3A5AFB962C1CBD5F0093D449 /* EneryState.swift */,
136141
3A5AFB982C1CC46B0093D449 /* MeditationSentence.swift */,
137142
3ABBCE8A2C5F5A3100D453A0 /* MeditationState.swift */,
143+
3A42B9F32C63CD0000F8CEC7 /* WuxiaInfo.swift */,
138144
);
139145
path = Model;
140146
sourceTree = "<group>";
@@ -301,6 +307,7 @@
301307
3A5AFB6D2C1CA6FD0093D449 /* ContentView.swift in Sources */,
302308
3ABBCE8B2C5F5A3100D453A0 /* MeditationState.swift in Sources */,
303309
3A5AFBB02C1D07660093D449 /* AudioPlayManager.swift in Sources */,
310+
3A42B9F22C63AFA200F8CEC7 /* WuxiaInfoView.swift in Sources */,
304311
3A5AFBC32C2046850093D449 /* MeditationObservable.swift in Sources */,
305312
3A5AFB8A2C1CB0C10093D449 /* Font+.swift in Sources */,
306313
3AF108AB2C20804100A956A1 /* NotificationManager.swift in Sources */,
@@ -317,6 +324,7 @@
317324
3A5AFB862C1CAC8B0093D449 /* MainView.swift in Sources */,
318325
3A5AFB932C1CBC190093D449 /* Date+.swift in Sources */,
319326
3A5AFB972C1CBD5F0093D449 /* EneryState.swift in Sources */,
327+
3A42B9F42C63CD0000F8CEC7 /* WuxiaInfo.swift in Sources */,
320328
);
321329
runOnlyForDeploymentPostprocessing = 0;
322330
};

WuxiaMeditation/Common/Extension/Font+.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ import SwiftUI
1010
extension Font {
1111
static let customLargeTitle: Font = .custom("GapyeongHanseokbong-Regular", size: 34, relativeTo: .largeTitle)
1212
static let customTitle: Font = .custom("GapyeongHanseokbong-Regular", size: 25, relativeTo: .title)
13+
static let customTitleBold: Font = .custom("GapyeongHanseokbong-Bold", size: 25, relativeTo: .title)
1314
static let customTitle2: Font = .custom("GapyeongHanseokbong-Regular", size: 22, relativeTo: .title2)
15+
static let customTitle2Bold: Font = .custom("GapyeongHanseokbong-Bold", size: 22, relativeTo: .title2)
1416
static let customTitle3: Font = .custom("GapyeongHanseokbong-Regular", size: 20, relativeTo: .title3)
17+
static let customTitle3Bold: Font = .custom("GapyeongHanseokbong-Bold", size: 20, relativeTo: .title3)
1518
static let customBody: Font = .custom("GapyeongHanseokbong-Regular", size: 17, relativeTo: .body)
19+
static let customBodyBold: Font = .custom("GapyeongHanseokbong-Bold", size: 17, relativeTo: .body)
1620
static let customCaption: Font = .custom("GapyeongHanseokbong-Regular", size: 14, relativeTo: .caption)
21+
static let customCaptionBold: Font = .custom("GapyeongHanseokbong-Bold", size: 14, relativeTo: .caption)
1722
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// WuxiaInfo.swift
3+
// 운기조식
4+
//
5+
// Created by Austin's Macbook Pro M3 on 8/8/24.
6+
//
7+
8+
import SwiftUI
9+
10+
struct WuxiaInfo: Identifiable {
11+
let id = UUID()
12+
var title: String
13+
var infoList: [WuxiaSubInfo]
14+
}
15+
16+
struct WuxiaSubInfo: Identifiable {
17+
let id = UUID()
18+
var title: String?
19+
var description: [String]
20+
}
21+
22+
extension WuxiaInfo {
23+
static let dummyInfoList: [WuxiaInfo] = [
24+
WuxiaInfo(title: "시 時", infoList: [
25+
WuxiaSubInfo(title: "자시(子時): 23:00 ~ 01:00", description: ["하루의 시작으로, 자정(午夜)을 포함합니다."]),
26+
WuxiaSubInfo(title: "축시(丑時): 01:00 ~ 03:00", description: ["소가 여물음을 되새김질하는 시간입니다."]),
27+
WuxiaSubInfo(title: "인시(寅時): 03:00 ~ 05:00", description: ["호랑이가 활동하기 시작하는 시간입니다."]),
28+
WuxiaSubInfo(title: "묘시(卯時): 05:00 ~ 07:00", description: ["토끼가 뛸 수 있는 새벽의 시간입니다. 이 시간대에는 해가 떠오르기 시작합니다."]),
29+
WuxiaSubInfo(title: "진시(辰時): 07:00 ~ 09:00", description: ["용이 하늘로 올라간다고 표현되는 아침 시간입니다."]),
30+
WuxiaSubInfo(title: "사시(巳時): 09:00 ~ 11:00", description: ["뱀이 활동하는 시간으로, 해가 중천에 떠 있는 시간대입니다."]),
31+
WuxiaSubInfo(title: "오시(午時): 11:00 ~ 13:00", description: ["말이 힘차게 달리는 정오의 시간입니다."]),
32+
WuxiaSubInfo(title: "미시(未時): 13:00 ~ 15:00", description: ["양이 풀을 뜯는 오후의 시간대입니다."]),
33+
WuxiaSubInfo(title: "신시(申時): 15:00 ~ 17:00", description: ["원숭이가 활발히 움직이는 시간으로, 오후 늦은 시간입니다."]),
34+
WuxiaSubInfo(title: "유시(酉時): 17:00 ~ 19:00", description: ["닭이 집으로 돌아오는 저녁 시간입니다."]),
35+
WuxiaSubInfo(title: "술시(戌時): 19:00 ~ 21:00", description: ["개가 밤을 지키기 위해 움직이는 시간입니다."]),
36+
WuxiaSubInfo(title: "해시(亥時): 21:00 ~ 23:00", description: ["돼지가 잠을 자는 밤의 시간대로, 하루의 끝을 의미합니다."]),
37+
]),
38+
WuxiaInfo(title: "소주천과 대주천 小周天 大周天", infoList: [
39+
WuxiaSubInfo(title: "소주천 (小周天)", description: [
40+
"(운기조식 앱에서는 1분 내외의 시간동안 운기조식하는 것으로 사용됩니다.)",
41+
"소주천은 작은 순환을 뜻하며, 주로 인체의 두 가지 주요 경락인 임맥(任脈)과 독맥(督脈)을 따라 기가 순환하는 것을 말합니다.",
42+
]),
43+
WuxiaSubInfo(title: "대주천 (大周天)", description: [
44+
"(운기조식 앱에서는 10분 내외의 시간동안 운기조식하는 것으로 사용됩니다.)",
45+
"대주천은 큰 순환을 뜻하며, 소주천보다 더 넓은 범위의 경락을 따라 기가 순환하는 것을 의미합니다. 대주천은 소주천에서 다루지 않는 12경락(十二經絡) 전체를 포함하며, 이는 인체 전체를 아우르는 더 복잡하고 깊은 기의 순환을 뜻합니다.",
46+
]),
47+
]),
48+
WuxiaInfo(title: "단전", infoList: [
49+
WuxiaSubInfo(description: [
50+
"(운기조식 앱에서는 마음의 상태, 안정도에 대한 의미로 사용됩니다.)",
51+
"단전(丹田)은 전통적인 동양 철학, 특히 도교와 기공 수련에서 매우 중요한 개념으로, 인체에 존재하는 세 개의 주요 에너지 센터를 가리킵니다. ",
52+
"이 단전은 기(氣)가 모이고 축적되는 곳으로 여겨지며, 신체와 정신의 균형을 유지하고 에너지를 조절하는 데 중요한 역할을 합니다.",
53+
]),
54+
]),
55+
]
56+
}

WuxiaMeditation/Observable/MeditationObservable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ extension MeditationObservable {
9696
calculateEnergyLevel()
9797
isMeditationDoneOnTime = true
9898
meditationState = .preparing
99+
isShowEndMeditationAlert = false
99100
}
100101
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
101102
withAnimation {

WuxiaMeditation/View/MainView.swift

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct EnergyCenterView: View {
109109

110110
var body: some View {
111111
Text(observable.isMeditationDoneOnTime ? observable.currentWuxiaTime.titleDescriptionAfterMeditation : observable.currentWuxiaTime.titleDescriptionBeforeMeditation)
112-
.font(.customTitle)
112+
.font(.customTitle2)
113113
.foregroundStyle(.white)
114114
.multilineTextAlignment(.center)
115115
.lineSpacing(6.0)
@@ -135,30 +135,31 @@ struct MeditationView: View {
135135
@Bindable var observable: MeditationObservable
136136

137137
var body: some View {
138-
Spacer()
139-
Spacer()
140-
VStack {
141-
if let desciription = observable.breathStateDescription?.wuxiaDescription {
142-
Text(desciription)
143-
.font(.customTitle3)
144-
.foregroundStyle(.white)
138+
ZStack {
139+
VStack {
140+
Spacer()
141+
if let desciription = observable.breathStateDescription?.wuxiaDescription {
142+
Text(desciription)
143+
.font(.customTitle3)
144+
.foregroundStyle(.white)
145+
}
146+
Spacer()
147+
}
148+
.animation(.easeInOut(duration: 1), value: observable.breathStateDescription?.wuxiaDescription)
149+
VStack {
150+
Spacer()
151+
VStack(spacing: 10) {
152+
Text(observable.meditationSentence.sentence)
153+
.font(.customTitle3)
154+
.lineSpacing(1.0)
155+
Text(observable.meditationSentence.author)
156+
.font(.customCaption)
157+
}
158+
.foregroundStyle(.primaryGreen)
159+
.multilineTextAlignment(.center)
160+
.padding(.bottom, 20)
145161
}
146162
}
147-
.animation(.easeInOut(duration: 1), value: observable.breathStateDescription?.wuxiaDescription)
148-
Spacer()
149-
Spacer()
150-
VStack(spacing: 10) {
151-
Text(observable.meditationSentence.sentence)
152-
.font(.customTitle3)
153-
.lineSpacing(1.0)
154-
Text(observable.meditationSentence.author)
155-
.font(.customCaption)
156-
}
157-
.foregroundStyle(.primaryGreen)
158-
.multilineTextAlignment(.center)
159-
.frame(height: 140)
160-
.padding(.bottom, 20)
161-
162163

163164
LargeButtonView(title: observable.isFinishedMeditation ? "운기조식 종료" : "\(observable.meditationTimeRemaining) 뒤 종료", color: .white.opacity(observable.isFinishedMeditation ? 1 : 0.5)) {
164165
withAnimation {

WuxiaMeditation/View/SettingView.swift

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,65 @@ struct SettingView: View {
1919
@State private var secondTime = Date()
2020
@State private var thirdTime = Date()
2121

22+
@State private var isShowWuxiaInfo = false
23+
2224
var body: some View {
2325
ZStack {
2426
DefaultBackgroundAnimationView()
25-
VStack(alignment: .leading, spacing: 30) {
26-
Text("운기조식 알람 시간")
27-
.font(.customTitle)
28-
.padding(.vertical, 24)
29-
.foregroundStyle(.primaryGreen)
30-
Spacer()
31-
.frame(height: 60)
32-
if isEditMode {
33-
DatePicker("첫번째 운기조식", selection: $firstTime, displayedComponents: [.hourAndMinute])
34-
.frame(height: 50)
35-
DatePicker("두번째 운기조식", selection: $secondTime, displayedComponents: [.hourAndMinute])
36-
.frame(height: 50)
37-
DatePicker("세번째 운기조식", selection: $thirdTime, displayedComponents: [.hourAndMinute])
38-
.frame(height: 50)
39-
} else {
40-
HStack {
41-
Text("첫번째 운기조식")
42-
Spacer()
43-
Text(firstTime.hourAndMinute)
44-
}
45-
.frame(height: 50)
46-
HStack {
47-
Text("두번째 운기조식")
48-
Spacer()
49-
Text(secondTime.hourAndMinute)
27+
VStack {
28+
VStack(alignment: .leading, spacing: 30) {
29+
VStack(alignment: .leading,spacing: 24) {
30+
HStack {
31+
Text("운기조식 알람 시간")
32+
.font(.customTitle3Bold)
33+
Spacer()
34+
Image(systemName: "person.and.background.dotted")
35+
}
36+
Divider()
37+
if isEditMode {
38+
DatePicker("첫번째 운기조식", selection: $firstTime, displayedComponents: [.hourAndMinute])
39+
DatePicker("두번째 운기조식", selection: $secondTime, displayedComponents: [.hourAndMinute])
40+
DatePicker("세번째 운기조식", selection: $thirdTime, displayedComponents: [.hourAndMinute])
41+
} else {
42+
HStack {
43+
Text("첫번째 운기조식")
44+
Spacer()
45+
Text(firstTime.hourAndMinute)
46+
}
47+
HStack {
48+
Text("두번째 운기조식")
49+
Spacer()
50+
Text(secondTime.hourAndMinute)
51+
}
52+
HStack {
53+
Text("세번째 운기조식")
54+
Spacer()
55+
Text(thirdTime.hourAndMinute)
56+
}
57+
}
5058
}
51-
.frame(height: 50)
52-
HStack {
53-
Text("세번째 운기조식")
54-
Spacer()
55-
Text(thirdTime.hourAndMinute)
59+
.padding(20)
60+
.background(
61+
RoundedRectangle(cornerRadius: 20)
62+
.fill(.white.opacity(0.3))
63+
)
64+
Button {
65+
isShowWuxiaInfo = true
66+
} label: {
67+
HStack(spacing: 24) {
68+
Text("무협입문 武俠入門")
69+
.font(.customTitle3Bold)
70+
Spacer()
71+
Image(systemName: "ipad.and.arrow.forward")
72+
}
73+
.padding(20)
74+
.background(
75+
RoundedRectangle(cornerRadius: 20)
76+
.fill(.white.opacity(0.3))
77+
)
5678
}
57-
.frame(height: 50)
5879
}
80+
.foregroundStyle(.primaryGreen)
5981
Spacer()
6082
}
6183
.font(.customTitle3)
@@ -88,6 +110,9 @@ struct SettingView: View {
88110
}
89111
}
90112
.padding()
113+
.sheet(isPresented: $isShowWuxiaInfo) {
114+
WuxiaInfoView(isShowWuxiaInfo: $isShowWuxiaInfo)
115+
}
91116
.onAppear {
92117
setDateFromUserDefaults()
93118
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//
2+
// WuxiaInfoView.swift
3+
// 운기조식
4+
//
5+
// Created by Austin's Macbook Pro M3 on 8/7/24.
6+
//
7+
8+
import SwiftUI
9+
10+
struct WuxiaInfoView: View {
11+
@Binding var isShowWuxiaInfo: Bool
12+
var body: some View {
13+
ZStack {
14+
DefaultBackgroundAnimationView()
15+
.ignoresSafeArea()
16+
Color.black.opacity(0.6)
17+
.ignoresSafeArea()
18+
.background(.ultraThinMaterial.opacity(0.4))
19+
VStack {
20+
HStack {
21+
Spacer()
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){
34+
Spacer()
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)
46+
}
47+
Spacer()
48+
}
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+
}
62+
}
63+
.opacity(0.7)
64+
}
65+
}
66+
}
67+
.font(.customBody)
68+
}
69+
}
70+
.padding()
71+
.foregroundStyle(.white)
72+
.lineSpacing(8)
73+
}
74+
}
75+
}
76+
}
77+
}
78+
79+
80+
81+
#Preview {
82+
WuxiaInfoView(isShowWuxiaInfo: .constant(true))
83+
}

0 commit comments

Comments
 (0)