Skip to content

Commit f9d5c24

Browse files
authored
Merge pull request #7 from moonkey48/feature/#6
Feature/#6
2 parents 04238c7 + 3ced654 commit f9d5c24

File tree

18 files changed

+221
-163
lines changed

18 files changed

+221
-163
lines changed

WuxiaMeditation.xcodeproj/project.pbxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
3A6D29642C4007A300C1BD41 /* GrainGradient.metal in Sources */ = {isa = PBXBuildFile; fileRef = 3A6D29632C4007A300C1BD41 /* GrainGradient.metal */; };
3030
3A6D29662C425B6D00C1BD41 /* BacgkroundEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6D29652C425B6D00C1BD41 /* BacgkroundEffect.swift */; };
3131
3A9EB0B72C59182700DA5553 /* DefaultBackgroundAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A9EB0B62C59182700DA5553 /* DefaultBackgroundAnimationView.swift */; };
32+
3ABBCE8B2C5F5A3100D453A0 /* MeditationState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ABBCE8A2C5F5A3100D453A0 /* MeditationState.swift */; };
3233
3AF108AB2C20804100A956A1 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF108AA2C20804100A956A1 /* NotificationManager.swift */; };
3334
3AF108AD2C20809300A956A1 /* NotificationSelectDateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF108AC2C20809300A956A1 /* NotificationSelectDateView.swift */; };
3435
3AF108AF2C21B9AF00A956A1 /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF108AE2C21B9AF00A956A1 /* SettingView.swift */; };
@@ -59,6 +60,7 @@
5960
3A6D29632C4007A300C1BD41 /* GrainGradient.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = GrainGradient.metal; sourceTree = "<group>"; };
6061
3A6D29652C425B6D00C1BD41 /* BacgkroundEffect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BacgkroundEffect.swift; sourceTree = "<group>"; };
6162
3A9EB0B62C59182700DA5553 /* DefaultBackgroundAnimationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultBackgroundAnimationView.swift; sourceTree = "<group>"; };
63+
3ABBCE8A2C5F5A3100D453A0 /* MeditationState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeditationState.swift; sourceTree = "<group>"; };
6264
3AF108AA2C20804100A956A1 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = "<group>"; };
6365
3AF108AC2C20809300A956A1 /* NotificationSelectDateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSelectDateView.swift; sourceTree = "<group>"; };
6466
3AF108AE2C21B9AF00A956A1 /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
@@ -132,6 +134,7 @@
132134
3A5AFB942C1CBC350093D449 /* WuxiaTime.swift */,
133135
3A5AFB962C1CBD5F0093D449 /* EneryState.swift */,
134136
3A5AFB982C1CC46B0093D449 /* MeditationSentence.swift */,
137+
3ABBCE8A2C5F5A3100D453A0 /* MeditationState.swift */,
135138
);
136139
path = Model;
137140
sourceTree = "<group>";
@@ -296,6 +299,7 @@
296299
buildActionMask = 2147483647;
297300
files = (
298301
3A5AFB6D2C1CA6FD0093D449 /* ContentView.swift in Sources */,
302+
3ABBCE8B2C5F5A3100D453A0 /* MeditationState.swift in Sources */,
299303
3A5AFBB02C1D07660093D449 /* AudioPlayManager.swift in Sources */,
300304
3A5AFBC32C2046850093D449 /* MeditationObservable.swift in Sources */,
301305
3A5AFB8A2C1CB0C10093D449 /* Font+.swift in Sources */,
@@ -451,6 +455,8 @@
451455
ENABLE_PREVIEWS = YES;
452456
GENERATE_INFOPLIST_FILE = YES;
453457
INFOPLIST_FILE = WuxiaMeditation/Info.plist;
458+
INFOPLIST_KEY_CFBundleDisplayName = "운기조식";
459+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
454460
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
455461
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
456462
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -460,7 +466,7 @@
460466
"$(inherited)",
461467
"@executable_path/Frameworks",
462468
);
463-
MARKETING_VERSION = 1.0.0;
469+
MARKETING_VERSION = 1.1.0;
464470
PRODUCT_BUNDLE_IDENTIFIER = com.austin.WuxiaMeditation;
465471
PRODUCT_NAME = WuxiaMeditation;
466472
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -486,6 +492,8 @@
486492
ENABLE_PREVIEWS = YES;
487493
GENERATE_INFOPLIST_FILE = YES;
488494
INFOPLIST_FILE = WuxiaMeditation/Info.plist;
495+
INFOPLIST_KEY_CFBundleDisplayName = "운기조식";
496+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
489497
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
490498
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
491499
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -495,7 +503,7 @@
495503
"$(inherited)",
496504
"@executable_path/Frameworks",
497505
);
498-
MARKETING_VERSION = 1.0.0;
506+
MARKETING_VERSION = 1.1.0;
499507
PRODUCT_BUNDLE_IDENTIFIER = com.austin.WuxiaMeditation;
500508
PRODUCT_NAME = WuxiaMeditation;
501509
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

WuxiaMeditation.xcodeproj/xcuserdata/austinsmacbookprom3.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 6 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44
type = "1"
55
version = "2.0">
66
<Breakpoints>
7-
<BreakpointProxy
8-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9-
<BreakpointContent
10-
uuid = "A0CCCFF9-41E6-4D87-828E-13261153F2C0"
11-
shouldBeEnabled = "No"
12-
ignoreCount = "0"
13-
continueAfterRunningActions = "No"
14-
filePath = "WuxiaMeditation/Utils/NotificationManager.swift"
15-
startingColumnNumber = "9223372036854775807"
16-
endingColumnNumber = "9223372036854775807"
17-
startingLineNumber = "64"
18-
endingLineNumber = "64"
19-
landmarkName = "scheduleNotifications()"
20-
landmarkType = "7">
21-
</BreakpointContent>
22-
</BreakpointProxy>
237
<BreakpointProxy
248
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
259
<BreakpointContent
@@ -36,54 +20,6 @@
3620
landmarkType = "7">
3721
</BreakpointContent>
3822
</BreakpointProxy>
39-
<BreakpointProxy
40-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
41-
<BreakpointContent
42-
uuid = "7D7164A5-084C-4834-BE10-CA7AA84274EB"
43-
shouldBeEnabled = "No"
44-
ignoreCount = "0"
45-
continueAfterRunningActions = "No"
46-
filePath = "WuxiaMeditation/View/OnboardingView.swift"
47-
startingColumnNumber = "9223372036854775807"
48-
endingColumnNumber = "9223372036854775807"
49-
startingLineNumber = "47"
50-
endingLineNumber = "47"
51-
landmarkName = "body"
52-
landmarkType = "24">
53-
</BreakpointContent>
54-
</BreakpointProxy>
55-
<BreakpointProxy
56-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
57-
<BreakpointContent
58-
uuid = "DAD0E0B2-8DA4-42B7-86A3-03B0B1A65937"
59-
shouldBeEnabled = "No"
60-
ignoreCount = "0"
61-
continueAfterRunningActions = "No"
62-
filePath = "WuxiaMeditation/Utils/NotificationManager.swift"
63-
startingColumnNumber = "9223372036854775807"
64-
endingColumnNumber = "9223372036854775807"
65-
startingLineNumber = "56"
66-
endingLineNumber = "56"
67-
landmarkName = "scheduleNotifications()"
68-
landmarkType = "7">
69-
</BreakpointContent>
70-
</BreakpointProxy>
71-
<BreakpointProxy
72-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
73-
<BreakpointContent
74-
uuid = "0F927842-851F-4B45-9351-1672E2B457CA"
75-
shouldBeEnabled = "Yes"
76-
ignoreCount = "0"
77-
continueAfterRunningActions = "No"
78-
filePath = "WuxiaMeditation/Utils/NotificationManager.swift"
79-
startingColumnNumber = "9223372036854775807"
80-
endingColumnNumber = "9223372036854775807"
81-
startingLineNumber = "65"
82-
endingLineNumber = "65"
83-
landmarkName = "scheduleNotifications()"
84-
landmarkType = "7">
85-
</BreakpointContent>
86-
</BreakpointProxy>
8723
<BreakpointProxy
8824
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8925
<BreakpointContent
@@ -110,8 +46,8 @@
11046
filePath = "WuxiaMeditation/View/SettingView.swift"
11147
startingColumnNumber = "9223372036854775807"
11248
endingColumnNumber = "9223372036854775807"
113-
startingLineNumber = "98"
114-
endingLineNumber = "98"
49+
startingLineNumber = "101"
50+
endingLineNumber = "101"
11551
landmarkName = "setDateFromUserDefaults()"
11652
landmarkType = "7">
11753
</BreakpointContent>
@@ -126,8 +62,8 @@
12662
filePath = "WuxiaMeditation/View/SettingView.swift"
12763
startingColumnNumber = "9223372036854775807"
12864
endingColumnNumber = "9223372036854775807"
129-
startingLineNumber = "101"
130-
endingLineNumber = "101"
65+
startingLineNumber = "104"
66+
endingLineNumber = "104"
13167
landmarkName = "setDateFromUserDefaults()"
13268
landmarkType = "7">
13369
</BreakpointContent>
@@ -142,8 +78,8 @@
14278
filePath = "WuxiaMeditation/View/SettingView.swift"
14379
startingColumnNumber = "9223372036854775807"
14480
endingColumnNumber = "9223372036854775807"
145-
startingLineNumber = "104"
146-
endingLineNumber = "104"
81+
startingLineNumber = "107"
82+
endingLineNumber = "107"
14783
landmarkName = "setDateFromUserDefaults()"
14884
landmarkType = "7">
14985
</BreakpointContent>

WuxiaMeditation/Common/Components/DefaultBackgroundAnimationView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct DefaultBackgroundAnimationView: View {
1212
@State private var staticTime: Float = 0
1313
var body: some View {
1414
Rectangle()
15-
.fill(.circleMotionWithBackground(time: animationTime, secondTime: staticTime))
15+
.fill(.circleMotionWithBackground(timeForRotating: animationTime, timeForScale: staticTime))
1616
.ignoresSafeArea()
1717
.onAppear {
1818
Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { _ in

WuxiaMeditation/Common/Components/LargeButtonView.swift

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,16 @@ import SwiftUI
1010
struct LargeButtonView: View {
1111
var title: String
1212
var color: Color = .white
13-
var energyState: EnergyState = .level0
13+
var meditationRange: MeditationRange = .smallMeditation
1414
var completion: () -> Void
1515

16-
var backgroundColor: Color {
17-
switch energyState {
18-
case .level0: .primaryGreen
19-
case .level1: .primaryBlue
20-
case .level2: .primaryBrown
21-
case .level3: .primaryRed
22-
case .level4: .primaryGray
23-
}
24-
}
25-
2616
var body: some View {
2717
Button {
2818
completion()
2919
} label: {
3020
ZStack {
3121
RoundedRectangle(cornerRadius: 12.0)
32-
.fill(backgroundColor)
22+
.fill(meditationRange == .smallMeditation ? .primaryGreen : .secondaryGreen)
3323
.frame(width: .infinity, height: 50)
3424
Text(title)
3525
.font(.customBody)

WuxiaMeditation/Common/Extension/Date+.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import SwiftUI
99

1010
extension Date {
1111
var wuxiaTime: WuxiaTime {
12-
let date = Date()
1312
let calendar = Calendar.current
14-
let hour = calendar.component(.hour, from: date)
13+
let hour = calendar.component(.hour, from: self)
1514
for wuxiaTime in WuxiaTime.allCases {
1615
if wuxiaTime.timeRange ~= hour {
1716
return wuxiaTime

WuxiaMeditation/Common/Shader/BacgkroundEffect.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ private let br = Color("bottom_right")
2424
// MARK: - Grainy gradient
2525

2626
extension ShapeStyle where Self == AnyShapeStyle {
27-
static func circleMotionWithBackground(time: Float, secondTime: Float, gridSize: Int = 3) -> Self {
27+
static func circleMotionWithBackground(timeForRotating: Float, timeForScale: Float, gridSize: Int = 3) -> Self {
2828
return AnyShapeStyle(ShaderLibrary.default.circleMotionWithBackground(
2929
.boundingRect,
3030
.float(3),
31-
.float(time),
32-
.float(secondTime)
31+
.float(timeForRotating),
32+
.float(timeForScale)
3333
))
3434
}
3535

WuxiaMeditation/Common/Shader/GrainGradient.metal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ half4 circleMotionWithBackground(float2 position, float4 bounds, float size, flo
9494
float maxRadius = min(bounds.z, bounds.w) / 2.0;
9595
float minRadius = maxRadius / 4.0;
9696

97-
float cycleTime = 15.0;
97+
float cycleTime = 14.0;
9898
float t = fmod(secondTime, cycleTime);
9999
float radius;
100100

101-
if (t < 5.0) {
101+
if (t < 2.0) {
102102
radius = maxRadius;
103-
} else if (t < 10.0) {
104-
float progress = smoothstep(0.0, 1.0, (t - 5.0) / 5.0);
103+
} else if (t < 7.0) {
104+
float progress = smoothstep(0.0, 1.0, (t - 2.0) / 5.0);
105105
radius = mix(maxRadius, minRadius, progress);
106-
} else if (t < 13.0) {
106+
} else if (t < 9.0) {
107107
radius = minRadius;
108108
} else {
109-
float progress = smoothstep(0.0, 1.0, (t - 13.0) / 2.0);
109+
float progress = smoothstep(0.0, 1.0, (t - 9.0) / 5.0);
110110
radius = mix(minRadius, maxRadius, progress);
111111
}
112112

WuxiaMeditation/Model/MeditationSentence.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ let dummyMeditationSentenceList: [MeditationSentence] = [
2727
MeditationSentence(sentence: "어질지 않은 사람을 보면,\n속으로 스스로 반성하라.", author: "공자"),
2828
MeditationSentence(sentence: "거처는 마음을 변화시키고,\n수양은 몸을 변화시킨다.", author: "맹자"),
2929
MeditationSentence(sentence: "스스로 돌아봐서 잘못이 없다면,\n천만인이 가로막아도 나는 가리라.", author: "맹자"),
30+
MeditationSentence(sentence: "세상은 고통으로 가득하지만 한편 그것을 이겨내는 일로도 가득차 있다", author: "헬렌 켈러"),
31+
MeditationSentence(sentence: "쓰러진 자 망할까 두렵지 않고, 낮춘 자 거만할까 두렵지 않다", author: "J.버넌"),
32+
MeditationSentence(sentence: "노동은 세개의 큰 악, 즉, 지루함, 부도덕, 그리고 가난을 제거한다.", author: "괴테"),
3033
]
3134

3235

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// MeditationState.swift
3+
// 운기조식
4+
//
5+
// Created by Austin's Macbook Pro M3 on 8/4/24.
6+
//
7+
8+
import SwiftUI
9+
10+
enum MeditationState {
11+
case notStarted
12+
case preparing
13+
case progressing
14+
}
15+
16+
enum MeditationRange {
17+
case smallMeditation
18+
case bigMeditation
19+
20+
var time: Int {
21+
switch self {
22+
case .smallMeditation:
23+
5
24+
case .bigMeditation:
25+
10
26+
}
27+
}
28+
}
29+
30+
enum BreathState {
31+
case inhale
32+
case exhale
33+
case pause
34+
35+
static let inhaleExhale: Int = 5
36+
static let pauseGap: Int = 2
37+
38+
var wuxiaDescription: String {
39+
switch self {
40+
case .inhale: "흡 吸"
41+
case .exhale: "호 呼"
42+
case .pause: ""
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)