-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feature] 홈뷰와 관련된 UI 컴포넌트 구현
- Loading branch information
Showing
9 changed files
with
260 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// Quote.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 1/4/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct Quote: View { | ||
var body: some View { | ||
VStack { | ||
Text("행동보다 빠르게 불안감을 \n 없앨 수 있는 것은 없습니다.") | ||
.font(.pretendard(size: 18, weight: .regular), lineHeight: 20) | ||
.foregroundColor(.gray100) | ||
.multilineTextAlignment(.center) | ||
|
||
Text("- 윌터 앤더슨") | ||
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18) | ||
.foregroundColor(.gray200) | ||
.multilineTextAlignment(.center) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
Quote() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// StudyPeriod.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 1/4/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct StudyPeriod: View { | ||
let startTime: Date | ||
let endTime: Date | ||
|
||
var body: some View { | ||
HStack(spacing: 0) { | ||
VStack(alignment: .leading, spacing: 11) { | ||
HStack(spacing: 13) { | ||
Text("Start") | ||
.font(.suite(size: 12, weight: .medium), lineHeight: 15) | ||
.foregroundStyle(.gray300) | ||
Image(.lineArrow) | ||
.offset(y: -3) | ||
} | ||
|
||
HStack(alignment: .firstTextBaseline, spacing: 6) { | ||
Text(startTime.getHourMinutes()) | ||
.font(.suite(size: 30, weight: .black), lineHeight: 32) | ||
.foregroundColor(.gray100) | ||
Text(startTime.getDaypart()) | ||
.font(.suite(size: 14, weight: .medium), lineHeight: 32) | ||
.foregroundStyle(.gray100) | ||
} | ||
} | ||
|
||
VStack(alignment: .leading, spacing: 11) { | ||
HStack(spacing: 13) { | ||
Text("End") | ||
.font(.suite(size: 12, weight: .medium), lineHeight: 15) | ||
.foregroundStyle(.gray300) | ||
} | ||
|
||
HStack(alignment: .firstTextBaseline, spacing: 6) { | ||
Text(endTime.getHourMinutes()) | ||
.font(.suite(size: 30, weight: .black), lineHeight: 32) | ||
.foregroundColor(.gray100) | ||
Text(endTime.getDaypart()) | ||
.font(.suite(size: 14, weight: .medium), lineHeight: 32) | ||
.foregroundStyle(.gray100) | ||
} | ||
} | ||
.padding(.leading, 18) | ||
|
||
Spacer() | ||
} | ||
} | ||
} | ||
|
||
|
||
//#Preview { | ||
// StudyPeriod(startTime: .now, endTime: .now) | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// TimerView.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 1/4/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct TimerView: View { | ||
var body: some View { | ||
VStack(alignment: .leading, spacing: 0) { | ||
Text("Time Left") | ||
.font(.suite(size: 12, weight: .medium), lineHeight: 15) | ||
.foregroundStyle(.gray300) | ||
|
||
Text("06:00:00") | ||
.font(.suite(size: 30, weight: .black), lineHeight: 32) | ||
.foregroundColor(.white) | ||
.padding(.top, 11) | ||
|
||
LinearProgressView(shape: Rectangle(), value: 1) | ||
.frame(height: 8) | ||
.padding(.top, 16) | ||
} | ||
} | ||
} | ||
|
||
struct LinearProgressView<Shape: SwiftUI.Shape>: View { | ||
var shape: Shape | ||
let value: Double | ||
|
||
var body: some View { | ||
VStack { | ||
shape.fill(.gray600) | ||
.overlay(alignment: .leading) { | ||
GeometryReader { proxy in | ||
shape.fill(.blue100) | ||
.frame(width: proxy.size.width * value) | ||
} | ||
} | ||
} | ||
.animation(.easeInOut, value: value) | ||
} | ||
} | ||
|
||
#Preview { | ||
TimerView() | ||
} |
46 changes: 46 additions & 0 deletions
46
HongikYeolgong2/Presentation/Home/WeeklyStudy/WeeklyStudy.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// WeeklyStudy.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 1/4/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct WeeklyStudy: View { | ||
var body: some View { | ||
HStack { | ||
ForEach(0..<7, id: \.self) { number in | ||
if number != 0 && number != 7 { | ||
Spacer() | ||
} | ||
WeeklyStudyCell() | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct WeeklyStudyCell: View { | ||
var body: some View { | ||
VStack { | ||
Text("월") | ||
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18) | ||
.foregroundStyle(.gray400) | ||
|
||
VStack { | ||
Image(.shineCount00) | ||
} | ||
.frame(height: 28) | ||
.padding(.top, 8) | ||
.padding(.bottom, 2) | ||
|
||
Text("1/1") | ||
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18) | ||
.foregroundStyle(.gray400) | ||
} | ||
} | ||
} | ||
|
||
//#Preview { | ||
// WeeklyStudy() | ||
//} |
8 changes: 8 additions & 0 deletions
8
HongikYeolgong2/Presentation/Home/WeeklyStudy/WeeklyStudyFeature.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// WeeklyStudyFeature.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 1/4/25. | ||
// | ||
|
||
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters