Skip to content

Commit

Permalink
feat: #28 Implement Main View
Browse files Browse the repository at this point in the history
- ๋ฉ”์ธ๋ทฐ ๋ ˆ์ด์•„์›ƒ ๊ตฌํ˜„
  • Loading branch information
hyeyeonie committed Nov 4, 2024
1 parent dbb0c94 commit dc3f017
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FiveGuyes/FiveGuyes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
24360D462CD8A2F800E83D2B /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24360D452CD8A2F800E83D2B /* MainView.swift */; };
26890B952CAE811A008DFF49 /* FiveGuyesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26890B942CAE811A008DFF49 /* FiveGuyesApp.swift */; };
26890B972CAE811A008DFF49 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26890B962CAE811A008DFF49 /* ContentView.swift */; };
26890B992CAE811D008DFF49 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 26890B982CAE811D008DFF49 /* Assets.xcassets */; };
Expand All @@ -15,6 +16,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
24360D452CD8A2F800E83D2B /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
26890B912CAE811A008DFF49 /* FiveGuyes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FiveGuyes.app; sourceTree = BUILT_PRODUCTS_DIR; };
26890B942CAE811A008DFF49 /* FiveGuyesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FiveGuyesApp.swift; sourceTree = "<group>"; };
26890B962CAE811A008DFF49 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -94,6 +96,7 @@
isa = PBXGroup;
children = (
26890B962CAE811A008DFF49 /* ContentView.swift */,
24360D452CD8A2F800E83D2B /* MainView.swift */,
26D852FB2CCE40BC0016239A /* Screen */,
26D852F92CCE40930016239A /* Navigation */,
26D853052CCE44970016239A /* Components */,
Expand Down Expand Up @@ -234,6 +237,7 @@
buildActionMask = 2147483647;
files = (
26890B972CAE811A008DFF49 /* ContentView.swift in Sources */,
24360D462CD8A2F800E83D2B /* MainView.swift in Sources */,
26890B952CAE811A008DFF49 /* FiveGuyesApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "wandoki.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 128 additions & 0 deletions FiveGuyes/FiveGuyes/Sources/Views/MainView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
//
// MainView.swift
// FiveGuyes
//
// Created by ์‹ ํ˜œ์—ฐ on 11/4/24.
//

import SwiftUI

struct MainView: View {
var body: some View {
VStack(spacing: 0) {
HStack {
Spacer()
Image(systemName: "bell")
.resizable()
.frame(width: 24, height: 24)
}
.padding(.horizontal, 20)
.padding(.vertical, 24)

ScrollView {
TitleView(title: "์„ธ๋‹ˆ๋‹˜, ๋ฐ˜๊ฐ€์›Œ์š”\n์™„๋…ํ•˜๊ณ  ์‹ถ์€ ์ฑ…์ด ์žˆ๋‚˜์š”?")
.padding(.bottom, 24)

ZStack {
Rectangle()
.foregroundColor(Color(red: 0.96, green: 0.98, blue: 0.97))
.frame(height: 220)
.cornerRadius(16)
.padding(.bottom, 16)
VStack {
HStack {
Text("์ฝ๊ณ  ์žˆ๋Š” ์ฑ…์ด ์—†์–ด์š”!\n์ฝ๊ณ  ์žˆ๋Š” ์ฑ…์„ ๋“ฑ๋กํ•ด์ฃผ์„ธ์š”")
.padding(.leading, 24)
.lineSpacing(6)
Spacer()
}
.padding(.top, 24)
Spacer()
HStack {
Spacer()
Image("wandoki")
.resizable()
.frame(width: 134, height: 125)
.padding(.bottom, 12)
}
}
}

HStack(spacing: 20) {
Button {
// TODO: ๋งŒ์•ฝ ์ฑ…์ด ๋“ฑ๋ก๋˜๋ฉด ํ™œ์„ฑํ™” - ์ „์ฒด ์บ˜๋ฆฐ๋” ๋ทฐ๋กœ ์ด๋™
} label: {
HStack {
Image(systemName: "calendar")
Text("์ „์ฒด")
}
.font(.system(size: 20))
.padding(16)
.foregroundColor(Color.gray)
.background(Color(red: 0.98, green: 1, blue: 0.99))
.overlay(
RoundedRectangle(cornerRadius: 16)
.inset(by: 0.5)
.stroke(Color.green.opacity(0.2), lineWidth: 1)
)
}

Button {
// TODO: ์™„๋…ํ•  ์ฑ… ์ถ”๊ฐ€ํ•˜๊ธฐ
} label: {
HStack {
Image(systemName: "plus")
Text("์™„๋…ํ•  ์ฑ… ์ถ”๊ฐ€ํ•˜๊ธฐ")
}
.font(.system(size: 20))
.padding(.vertical, 16)
.padding(.horizontal, 30)
.foregroundColor(Color.white)
.fontWeight(.semibold)
.background(Color.green)
.cornerRadius(16)
}
}
.padding(.bottom, 50)

VStack(spacing: 24) {
TitleView(title: "์™„๋… ๋ฆฌ์ŠคํŠธ")

// ์ฑ… ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 16) {
ForEach(0..<1) { _ in
// ์ถ”ํ›„ Rectangle()์„ Image()๋กœ ๋ณ€๊ฒฝ
Rectangle()
.foregroundColor(.clear)
.frame(width: 115, height: 178)
.background(Color(red: 0.96, green: 0.98, blue: 0.97))
.cornerRadius(6)
.shadow(color: Color(red: 0.84, green: 0.84, blue: 0.84).opacity(0.25), radius: 2, x: 0, y: 4)
}
}
}
}
}
.padding(.horizontal, 20)
}
}
}

struct TitleView: View {
var title: String

var body: some View {
HStack {
Text(title)
.font(.system(size: 22))
.fontWeight(.semibold)
.lineSpacing(6)
Spacer()
}
}
}

#Preview {
MainView()
}

0 comments on commit dc3f017

Please sign in to comment.