Skip to content

Commit

Permalink
Merge pull request #17 from study2895/main
Browse files Browse the repository at this point in the history
[Feature] #16 - 메인 ν”Όλ“œ νŽ˜μ΄μ§€ κ΅¬ν˜„ 및 404νŽ˜μ΄μ§€ 이동
  • Loading branch information
study2895 authored Oct 27, 2024
2 parents 86db4c5 + b40157c commit 0c5c8cc
Show file tree
Hide file tree
Showing 10 changed files with 383 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/components/common/feed/CommentInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="comment-input">
<select v-model="selectedEmoji">
<option value="😊">😊</option>
<option value="πŸ‘">πŸ‘</option>
<option value="❀️">❀️</option>
</select>
<input type="text" v-model="comment" placeholder="λŒ“κΈ€ μž…λ ₯" />
<button @click="submitComment">μž‘μ„±</button>
</div>
</template>

<script setup>
import { ref } from 'vue'
const selectedEmoji = ref('')
const comment = ref('')
const submitComment = () => {
/* λŒ“κΈ€ 제좜 */
}
</script>

<style scoped>
.comment-input {
display: flex;
gap: 8px;
margin-top: 8px;
}
</style>
27 changes: 27 additions & 0 deletions src/components/common/feed/CommentList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="comment-list">
<div v-for="comment in comments" :key="comment.id" class="comment">
<span>{{ comment.nickname }}</span>
<span>{{ comment.emoji }}</span>
<p>{{ comment.content }}</p>
</div>
</div>
</template>

<script setup>
import { ref } from 'vue'
const comments = ref([
{ id: 1, nickname: '친ꡬ1', emoji: '😊', content: '쒋은 λͺ©ν‘œλ„€μš”!' },
{ id: 2, nickname: '친ꡬ2', emoji: 'πŸ‘', content: 'ν™”μ΄νŒ…!' }
])
</script>

<style scoped>
.comment-list .comment {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 8px;
}
</style>
63 changes: 63 additions & 0 deletions src/components/common/feed/FollowStats.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<div class="follow-stats" @click="goToFollowPage">
<div class="date-info">{{ formattedDate }}</div>
<div class="follow-info">
<span>νŒ”λ‘œμ›Œ {{ followerCount }}λͺ…</span>
<span>νŒ”λ‘œμž‰ {{ followingCount }}λͺ…</span>
<span class="arrow-icon">β€Ί</span>
</div>
</div>
</template>

<script setup>
import { ref } from 'vue'
const followerCount = ref(0) // APIμ—μ„œ λ°›μ•„μ˜€λŠ” νŒ”λ‘œμ›Œ 수
const followingCount = ref(0) // APIμ—μ„œ λ°›μ•„μ˜€λŠ” νŒ”λ‘œμž‰ 수
// ν˜„μž¬ λ‚ μ§œλ₯Ό ν¬λ§·νŒ…
const formattedDate = ref(
new Date().toLocaleDateString('ko-KR', {
year: 'numeric',
month: 'long',
day: 'numeric'
})
)
const goToFollowPage = () => {
// νŒ”λ‘œμš° 관리 νŽ˜μ΄μ§€λ‘œ μ΄λ™ν•˜λŠ” ν•¨μˆ˜
}
</script>

<style scoped>
.follow-stats {
display: flex;
align-items: center;
padding: 8px;
background-color: #f6f6f6;
font-family: 'NanumSquareRound', sans-serif;
}
.date-info {
flex: 1;
text-align: left;
color: #333;
font-size: 0.9rem;
}
.follow-info {
display: flex;
align-items: center;
gap: 10px;
}
.follow-info span {
color: #333;
font-size: 0.9rem;
}
.arrow-icon {
font-size: 1rem;
color: #999;
}
</style>
40 changes: 40 additions & 0 deletions src/components/common/feed/FriendGoal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div class="friend-goal">
<div class="goal-content">
<span>{{ friendNickname }}의 λͺ©ν‘œ: {{ friendGoalContent }}</span>
<button @click="toggleCommentSection">πŸ’¬</button>
</div>

<CommentInput v-if="showCommentSection" />
<CommentList v-if="showCommentSection" />
</div>
</template>

<script setup>
import { ref } from 'vue'
import CommentInput from './CommentInput.vue'
import CommentList from './CommentList.vue'
const friendNickname = ref('친ꡬ λ‹‰λ„€μž„')
const friendGoalContent = ref('친ꡬ의 였늘 λͺ©ν‘œ')
const showCommentSection = ref(false)
const toggleCommentSection = () => {
showCommentSection.value = !showCommentSection.value
}
</script>

<style scoped>
.friend-goal {
display: flex;
flex-direction: column;
gap: 4px;
}
.goal-content {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style>
63 changes: 63 additions & 0 deletions src/components/common/feed/MyGoal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<div class="my-goal">
<div class="goal-content">
<span>{{ nickname }}의 λͺ©ν‘œ: {{ goalContent }}</span>
<div class="goal-icons">
<button @click="toggleCommentSection">πŸ’¬</button>
<button @click="editGoal">✏️</button>
<button @click="deleteGoal">πŸ—‘οΈ</button>
</div>
</div>

<div v-if="showCommentSection" class="comment-section">
<CommentInput />
<CommentList />
</div>
</div>
</template>

<script setup>
import { ref } from 'vue'
import CommentInput from './CommentInput.vue'
import CommentList from './CommentList.vue'
const nickname = ref('λ‚΄ λ‹‰λ„€μž„')
const goalContent = ref('였늘의 λͺ©ν‘œ λ‚΄μš©')
const showCommentSection = ref(false)
const toggleCommentSection = () => {
showCommentSection.value = !showCommentSection.value
}
const editGoal = () => {
/* λͺ©ν‘œ μˆ˜μ • */
}
const deleteGoal = () => {
/* λͺ©ν‘œ μ‚­μ œ */
}
</script>

<style scoped>
.my-goal {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
.goal-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.goal-icons {
display: flex;
gap: 4px;
}
.comment-section {
margin-top: 8px;
}
</style>
29 changes: 29 additions & 0 deletions src/components/common/feed/SearchBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div class="search-bar">
<input
type="text"
v-model="nickname"
placeholder="친ꡬ λ‹‰λ„€μž„ 검색"
@input="searchFriend"
/>
</div>
</template>

<script setup>
import { ref } from 'vue'
const nickname = ref('')
const searchFriend = () => {
// 친ꡬ 검색 둜직 μΆ”κ°€
}
</script>

<style scoped>
.search-bar input {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
</style>
5 changes: 5 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ const routes = [
path: 'ako-stamp-follow',
name: 'AkoStampFollow',
component: importedViews['AkoStampFollow'] // μžλ™ μž„ν¬νŠΈ 적용
},
{
path: 'main',
name: 'MainFeedPage',
component: importedViews['MainFeedPage'] // μžλ™ μž„ν¬νŠΈ 적용
}
]
}
Expand Down
File renamed without changes.
94 changes: 94 additions & 0 deletions src/views/feed/FeedPageStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.min-h-screen {
background-color: #fff9f2;
font-family: 'Nanum Square Round', sans-serif;
}

.w-[395px] {
background-color: #fae8da;
min-width: 340px;
min-height: 100vh;
overflow-y: auto;
}

.text-center {
text-align: center;
}

h1 {
font-size: 1.25rem;
font-weight: 500;
color: #333333;
font-family: 'Uhbee Sehyun', sans-serif;
margin-bottom: 70px;
}

.relative svg path {
stroke: #bbb4b4;
stroke-width: 3;
fill: transparent;
}

.stamp {
width: 95px;
height: 95px;
display: flex;
justify-content: center;
align-items: center;
}

.flex-col {
display: flex;
flex-direction: column;
}

.space-y-3 > * + * {
margin-top: 0.75rem;
}

.task-box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
background-color: #fff;
border-radius: 17px;
color: #b3b3b3;
font-size: 0.875rem;
}

.task-box.completed {
color: #ff7f00;
}

.icon {
width: 1.25rem;
height: 1.25rem;
}

.icon.grayscale {
filter: grayscale(100%);
}

.ako-container {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 2.5rem;
}

.ako-container img {
width: 256px;
height: 256px;
}

.ako-container .mini-icon {
width: 2rem;
height: 2rem;
margin-right: 0.5rem;
}

.ako-container p {
font-size: 0.875rem;
color: #666666;
margin-bottom: 0.5rem;
}
32 changes: 32 additions & 0 deletions src/views/feed/MainFeedPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<template>
<div class="feed-page">
<MainHeader />
<SearchBar class="component-spacing" style="margin-top: 100px" />
<FollowStats class="component-spacing" />
<MyGoal class="component-spacing" />
<FriendGoal class="component-spacing" />
<MainFooter />
</div>
</template>

<script setup>
import SearchBar from '@/components/common/feed/SearchBar.vue'
import FollowStats from '@/components/common/feed/FollowStats.vue'
import MyGoal from '@/components/common/feed/MyGoal.vue'
import FriendGoal from '@/components/common/feed/FriendGoal.vue'
import CommentInput from '@/components/common/feed/CommentInput.vue'
import CommentList from '@/components/common/feed/CommentList.vue'
import './FeedPageStyle.css'
import MainHeader from '@/components/layout/Header.vue'
import MainFooter from '@/components/layout/Footer.vue'
</script>

<style scoped>
.feed-page {
max-width: 395px;
margin: 0 auto;
}
.component-spacing {
margin-bottom: 20px; /* μ»΄ν¬λ„ŒνŠΈ μ‚¬μ΄μ˜ 간격 μ‘°μ • */
}
</style>

0 comments on commit 0c5c8cc

Please sign in to comment.