Skip to content

Commit

Permalink
Merge pull request #11 from Minn-Choi/feature/#6
Browse files Browse the repository at this point in the history
[Feature] #6 - Ako Stamp Write ๊ตฌํ˜„ ๋ฐ ํฐํŠธ ์ถ”๊ฐ€
  • Loading branch information
Minn-Choi authored Oct 23, 2024
2 parents 7e12cd8 + f1d6cd5 commit 34a4c7f
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 47 deletions.
Binary file added public/font/NanumSquareRoundB.ttf
Binary file not shown.
Binary file added public/font/NanumSquareRoundL.ttf
Binary file not shown.
Binary file added public/font/NanumSquareRoundR.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions src/assets/images/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/assets/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,28 @@ button {
.error-message {
@apply mt-1 text-xs text-red-500;
}

@font-face {
font-family: "NaB";
src: url("/public/font/NanumSquareRoundB.ttf") format("truetype");
}
@font-face {
font-family: "NaR";
src: url("/public/font/NanumSquareRoundR.ttf") format("truetype");
}
@font-face {
font-family: "NaL";
src: url("/public/font/NanumSquareRoundL.ttf") format("truetype");
}

.font-NaB {
font-family: 'NaB', sans-serif;
}

.font-NaL {
font-family: 'NaL', sans-serif;
}

.font-NaR {
font-family: 'NaR', sans-serif;
}
10 changes: 10 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ const routes = [
path: 'ako-stamp-write',
name: 'AkoStampWriteView',
component: importedViews['AkoStampWriteView'] // ์ž๋™ ์ž„ํฌํŠธ ์ ์šฉ
},
{
path: 'ako-stamp-board',
name: 'AkoStampBoard',
component: importedViews['AkoStampBoard'] // ์ž๋™ ์ž„ํฌํŠธ ์ ์šฉ
},
{
path: 'ako-stamp-follow',
name: 'AkoStampFollow',
component: importedViews['AkoStampFollow'] // ์ž๋™ ์ž„ํฌํŠธ ์ ์šฉ
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions src/views/feed/AkoStampBoard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<div>
<h1>Ako Stamp Board</h1>
<!-- ์ถ”๊ฐ€์ ์ธ ๋‚ด์šฉ -->
<Footer />
</div>
</template>

<script setup>
import Footer from '@/components/layout/Footer.vue'
</script>

<style>
/* ์ปดํฌ๋„ŒํŠธ ์Šคํƒ€์ผ */
</style>
15 changes: 15 additions & 0 deletions src/views/feed/AkoStampFollow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- AkoStampFollow.vue -->
<template>
<div>
<h1>Ako Stamp Follow</h1>
<!-- ์ถ”๊ฐ€์ ์ธ ๋‚ด์šฉ -->
</div>
</template>

<script setup>
// ํ•„์š”ํ•œ JavaScript ์ฝ”๋“œ
</script>

<style>
/* ์ปดํฌ๋„ŒํŠธ ์Šคํƒ€์ผ */
</style>
98 changes: 51 additions & 47 deletions src/views/feed/AkoStampWriteView.vue
Original file line number Diff line number Diff line change
@@ -1,80 +1,84 @@
<!-- ๋กœ๊ทธ์ธํ•˜๊ณ  id๊ฐ’ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๊ฒƒ๊ณผ ๋“ฑ๋ก ํ…Œ์ŠคํŠธ ํ•ด์•ผํ•จ -->
<template>
<div class="min-h-screen bg-[#FFF9F2] font-pretendard flex justify-center">
<div
class="w-[395px] min-w-[340px] bg-[#FAE8DA] min-h-screen relative overflow-y-auto"
>
<!-- ์ƒ๋‹จ๋ฐ” -->
<header
class="bg-white shadow-sm py-3 px-4 fixed top-0 left-1/2 transform -translate-x-1/2 w-[395px] min-w-[340px] z-10"
>
<div class="w-[395px] min-w-[340px] bg-[#FAE8DA] min-h-screen relative overflow-y-auto">
<header class="bg-white shadow-sm py-3 px-4 fixed top-0 left-1/2 transform -translate-x-1/2 w-[395px] min-w-[340px] z-10">
<div class="flex items-center justify-between">
<img src="@/assets/images/Akoming.svg" alt="๋กœ๊ณ " class="h-8" />
<button
class="text-[#F6B87A] hover:bg-[#F6B87A] hover:bg-opacity-10 px-2 py-1 rounded-full transition-colors duration-300 text-sm"
>
๋งˆ์ดํŽ˜์ด์ง€
</button>
</div>
</header>

<!-- ๋ณธ๋ฌธ ๋‚ด์šฉ -->
<main class="flex flex-col px-6 pt-20 pb-24">
<!-- ์˜ค๋Š˜ ๋‚ ์งœ์™€ ๋ฌธ๊ตฌ -->
<div class="mb-6 text-center">
<p class="mb-2 text-lg text-gray-600">{{ currentDate }}</p>
<p class="text-2xl font-bold text-gray-800">
<span class="text-[#F6B87A]">{{ nickname }}</span
>๋‹˜, ์˜ค๋Š˜๋„ ์„ฑ์žฅํ•ด์š”!

<img src="@/assets/images/back.svg" alt="์ด์ „"
style="width: 24px; height: 24px; margin-top:10px; margin-bottom:20px; cursor: pointer; "
/>

<div class="bg-white rounded-2xl "
style="height:600px">
<div class="mb-6 text-center p-4 flex items-center justify-between">
<p class="mb-2 text-[#FF7F00] text-left mt-4 text-lg text-gray-600 padding font-NaR"
style="font-size: 30px; color:#FF7F00; font-style: normal; font-weight: 400; line-height: normal;">
<span class="text-[25px]"> {{ currentDate[0] }} </span><br />
{{ currentDate[1] }}<br />
{{ currentDate[2] }}
</p>

<p class="text-2xl text-right text-gray-800 font-NaL">
<span class="text-[#00000] font-bold font-NaL">{{ nickname }}</span> ๋‹˜,<br> ์˜ค๋Š˜๋„ ์„ฑ์žฅํ•ด์š”!
</p>
</div>

<!-- ๋ฌธ๊ตฌ ์ž…๋ ฅ๋ž€ -->
<div class="mb-6">
<textarea
v-model="userText"
placeholder="์˜ค๋Š˜์˜ ๋ฌธ๊ตฌ๋ฅผ ์ ์–ด์ฃผ์„ธ์š”"
maxlength="50"
rows="3"
class="w-full px-4 py-3 bg-white border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[#F6B87A] focus:border-transparent transition duration-200 resize-none"
></textarea>
<p class="mt-1 text-sm text-right text-gray-500">
<div class="mb-6 flex justify-center">
<textarea
v-model="userText"
placeholder="์˜ค๋Š˜์˜ ๋ฌธ๊ตฌ๋ฅผ ์ ์–ด์ฃผ์„ธ์š”"
maxlength="50"
rows="4"
class="px-4 text-center mt-14 bg-white font-NaL border-none text-sm focus:outline-none transition duration-200 resize-none"
style="width: 260px; padding: 0 10px; background: linear-gradient(to bottom, transparent 19px, rgba(169, 169, 169, 0.5) 19px, rgba(169, 169, 169, 0.5) 20px, transparent 20px); background-size: 100% 20px;"
></textarea>
</div>

<p class="text-[#B3B3B3] mt-1 font-NaL text-sm text-right px-5 pb-12 ">
{{ userText.length }}/50
</p>
</div>

<!-- ๋“ฑ๋กํ•˜๊ธฐ ๋ฒ„ํŠผ -->
<div class="flex justify-center">
<button
@click="registerGoal"
class="w-full max-w-xs px-4 py-3 bg-[#F6B87A] text-white text-sm font-medium rounded-full hover:bg-[#e5a769] transition-colors duration-300"
class="font-NaR mt-12 px-2 py-3 mb-4 bg-[#F6B87A] text-white text-sm rounded-full hover:bg-[#FF7F00] transition-colors duration-300"
style="width: 200px; font-size:17px "
>
๋“ฑ๋กํ•˜๊ธฐ
</button>

</div>
</div>
</main>

<!-- ํ•˜๋‹จ๋ฐ” -->
<MainFooter />
<Footer />
</div>
</div>
</template>

<script setup>
import { ref } from 'vue'
import { ref, computed } from 'vue'
import axios from 'axios'
import MainFooter from '@/components/layout/Footer.vue'
import Footer from '@/components/layout/Footer.vue'

const currentDate = computed(() => {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
return [year, month, day];
});

const currentDate = ref(
new Date().toLocaleDateString('ko-KR', {
year: 'numeric',
month: 'long',
day: 'numeric'
})
)
const nickname = ref('๋‹‰๋„ค์ž„')
const userText = ref('')

// ์‚ฌ์šฉ์ž ID๋Š” ์˜ˆ์‹œ๋กœ '1'์„ ์‚ฌ์šฉํ•˜์ง€๋งŒ, ์‹ค์ œ๋กœ๋Š” ๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž ์ •๋ณด๋ฅผ ํ†ตํ•ด ๊ฐ€์ ธ์™€์•ผ ํ•จ
const userId = 1

const registerGoal = async () => {
Expand All @@ -83,12 +87,12 @@ const registerGoal = async () => {
const response = await axios.post(
`${process.env.VUE_APP_BE_API_URL}/api/goals`,
{
userId: userId, // ์‚ฌ์šฉ์ž ID
content: userText.value // ๋ชฉํ‘œ ๋‚ด์šฉ
userId: userId,
content: userText.value
}
)
alert(`๋ชฉํ‘œ๊ฐ€ ๋“ฑ๋ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค: ${response.data.content}`)
userText.value = '' // ์ž…๋ ฅ์ฐฝ ์ดˆ๊ธฐํ™”
userText.value = ''
} catch (error) {
console.error('๋ชฉํ‘œ ๋“ฑ๋ก ์˜ค๋ฅ˜:', error)
alert('๋ชฉํ‘œ ๋“ฑ๋ก์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด์ฃผ์„ธ์š”.')
Expand All @@ -97,4 +101,4 @@ const registerGoal = async () => {
alert('๋ฌธ๊ตฌ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.')
}
}
</script>
</script>

0 comments on commit 34a4c7f

Please sign in to comment.