From 9d1ae0e4028c65ef4efcd42468b497455077eb7c Mon Sep 17 00:00:00 2001 From: sb Date: Sun, 5 Jul 2026 16:40:45 +0900 Subject: [PATCH] =?UTF-8?q?feat(home):=20=EC=9D=B8=EC=82=AC=EB=A7=90?= =?UTF-8?q?=EC=9D=84=20'=EC=98=A4=EB=8A=98=20=EA=B8=B0=EB=A1=9D=20?= =?UTF-8?q?=EB=84=9B=EC=A7=80'=EB=A1=9C=20=E2=80=94=20=EC=8A=B5=EA=B4=80?= =?UTF-8?q?=20=EC=9C=A0=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '안녕하세요 OO님' 자리를 오늘 기록 상태로 대체: - 오늘 기록 없음 → 'OO님, 오늘은 아직 기록이 없어요' + 지금 기록하기 CTA - 오늘 기록 있음 → '오늘 N건 기록했어요' / 연속 2일+ → 'N일 연속 기록 중 🔥' Co-Authored-By: Claude Opus 4.8 --- src/views/HomeView.vue | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 4f19de9..e68908c 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -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)