'안녕하세요 OO님' 자리를 오늘 기록 상태로 대체: - 오늘 기록 없음 → 'OO님, 오늘은 아직 기록이 없어요' + 지금 기록하기 CTA - 오늘 기록 있음 → '오늘 N건 기록했어요' / 연속 2일+ → 'N일 연속 기록 중 🔥' Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+36
-2
@@ -80,6 +80,19 @@ const daysInMonth = computed(() => new Date(year, month, 0).getDate())
|
||||
const firstWeekday = computed(() => new Date(year, month - 1, 1).getDay()) // 0=일
|
||||
const todayDate = now.getFullYear() === year && now.getMonth() + 1 === month ? now.getDate() : 0
|
||||
|
||||
// ===== 오늘 기록 넛지(습관 유도) =====
|
||||
const todayCount = computed(() => dayMap.value[todayDate]?.items?.length || 0)
|
||||
// 오늘부터 거슬러 연속으로 기록된 일수(이번 달 데이터 기준)
|
||||
const streak = computed(() => {
|
||||
if (!todayDate) return 0
|
||||
let s = 0
|
||||
for (let d = todayDate; d >= 1; d--) {
|
||||
if ((dayMap.value[d]?.items?.length || 0) > 0) s++
|
||||
else break
|
||||
}
|
||||
return s
|
||||
})
|
||||
|
||||
const calendarCells = computed(() => {
|
||||
const cells = []
|
||||
for (let i = 0; i < firstWeekday.value; i++) cells.push(null)
|
||||
@@ -175,8 +188,18 @@ onMounted(load)
|
||||
<!-- ===== 로그인: 요약 대시보드 ===== -->
|
||||
<template v-if="auth.isAuthenticated">
|
||||
<header class="greet">
|
||||
<h1>안녕하세요, {{ displayName }}님 👋</h1>
|
||||
<p class="today">{{ monthLabel }} 가계부 요약</p>
|
||||
<template v-if="loading">
|
||||
<h1>{{ monthLabel }} 가계부</h1>
|
||||
</template>
|
||||
<template v-else-if="todayCount > 0">
|
||||
<h1 v-if="streak >= 2">{{ streak }}일 연속 기록 중이에요 🔥</h1>
|
||||
<h1 v-else>오늘 {{ todayCount }}건 기록했어요 ✏️</h1>
|
||||
<p class="today">{{ monthLabel }} 가계부 요약</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<h1>{{ displayName }}님, 오늘은 아직 기록이 없어요</h1>
|
||||
<RouterLink to="/account/entries" class="greet-cta">+ 지금 기록하기</RouterLink>
|
||||
</template>
|
||||
</header>
|
||||
|
||||
<p v-if="error" class="msg error">{{ error }}</p>
|
||||
@@ -385,6 +408,17 @@ onMounted(load)
|
||||
opacity: 0.65;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.greet-cta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.4rem 0.9rem;
|
||||
border-radius: 999px;
|
||||
background: hsla(160, 100%, 37%, 1);
|
||||
color: #fff;
|
||||
font-size: 0.88rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
/* 신규 유저 시작하기 안내 */
|
||||
.getting-started {
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user