Skip to content

Commit

Permalink
Merge pull request #51 from APPSCHOOL3-iOS/feature/timerReportView
Browse files Browse the repository at this point in the history
design: TimerReportView 버튼수정, 다크모드 대응, 피자이미지 추가
  • Loading branch information
YeoSungeun committed Oct 14, 2023
2 parents 350bd9d + 976fef0 commit 8e3cd35
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
20 changes: 17 additions & 3 deletions Pickle/Pickle/Screen/Home/TimerReportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ struct TimerReportView: View {
Text("대단해요! 피자 한 조각을 얻었어요!!🍕")
.font(Font.pizzaHeadlineBold)
.padding()

Image("smilePizza")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: .screenWidth * 0.75)

VStack {
ZStack {
RoundedRectangle(cornerRadius: 8)
.fill(Color.lightGray)
.fill(.quaternary)
.frame(height: 80)
.padding(.horizontal)
.padding(.vertical, 4)
Expand All @@ -42,7 +48,7 @@ struct TimerReportView: View {
}
ZStack {
RoundedRectangle(cornerRadius: 8)
.fill(Color.lightGray)
.fill(.quaternary)
.frame(height: 80)
.padding(.horizontal)
.padding(.vertical, 4)
Expand All @@ -58,7 +64,7 @@ struct TimerReportView: View {
}
ZStack {
RoundedRectangle(cornerRadius: 8)
.fill(Color.lightGray)
.fill(.quaternary)
.frame(height: 80)
.padding(.horizontal)
.padding(.vertical, 4)
Expand All @@ -80,7 +86,15 @@ struct TimerReportView: View {
dismiss()
}, label: {
Text("확인")
.font(.title3)
.bold()
.padding(.vertical, 8)
.frame(width: .screenWidth * 0.2)
.foregroundColor(.primary)
.colorInvert()
})
.buttonStyle(.borderedProminent)
.tint(.primary)
}
.onAppear {
isComplete = true
Expand Down
14 changes: 8 additions & 6 deletions Pickle/Pickle/Screen/Home/TimerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ struct TimerView: View {
ZStack {
Circle()
.fill(.clear)
.frame(width: CGFloat.screenWidth * 0.75)
.frame(width: .screenWidth * 0.75)
.overlay(Circle().stroke(.tertiary, lineWidth: 5))
Circle()
.trim(from: 0, to: progress())
.stroke(Color.primary, style: StrokeStyle(lineWidth: 5, lineCap: .round))
.frame(width: CGFloat.screenWidth * 0.75)
.frame(width: .screenWidth * 0.75)
.rotationEffect(.degrees(-90))

if isStart {
Expand All @@ -85,7 +85,8 @@ struct TimerView: View {
if isDecresing {
// 남은시간 줄어드는 타이머
Text(convertSecondsToTime(timeInSecond: timeRemaining))
.font(Font.pizzaTitleBold)
.font(.system(size: 40))
.fontWeight(.heavy)
.onReceive(timer) { _ in
if !isComplete {
timeRemaining -= 1
Expand All @@ -102,7 +103,8 @@ struct TimerView: View {
// 추가시간 늘어나는 타이머
HStack {
Text("+ \(convertSecondsToTime(timeInSecond: timeExtra))")
.font(Font.pizzaTitleBold)
.font(.system(size: 40))
.fontWeight(.heavy)
.onReceive(timer) { _ in
if !isStart && !isComplete {
timeExtra += 1
Expand Down Expand Up @@ -251,14 +253,14 @@ struct TimerView: View {
}
}
}

struct TimerView_Previews: PreviewProvider {
static var previews: some View {
NavigationStack {
TimerView(todo: Todo(id: UUID().uuidString,
content: "이력서 작성하기",
startTime: Date(),
targetTime: 60,
targetTime: 3800,
spendTime: Date() + 5400,
status: .ready), isShowingTimerView: .constant(false))
}
Expand Down

0 comments on commit 8e3cd35

Please sign in to comment.