Compare commits

..

4 Commits

Author SHA1 Message Date
e87155f909 v0.1.2 2026-04-21 14:44:56 +09:00
f3b2c84758 v0.1.1 2026-04-21 14:36:43 +09:00
314dd7f649 v0.1.0 2026-04-21 14:31:26 +09:00
0206cfebf8 v0.0.9 2026-04-21 14:21:08 +09:00
8 changed files with 394 additions and 90 deletions

View File

@@ -4,7 +4,7 @@
- 프로젝트명: 10 Minute Planner 웹 UI - 프로젝트명: 10 Minute Planner 웹 UI
- 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript - 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript
- 현재 기준 버전: `v0.0.8` - 현재 기준 버전: `v0.1.2`
## 기준 디자인 ## 기준 디자인
@@ -32,6 +32,7 @@
- STATS 완료율은 전체 15칸이 아니라, 실제로 입력된 TASKS만 기준으로 계산한다. - STATS 완료율은 전체 15칸이 아니라, 실제로 입력된 TASKS만 기준으로 계산한다.
- `TIME TABLE`은 드래그로 10분 블록을 연속 선택할 수 있다. - `TIME TABLE`은 드래그로 10분 블록을 연속 선택할 수 있다.
- `TIME TABLE`은 우클릭 드래그 시 선택된 블록을 지우는 방식으로도 편집할 수 있다. - `TIME TABLE`은 우클릭 드래그 시 선택된 블록을 지우는 방식으로도 편집할 수 있다.
- `TIME TABLE` 숫자 영역은 선택/드래그로 텍스트가 잡히지 않도록 막아두었다.
- `TOTAL TIME`은 타임테이블에서 선택된 블록 수를 기준으로 자동 계산된다. - `TOTAL TIME`은 타임테이블에서 선택된 블록 수를 기준으로 자동 계산된다.
- 달력은 연/월 이동이 가능하며, 현재 보이는 월과 선택된 날짜 상태를 분리해서 관리한다. - 달력은 연/월 이동이 가능하며, 현재 보이는 월과 선택된 날짜 상태를 분리해서 관리한다.
- 달력 상단은 월 좌우 화살표, 클릭형 연도 선택, `TODAY` 버튼 구조로 동작한다. - 달력 상단은 월 좌우 화살표, 클릭형 연도 선택, `TODAY` 버튼 구조로 동작한다.
@@ -40,6 +41,14 @@
- 플래너 상태는 `localStorage`에 저장되며, 날짜별 기록과 선택 날짜, 달력 보고 있던 월까지 복원된다. - 플래너 상태는 `localStorage`에 저장되며, 날짜별 기록과 선택 날짜, 달력 보고 있던 월까지 복원된다.
- 상단 전환 버튼으로 `PLANNER / STATS` 화면을 오갈 수 있다. - 상단 전환 버튼으로 `PLANNER / STATS` 화면을 오갈 수 있다.
- 통계 화면에서는 전체 집중 시간, 평균 완료율, 기록 일수, 최근 7일 흐름, 최근 기록, 베스트 데이를 보여준다. - 통계 화면에서는 전체 집중 시간, 평균 완료율, 기록 일수, 최근 7일 흐름, 최근 기록, 베스트 데이를 보여준다.
- 통계 화면은 시작일/종료일을 직접 선택해 그 기간 기준으로 지표를 다시 계산할 수 있다.
- `NEXT DAY` 영역의 요일도 본문 날짜와 같은 규칙으로 주말 색상이 적용된다.
- 플래너 화면에서는 `PRINT DAY` 버튼으로 현재 선택 날짜 문서를 바로 출력할 수 있다.
- 인쇄 시에는 현재 선택된 하루 플래너 본문만 남기고, 헤더/사이드패널/통계 화면은 숨긴다.
- 출력 버튼은 `PRINT 1-UP` / `PRINT 2-UP`으로 분리되어 있다.
- `PRINT 2-UP`은 현재 날짜와 다음 날짜를 A4 가로 기준으로 나란히 출력하는 용도다.
- 인쇄는 일반 화면을 그대로 찍는 방식이 아니라, 별도의 `print-only` 전용 레이아웃을 사용한다.
- A5 원본 비율을 유지한 채 A4 가로 안에 들어가도록 `1-UP` / `2-UP` 각각 별도 배율로 압축한다.
## 확정된 결정사항 ## 확정된 결정사항
@@ -62,6 +71,7 @@
- 장기적으로는 회원 가입 후 사용자별로 각자 문서를 작성/관리할 수 있어야 한다. - 장기적으로는 회원 가입 후 사용자별로 각자 문서를 작성/관리할 수 있어야 한다.
- 공유 문서 서비스가 아니라, 사용자 개인 보관과 회고 중심의 서비스 구조를 목표로 한다. - 공유 문서 서비스가 아니라, 사용자 개인 보관과 회고 중심의 서비스 구조를 목표로 한다.
- 사용자는 스스로 통계를 확인할 수 있어야 하고, 특정 날짜에 작성한 문서는 출력 가능해야 한다. - 사용자는 스스로 통계를 확인할 수 있어야 하고, 특정 날짜에 작성한 문서는 출력 가능해야 한다.
- 공유를 위해 나중에 이미지 저장 기능도 필요하지만, 실제 출력 품질과 텍스트 선명도는 HTML/CSS 인쇄 레이아웃을 우선 유지하는 편이 좋다.
## 다음 권장 작업 ## 다음 권장 작업
@@ -69,6 +79,7 @@
- 목표나 통계 기능보다 먼저, 플래너 본문의 입력과 상호작용을 우선 구현한다. - 목표나 통계 기능보다 먼저, 플래너 본문의 입력과 상호작용을 우선 구현한다.
- 통계 화면 구현은 현재 `localStorage` 기반으로 먼저 진행해도 된다. - 통계 화면 구현은 현재 `localStorage` 기반으로 먼저 진행해도 된다.
- DB는 기능 탐색 속도를 해치지 않는 선에서, 저장 레이어를 분리할 수 있는 적절한 시점에 붙이는 것이 좋다. - DB는 기능 탐색 속도를 해치지 않는 선에서, 저장 레이어를 분리할 수 있는 적절한 시점에 붙이는 것이 좋다.
- 이미지 저장 기능은 추후 `print-only` 또는 별도 export 전용 레이아웃을 기준으로 구현하면 화면/인쇄/공유 결과를 맞추기 쉽다.
## 갱신 규칙 ## 갱신 규칙

View File

@@ -62,6 +62,7 @@
- [x] 통계 페이지 요구사항을 정리한다. - [x] 통계 페이지 요구사항을 정리한다.
- [x] 통계 페이지 라우팅 또는 화면 전환 구조를 설계한다. - [x] 통계 페이지 라우팅 또는 화면 전환 구조를 설계한다.
- [x] 집중 시간, 완료율, 연속 기록 같은 핵심 지표를 정의한다. - [x] 집중 시간, 완료율, 연속 기록 같은 핵심 지표를 정의한다.
- [x] 사용자가 시작일과 종료일을 선택해서 기간별 통계를 볼 수 있게 한다.
- [ ] 사용자 개인 통계 화면 기준을 정리한다. - [ ] 사용자 개인 통계 화면 기준을 정리한다.
## 6단계: 계정 및 서비스 확장 ## 6단계: 계정 및 서비스 확장
@@ -69,7 +70,9 @@
- [ ] 회원 가입 / 로그인 방식 후보를 정리한다. - [ ] 회원 가입 / 로그인 방식 후보를 정리한다.
- [ ] 사용자별 문서 분리 저장 구조를 설계한다. - [ ] 사용자별 문서 분리 저장 구조를 설계한다.
- [ ] 공유가 아닌 개인 보관용 서비스 흐름으로 요구사항을 정리한다. - [ ] 공유가 아닌 개인 보관용 서비스 흐름으로 요구사항을 정리한다.
- [ ] 향후 출력 기능을 위한 인쇄 레이아웃 요구사항을 정리한다. - [x] 향후 출력 기능을 위한 인쇄 레이아웃 요구사항을 정리한다.
- [x] A4 가로 기준 2장 출력 모드를 지원한다.
- [ ] 공유를 위한 이미지 저장 기능을 추가한다.
## 메모 ## 메모
@@ -77,4 +80,5 @@
- `TIME TABLE` 드래그는 단순 사각형 선택이 아니라 시간 셀 단위의 연속 선택으로 해석한다. - `TIME TABLE` 드래그는 단순 사각형 선택이 아니라 시간 셀 단위의 연속 선택으로 해석한다.
- 현재는 `localStorage`로 개발을 진행하지만, 적절한 시점에 DB를 붙여 사용자별 저장 구조로 확장해야 한다. - 현재는 `localStorage`로 개발을 진행하지만, 적절한 시점에 DB를 붙여 사용자별 저장 구조로 확장해야 한다.
- 최종적으로는 회원 가입 후 각자 자신의 문서를 작성/관리하고, 개인 통계를 확인하며, 특정 날짜 문서를 출력할 수 있어야 한다. - 최종적으로는 회원 가입 후 각자 자신의 문서를 작성/관리하고, 개인 통계를 확인하며, 특정 날짜 문서를 출력할 수 있어야 한다.
- 실제 인쇄는 HTML/CSS 기반 프린트 레이아웃으로 유지하고, 공유용으로는 별도의 이미지 저장 기능을 추가하는 방향이 적합하다.
- 구현할 때마다 완료된 항목은 체크하고, 큰 결정사항은 `HANDOFF.md`에도 함께 반영한다. - 구현할 때마다 완료된 항목은 체크하고, 큰 결정사항은 `HANDOFF.md`에도 함께 반영한다.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ten-minute-planner", "name": "ten-minute-planner",
"version": "0.0.8", "version": "0.1.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ten-minute-planner", "name": "ten-minute-planner",
"version": "0.0.8", "version": "0.1.2",
"dependencies": { "dependencies": {
"vue": "^3.5.13" "vue": "^3.5.13"
}, },

View File

@@ -1,7 +1,7 @@
{ {
"name": "ten-minute-planner", "name": "ten-minute-planner",
"private": true, "private": true,
"version": "0.0.8", "version": "0.1.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -1,5 +1,5 @@
<script setup> <script setup>
import { computed, reactive, ref, watch } from 'vue' import { computed, reactive, ref, watch, nextTick } from 'vue'
import MiniCalendar from './components/MiniCalendar.vue' import MiniCalendar from './components/MiniCalendar.vue'
import PlannerPage from './components/PlannerPage.vue' import PlannerPage from './components/PlannerPage.vue'
import StatsDashboard from './components/StatsDashboard.vue' import StatsDashboard from './components/StatsDashboard.vue'
@@ -7,8 +7,11 @@ import StatsDashboard from './components/StatsDashboard.vue'
const STORAGE_KEY = 'ten-minute-planner-state' const STORAGE_KEY = 'ten-minute-planner-state'
const screenMode = ref('planner') const screenMode = ref('planner')
const viewMode = ref('focus') const viewMode = ref('focus')
const printLayout = ref('single')
const selectedDate = ref(new Date()) const selectedDate = ref(new Date())
const calendarViewDate = ref(new Date(selectedDate.value)) const calendarViewDate = ref(new Date(selectedDate.value))
const statsRangeStart = ref(toKey(new Date(new Date().setDate(new Date().getDate() - 6))))
const statsRangeEnd = ref(toKey(new Date()))
const hours = [ const hours = [
'6', '7', '8', '9', '10', '11', '12', '6', '7', '8', '9', '10', '11', '12',
@@ -136,6 +139,10 @@ function toDateValue(value, fallback = new Date()) {
return Number.isNaN(nextDate.getTime()) ? new Date(fallback) : nextDate return Number.isNaN(nextDate.getTime()) ? new Date(fallback) : nextDate
} }
function startOfDay(date) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate())
}
function buildFallbackRecord(date) { function buildFallbackRecord(date) {
return { return {
dday: 'D-00 FOCUS', dday: 'D-00 FOCUS',
@@ -221,10 +228,17 @@ function restoreDateState() {
if (savedState.calendarViewDate) { if (savedState.calendarViewDate) {
calendarViewDate.value = toDateValue(savedState.calendarViewDate, selectedDate.value) calendarViewDate.value = toDateValue(savedState.calendarViewDate, selectedDate.value)
return } else {
calendarViewDate.value = new Date(selectedDate.value)
} }
calendarViewDate.value = new Date(selectedDate.value) if (savedState.statsRangeStart) {
statsRangeStart.value = savedState.statsRangeStart
}
if (savedState.statsRangeEnd) {
statsRangeEnd.value = savedState.statsRangeEnd
}
} catch (error) { } catch (error) {
console.warn('저장된 날짜 상태를 불러오지 못했습니다.', error) console.warn('저장된 날짜 상태를 불러오지 못했습니다.', error)
} }
@@ -404,19 +418,37 @@ const plannerEntries = computed(() =>
.sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)), .sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)),
) )
const normalizedStatsRange = computed(() => {
const todayKey = toKey(new Date())
const startKey = statsRangeStart.value || todayKey
const endKey = statsRangeEnd.value || todayKey
if (startKey <= endKey) {
return { startKey, endKey }
}
return { startKey: endKey, endKey: startKey }
})
const rangeEntries = computed(() =>
plannerEntries.value.filter(([key]) =>
key >= normalizedStatsRange.value.startKey && key <= normalizedStatsRange.value.endKey,
),
)
const totalFocusedMinutes = computed(() => const totalFocusedMinutes = computed(() =>
plannerEntries.value.reduce((total, [, record]) => total + getFocusedMinutes(record), 0), rangeEntries.value.reduce((total, [, record]) => total + getFocusedMinutes(record), 0),
) )
const totalRecordedTasks = computed(() => const totalRecordedTasks = computed(() =>
plannerEntries.value.reduce( rangeEntries.value.reduce(
(total, [, record]) => total + record.tasks.filter((task) => task.title.trim()).length, (total, [, record]) => total + record.tasks.filter((task) => task.title.trim()).length,
0, 0,
), ),
) )
const completedRecordedTasks = computed(() => const completedRecordedTasks = computed(() =>
plannerEntries.value.reduce( rangeEntries.value.reduce(
(total, [, record]) => total + record.tasks.filter((task) => task.title.trim() && task.checked).length, (total, [, record]) => total + record.tasks.filter((task) => task.title.trim() && task.checked).length,
0, 0,
), ),
@@ -443,7 +475,7 @@ const overviewCards = computed(() => [
}, },
{ {
label: 'RECORDED DAYS', label: 'RECORDED DAYS',
value: `${plannerEntries.value.length}`, value: `${rangeEntries.value.length}`,
caption: '기록이 남아 있는 날짜 수', caption: '기록이 남아 있는 날짜 수',
}, },
{ {
@@ -466,21 +498,23 @@ function createDateLabel(dateKey) {
} }
const weeklyRecords = computed(() => { const weeklyRecords = computed(() => {
const entries = Array.from({ length: 7 }, (_, index) => { const entries = rangeEntries.value.map(([key, record]) => {
const date = new Date(selectedDate.value) const date = toDateValue(key)
date.setDate(selectedDate.value.getDate() - (6 - index))
const record = getPlannerRecord(date)
const focusedMinutes = getFocusedMinutes(record)
const weekdayShort = ['일', '월', '화', '수', '목', '금', '토'][date.getDay()] const weekdayShort = ['일', '월', '화', '수', '목', '금', '토'][date.getDay()]
const focusedMinutes = getFocusedMinutes(record)
return { return {
key: toKey(date), key,
weekday: weekdayShort, weekday: weekdayShort,
focusedMinutes, focusedMinutes,
focusedTime: formatMinutes(focusedMinutes), focusedTime: formatMinutes(focusedMinutes),
} }
}) })
if (entries.length === 0) {
return []
}
const maxMinutes = Math.max(...entries.map((entry) => entry.focusedMinutes), 60) const maxMinutes = Math.max(...entries.map((entry) => entry.focusedMinutes), 60)
return entries.map((entry) => ({ return entries.map((entry) => ({
@@ -490,7 +524,7 @@ const weeklyRecords = computed(() => {
}) })
const recentRecords = computed(() => const recentRecords = computed(() =>
[...plannerEntries.value] [...rangeEntries.value]
.sort(([leftKey], [rightKey]) => rightKey.localeCompare(leftKey)) .sort(([leftKey], [rightKey]) => rightKey.localeCompare(leftKey))
.slice(0, 5) .slice(0, 5)
.map(([key, record]) => ({ .map(([key, record]) => ({
@@ -503,11 +537,11 @@ const recentRecords = computed(() =>
) )
const bestDay = computed(() => { const bestDay = computed(() => {
if (plannerEntries.value.length === 0) { if (rangeEntries.value.length === 0) {
return null return null
} }
const [bestKey, bestRecord] = [...plannerEntries.value].reduce((bestEntry, currentEntry) => { const [bestKey, bestRecord] = [...rangeEntries.value].reduce((bestEntry, currentEntry) => {
const [, bestRecordValue] = bestEntry const [, bestRecordValue] = bestEntry
const [, currentRecordValue] = currentEntry const [, currentRecordValue] = currentEntry
@@ -523,7 +557,7 @@ const bestDay = computed(() => {
}) })
watch( watch(
[plannerRecords, selectedDate, calendarViewDate], [plannerRecords, selectedDate, calendarViewDate, statsRangeStart, statsRangeEnd],
() => { () => {
if (typeof window === 'undefined') { if (typeof window === 'undefined') {
return return
@@ -546,6 +580,8 @@ watch(
JSON.stringify({ JSON.stringify({
selectedDate: selectedDate.value.toISOString(), selectedDate: selectedDate.value.toISOString(),
calendarViewDate: calendarViewDate.value.toISOString(), calendarViewDate: calendarViewDate.value.toISOString(),
statsRangeStart: normalizedStatsRange.value.startKey,
statsRangeEnd: normalizedStatsRange.value.endKey,
records: serializableRecords, records: serializableRecords,
}), }),
) )
@@ -564,12 +600,18 @@ function clearTaskLabels(record) {
task.label = '' task.label = ''
}) })
} }
async function printSelectedPlanner(layout = 'single') {
printLayout.value = layout
await nextTick()
window.print()
}
</script> </script>
<template> <template>
<main class="min-h-screen px-4 py-6 text-ink sm:px-6 lg:px-10"> <main class="min-h-screen px-4 py-6 text-ink sm:px-6 lg:px-10">
<div class="mx-auto flex max-w-[1680px] flex-col gap-6"> <div class="print-root mx-auto flex max-w-[1680px] flex-col gap-6">
<header class="flex flex-col gap-4 rounded-[28px] border border-white/60 bg-white/70 p-5 backdrop-blur sm:p-6"> <header class="print-hidden flex flex-col gap-4 rounded-[28px] border border-white/60 bg-white/70 p-5 backdrop-blur sm:p-6">
<div class="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between"> <div class="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between">
<div class="space-y-2"> <div class="space-y-2">
<p class="text-[11px] font-bold uppercase tracking-[0.28em] text-stone-500">10 Minute Planner</p> <p class="text-[11px] font-bold uppercase tracking-[0.28em] text-stone-500">10 Minute Planner</p>
@@ -633,35 +675,56 @@ function clearTaskLabels(record) {
NEXT DAY NEXT DAY
</button> </button>
</div> </div>
<div
v-if="screenMode === 'planner'"
class="inline-flex items-center gap-2 rounded-full border border-stone-200 bg-white px-2 py-2"
>
<button
type="button"
class="rounded-full border border-stone-200 px-3 py-2 text-xs font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink"
@click="printSelectedPlanner('single')"
>
PRINT 1-UP
</button>
<button
type="button"
class="rounded-full border border-stone-200 px-3 py-2 text-xs font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink"
@click="printSelectedPlanner('double')"
>
PRINT 2-UP
</button>
</div>
</div> </div>
</div> </div>
</header> </header>
<section <section
v-if="screenMode === 'planner' && viewMode === 'focus'" v-if="screenMode === 'planner' && viewMode === 'focus'"
class="grid gap-6 xl:grid-cols-[minmax(0,1fr)_320px]" class="print-hidden grid gap-6 xl:grid-cols-[minmax(0,1fr)_320px]"
> >
<PlannerPage <div class="print-target">
:date-main="selectedDateDisplay.main" <PlannerPage
:date-weekday="selectedDateDisplay.weekday" :date-main="selectedDateDisplay.main"
:date-weekday-tone="selectedDateDisplay.weekdayTone" :date-weekday="selectedDateDisplay.weekday"
:dday="planner.dday" :date-weekday-tone="selectedDateDisplay.weekdayTone"
:comment="planner.comment" :dday="planner.dday"
:total-time="formatTotalTime(planner)" :comment="planner.comment"
:tasks="planner.tasks" :total-time="formatTotalTime(planner)"
:memo="planner.memo" :tasks="planner.tasks"
:hours="hours" :memo="planner.memo"
:timetable="planner.timetable" :hours="hours"
@update:comment="updateComment(planner, $event)" :timetable="planner.timetable"
@update:task-label="updateTaskLabel(planner, $event)" @update:comment="updateComment(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)" @update:task-label="updateTaskLabel(planner, $event)"
@toggle:task="toggleTask(planner, $event)" @update:task-title="updateTaskTitle(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)" @toggle:task="toggleTask(planner, $event)"
@update:memo="updateMemo(planner, $event)" @update:memo-label="updateMemoLabel(planner, $event)"
@update:timetable="updateTimetable(planner, $event)" @update:memo="updateMemo(planner, $event)"
/> @update:timetable="updateTimetable(planner, $event)"
/>
</div>
<aside class="flex flex-col gap-4"> <aside class="print-hidden flex flex-col gap-4">
<section class="border border-stone-200 bg-white/80 p-5"> <section class="border border-stone-200 bg-white/80 p-5">
<p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">PREV SNAPSHOT</p> <p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">PREV SNAPSHOT</p>
<div class="space-y-3"> <div class="space-y-3">
@@ -742,7 +805,8 @@ function clearTaskLabels(record) {
<p class="text-[11px] font-bold tracking-[0.22em] text-ink">NEXT DAY</p> <p class="text-[11px] font-bold tracking-[0.22em] text-ink">NEXT DAY</p>
<div class="mt-5 space-y-3"> <div class="mt-5 space-y-3">
<p class="text-lg font-semibold tracking-[-0.04em] text-stone-900"> <p class="text-lg font-semibold tracking-[-0.04em] text-stone-900">
{{ secondaryDateDisplay.main }} {{ secondaryDateDisplay.weekday }} <span>{{ secondaryDateDisplay.main }}</span>
<span class="ml-1" :class="secondaryDateDisplay.weekdayTone">{{ secondaryDateDisplay.weekday }}</span>
</p> </p>
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-600"> <p class="text-[11px] font-semibold tracking-[0.08em] text-stone-600">
내일의 작업은 "{{ secondaryPlanner.tasks[0]?.title || '새 작업 추가' }}" 시작합니다. 내일의 작업은 "{{ secondaryPlanner.tasks[0]?.title || '새 작업 추가' }}" 시작합니다.
@@ -755,58 +819,138 @@ function clearTaskLabels(record) {
<section <section
v-else-if="screenMode === 'planner'" v-else-if="screenMode === 'planner'"
class="overflow-x-auto rounded-[32px] border border-white/60 bg-white/40 p-4 sm:p-6" class="print-hidden overflow-x-auto rounded-[32px] border border-white/60 bg-white/40 p-4 sm:p-6"
> >
<div class="flex min-w-[1260px] gap-6"> <div class="flex min-w-[1260px] gap-6">
<PlannerPage <div class="print-target">
:date-main="selectedDateDisplay.main" <PlannerPage
:date-weekday="selectedDateDisplay.weekday" :date-main="selectedDateDisplay.main"
:date-weekday-tone="selectedDateDisplay.weekdayTone" :date-weekday="selectedDateDisplay.weekday"
:dday="planner.dday" :date-weekday-tone="selectedDateDisplay.weekdayTone"
:comment="planner.comment" :dday="planner.dday"
:total-time="formatTotalTime(planner)" :comment="planner.comment"
:tasks="planner.tasks" :total-time="formatTotalTime(planner)"
:memo="planner.memo" :tasks="planner.tasks"
:hours="hours" :memo="planner.memo"
:timetable="planner.timetable" :hours="hours"
@update:comment="updateComment(planner, $event)" :timetable="planner.timetable"
@update:task-label="updateTaskLabel(planner, $event)" @update:comment="updateComment(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)" @update:task-label="updateTaskLabel(planner, $event)"
@toggle:task="toggleTask(planner, $event)" @update:task-title="updateTaskTitle(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)" @toggle:task="toggleTask(planner, $event)"
@update:memo="updateMemo(planner, $event)" @update:memo-label="updateMemoLabel(planner, $event)"
@update:timetable="updateTimetable(planner, $event)" @update:memo="updateMemo(planner, $event)"
/> @update:timetable="updateTimetable(planner, $event)"
<PlannerPage />
:date-main="secondaryDateDisplay.main" </div>
:date-weekday="secondaryDateDisplay.weekday" <div class="print-hidden">
:date-weekday-tone="secondaryDateDisplay.weekdayTone" <PlannerPage
:dday="secondaryPlanner.dday" :date-main="secondaryDateDisplay.main"
:comment="secondaryPlanner.comment" :date-weekday="secondaryDateDisplay.weekday"
:total-time="formatTotalTime(secondaryPlanner)" :date-weekday-tone="secondaryDateDisplay.weekdayTone"
:tasks="secondaryPlanner.tasks" :dday="secondaryPlanner.dday"
:memo="secondaryPlanner.memo" :comment="secondaryPlanner.comment"
:hours="hours" :total-time="formatTotalTime(secondaryPlanner)"
:timetable="secondaryPlanner.timetable" :tasks="secondaryPlanner.tasks"
@update:comment="updateComment(secondaryPlanner, $event)" :memo="secondaryPlanner.memo"
@update:task-label="updateTaskLabel(secondaryPlanner, $event)" :hours="hours"
@update:task-title="updateTaskTitle(secondaryPlanner, $event)" :timetable="secondaryPlanner.timetable"
@toggle:task="toggleTask(secondaryPlanner, $event)" @update:comment="updateComment(secondaryPlanner, $event)"
@update:memo-label="updateMemoLabel(secondaryPlanner, $event)" @update:task-label="updateTaskLabel(secondaryPlanner, $event)"
@update:memo="updateMemo(secondaryPlanner, $event)" @update:task-title="updateTaskTitle(secondaryPlanner, $event)"
@update:timetable="updateTimetable(secondaryPlanner, $event)" @toggle:task="toggleTask(secondaryPlanner, $event)"
/> @update:memo-label="updateMemoLabel(secondaryPlanner, $event)"
@update:memo="updateMemo(secondaryPlanner, $event)"
@update:timetable="updateTimetable(secondaryPlanner, $event)"
/>
</div>
</div> </div>
</section> </section>
<StatsDashboard <StatsDashboard
v-else v-else
class="print-hidden"
:overview-cards="overviewCards" :overview-cards="overviewCards"
:weekly-records="weeklyRecords" :weekly-records="weeklyRecords"
:recent-records="recentRecords" :recent-records="recentRecords"
:best-day="bestDay" :best-day="bestDay"
:selected-date-label="`${selectedDateDisplay.main} ${selectedDateDisplay.weekday}`" :selected-date-label="`${selectedDateDisplay.main} ${selectedDateDisplay.weekday}`"
:range-start="normalizedStatsRange.startKey"
:range-end="normalizedStatsRange.endKey"
@update:range-start="statsRangeStart = $event"
@update:range-end="statsRangeEnd = $event"
/> />
<section class="print-only">
<div v-if="printLayout === 'single'" class="print-paper print-paper--single">
<div class="print-sheet-frame">
<PlannerPage
:date-main="selectedDateDisplay.main"
:date-weekday="selectedDateDisplay.weekday"
:date-weekday-tone="selectedDateDisplay.weekdayTone"
:dday="planner.dday"
:comment="planner.comment"
:total-time="formatTotalTime(planner)"
:tasks="planner.tasks"
:memo="planner.memo"
:hours="hours"
:timetable="planner.timetable"
@update:comment="updateComment(planner, $event)"
@update:task-label="updateTaskLabel(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)"
@toggle:task="toggleTask(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)"
@update:memo="updateMemo(planner, $event)"
@update:timetable="updateTimetable(planner, $event)"
/>
</div>
</div>
<div v-else class="print-paper print-paper--double">
<div class="print-sheet-frame">
<PlannerPage
:date-main="selectedDateDisplay.main"
:date-weekday="selectedDateDisplay.weekday"
:date-weekday-tone="selectedDateDisplay.weekdayTone"
:dday="planner.dday"
:comment="planner.comment"
:total-time="formatTotalTime(planner)"
:tasks="planner.tasks"
:memo="planner.memo"
:hours="hours"
:timetable="planner.timetable"
@update:comment="updateComment(planner, $event)"
@update:task-label="updateTaskLabel(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)"
@toggle:task="toggleTask(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)"
@update:memo="updateMemo(planner, $event)"
@update:timetable="updateTimetable(planner, $event)"
/>
</div>
<div class="print-sheet-frame">
<PlannerPage
:date-main="secondaryDateDisplay.main"
:date-weekday="secondaryDateDisplay.weekday"
:date-weekday-tone="secondaryDateDisplay.weekdayTone"
:dday="secondaryPlanner.dday"
:comment="secondaryPlanner.comment"
:total-time="formatTotalTime(secondaryPlanner)"
:tasks="secondaryPlanner.tasks"
:memo="secondaryPlanner.memo"
:hours="hours"
:timetable="secondaryPlanner.timetable"
@update:comment="updateComment(secondaryPlanner, $event)"
@update:task-label="updateTaskLabel(secondaryPlanner, $event)"
@update:task-title="updateTaskTitle(secondaryPlanner, $event)"
@toggle:task="toggleTask(secondaryPlanner, $event)"
@update:memo-label="updateMemoLabel(secondaryPlanner, $event)"
@update:memo="updateMemo(secondaryPlanner, $event)"
@update:timetable="updateTimetable(secondaryPlanner, $event)"
/>
</div>
</div>
</section>
</div> </div>
</main> </main>
</template> </template>

View File

@@ -115,7 +115,7 @@ onBeforeUnmount(() => {
<template> <template>
<article <article
class="flex w-full max-w-[762px] flex-col gap-3 bg-paper px-6 py-6 text-[10px] font-bold tracking-[0.16em] text-ink shadow-paper sm:px-12 sm:py-12" class="planner-sheet flex w-full max-w-[762px] flex-col gap-3 bg-paper px-6 py-6 text-[10px] font-bold tracking-[0.16em] text-ink shadow-paper sm:px-12 sm:py-12"
> >
<div class="flex flex-col gap-4 py-[18px]"> <div class="flex flex-col gap-4 py-[18px]">
<div class="flex gap-4"> <div class="flex gap-4">
@@ -230,7 +230,10 @@ onBeforeUnmount(() => {
class="flex h-[30px] border-b" class="flex h-[30px] border-b"
:class="index === hours.length - 1 ? 'border-ink' : 'border-line'" :class="index === hours.length - 1 ? 'border-ink' : 'border-line'"
> >
<div class="flex h-full w-[30px] items-center justify-center border-r border-ink text-[9px] text-ink"> <div
class="flex h-full w-[30px] touch-none select-none items-center justify-center border-r border-ink text-[9px] text-ink"
@pointerdown.prevent
>
{{ hour }} {{ hour }}
</div> </div>
<div <div

View File

@@ -12,6 +12,14 @@ defineProps({
type: Array, type: Array,
required: true, required: true,
}, },
rangeStart: {
type: String,
required: true,
},
rangeEnd: {
type: String,
required: true,
},
bestDay: { bestDay: {
type: Object, type: Object,
default: null, default: null,
@@ -21,10 +29,43 @@ defineProps({
required: true, required: true,
}, },
}) })
const emit = defineEmits(['update:range-start', 'update:range-end'])
</script> </script>
<template> <template>
<section class="grid gap-6"> <section class="grid gap-6">
<article class="rounded-[28px] border border-white/60 bg-white/80 p-5 shadow-paper backdrop-blur">
<div class="flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between">
<div>
<p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">RANGE</p>
<h2 class="mt-2 text-2xl font-semibold tracking-[-0.05em] text-stone-900">
원하는 기간 기준으로 통계 보기
</h2>
</div>
<div class="grid gap-3 sm:grid-cols-2">
<label class="flex flex-col gap-2 text-[11px] font-bold tracking-[0.14em] text-stone-500">
START DATE
<input
:value="rangeStart"
type="date"
class="rounded-2xl border border-stone-200 bg-white px-4 py-3 text-sm font-semibold text-stone-800 outline-none transition focus:border-stone-400"
@input="emit('update:range-start', $event.target.value)"
/>
</label>
<label class="flex flex-col gap-2 text-[11px] font-bold tracking-[0.14em] text-stone-500">
END DATE
<input
:value="rangeEnd"
type="date"
class="rounded-2xl border border-stone-200 bg-white px-4 py-3 text-sm font-semibold text-stone-800 outline-none transition focus:border-stone-400"
@input="emit('update:range-end', $event.target.value)"
/>
</label>
</div>
</div>
</article>
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4"> <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
<article <article
v-for="card in overviewCards" v-for="card in overviewCards"
@@ -43,7 +84,7 @@ defineProps({
<div> <div>
<p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">WEEKLY FLOW</p> <p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">WEEKLY FLOW</p>
<h2 class="mt-2 text-2xl font-semibold tracking-[-0.05em] text-stone-900"> <h2 class="mt-2 text-2xl font-semibold tracking-[-0.05em] text-stone-900">
최근 7 기록 흐름 선택 기간 기록 흐름
</h2> </h2>
</div> </div>
<p class="text-[11px] font-semibold tracking-[0.06em] text-stone-500"> <p class="text-[11px] font-semibold tracking-[0.06em] text-stone-500">
@@ -51,11 +92,11 @@ defineProps({
</p> </p>
</div> </div>
<div class="mt-8 grid grid-cols-7 gap-3"> <div class="mt-8 flex gap-3 overflow-x-auto pb-2">
<div <div
v-for="record in weeklyRecords" v-for="record in weeklyRecords"
:key="record.key" :key="record.key"
class="flex flex-col items-center gap-3" class="flex min-w-[56px] flex-col items-center gap-3"
> >
<div class="flex h-40 items-end"> <div class="flex h-40 items-end">
<div <div

View File

@@ -20,3 +20,104 @@
@apply outline-none; @apply outline-none;
} }
} }
@media print {
@page {
size: A4 landscape;
margin: 0;
}
html,
body {
background: #ffffff !important;
}
body {
min-height: auto;
margin: 0;
}
.print-hidden {
display: none !important;
}
.print-only {
display: block !important;
}
.print-root {
display: block !important;
max-width: none !important;
padding: 0 !important;
gap: 0 !important;
}
.print-paper {
width: 297mm;
height: 210mm;
display: flex !important;
align-items: center;
justify-content: center;
background: #ffffff !important;
padding: 0;
}
.print-paper--double {
display: grid !important;
grid-template-columns: repeat(2, 148mm);
justify-content: center;
align-content: center;
gap: 0;
}
.print-paper--single .print-sheet-frame {
width: 148mm;
height: 210mm;
}
.print-sheet-frame {
overflow: hidden;
display: flex;
align-items: flex-start;
justify-content: flex-start;
background: #ffffff !important;
}
.print-paper--double .print-sheet-frame {
width: 148.5mm;
height: 210mm;
}
.planner-sheet {
box-shadow: none !important;
}
.print-paper--single .print-sheet-frame .planner-sheet {
width: 762px !important;
max-width: none !important;
transform-origin: top left;
transform: scale(0.732);
box-shadow: none !important;
background: #ffffff !important;
}
.print-paper--double .print-sheet-frame .planner-sheet {
width: 762px !important;
max-width: none !important;
transform-origin: top left;
transform: scale(0.731);
box-shadow: none !important;
background: #ffffff !important;
}
.print-sheet-frame .planner-sheet * {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
@media screen {
.print-only {
display: none !important;
}
}