Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e87155f909 | |||
| f3b2c84758 | |||
| 314dd7f649 | |||
| 0206cfebf8 | |||
| 85d21f5842 | |||
| d6dda9639b | |||
| 5c380e0562 | |||
| 0bc06b710a | |||
| 7704752064 | |||
| 279470dbd0 |
40
HANDOFF.md
40
HANDOFF.md
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- 프로젝트명: 10 Minute Planner 웹 UI
|
- 프로젝트명: 10 Minute Planner 웹 UI
|
||||||
- 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript
|
- 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript
|
||||||
- 현재 기준 버전: `v0.0.2`
|
- 현재 기준 버전: `v0.1.2`
|
||||||
|
|
||||||
## 기준 디자인
|
## 기준 디자인
|
||||||
|
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
- 기본 UX 방향은 `1페이지 + 추가 정보 패널`이다.
|
- 기본 UX 방향은 `1페이지 + 추가 정보 패널`이다.
|
||||||
- `2페이지 펼침 보기`는 비교용 보조 모드로 함께 유지한다.
|
- `2페이지 펼침 보기`는 비교용 보조 모드로 함께 유지한다.
|
||||||
- 화면 인상은 종이 다이어리 같아야 하지만, 상호작용은 웹앱처럼 빠르고 자연스러워야 한다.
|
- 화면 인상은 종이 다이어리 같아야 하지만, 상호작용은 웹앱처럼 빠르고 자연스러워야 한다.
|
||||||
|
- 현재는 개인용 단일 브라우저 흐름으로 개발 중이지만, 이후 회원 기반 개인 문서 관리 서비스로 확장해야 한다.
|
||||||
|
|
||||||
## 현재 구현 상태
|
## 현재 구현 상태
|
||||||
|
|
||||||
@@ -25,7 +26,29 @@
|
|||||||
- Tailwind 설정은 완료되어 있으며, 이 프로젝트의 스타일링 기준으로 유지한다.
|
- Tailwind 설정은 완료되어 있으며, 이 프로젝트의 스타일링 기준으로 유지한다.
|
||||||
- 현재 선택 날짜는 시스템 날짜 기준으로 시작한다.
|
- 현재 선택 날짜는 시스템 날짜 기준으로 시작한다.
|
||||||
- `COMMENT`, `TASKS`, `MEMO`는 화면에서 바로 편집할 수 있다.
|
- `COMMENT`, `TASKS`, `MEMO`는 화면에서 바로 편집할 수 있다.
|
||||||
- TASKS 체크박스는 토글 가능하지만, `TOTAL TIME`과 타임테이블 계산은 아직 미구현이다.
|
- TASKS 왼쪽 라벨은 순번 고정이 아니라 자유 입력 가능하며, 기본값은 빈 상태다.
|
||||||
|
- MEMO 왼쪽 라벨 칸도 자유 입력 가능하다.
|
||||||
|
- TASKS 체크박스는 토글 가능하며, 체크 상태는 바로 시각적으로 반영된다.
|
||||||
|
- STATS 완료율은 전체 15칸이 아니라, 실제로 입력된 TASKS만 기준으로 계산한다.
|
||||||
|
- `TIME TABLE`은 드래그로 10분 블록을 연속 선택할 수 있다.
|
||||||
|
- `TIME TABLE`은 우클릭 드래그 시 선택된 블록을 지우는 방식으로도 편집할 수 있다.
|
||||||
|
- `TIME TABLE` 숫자 영역은 선택/드래그로 텍스트가 잡히지 않도록 막아두었다.
|
||||||
|
- `TOTAL TIME`은 타임테이블에서 선택된 블록 수를 기준으로 자동 계산된다.
|
||||||
|
- 달력은 연/월 이동이 가능하며, 현재 보이는 월과 선택된 날짜 상태를 분리해서 관리한다.
|
||||||
|
- 달력 상단은 월 좌우 화살표, 클릭형 연도 선택, `TODAY` 버튼 구조로 동작한다.
|
||||||
|
- 입력 내용이 있는 날짜는 달력 하단에 빨간 점으로 표시된다.
|
||||||
|
- 상단 날짜 표시에서는 토요일의 `(토)`만 파란색, 일요일의 `(일)`만 빨간색으로 표시한다.
|
||||||
|
- 플래너 상태는 `localStorage`에 저장되며, 날짜별 기록과 선택 날짜, 달력 보고 있던 월까지 복원된다.
|
||||||
|
- 상단 전환 버튼으로 `PLANNER / STATS` 화면을 오갈 수 있다.
|
||||||
|
- 통계 화면에서는 전체 집중 시간, 평균 완료율, 기록 일수, 최근 7일 흐름, 최근 기록, 베스트 데이를 보여준다.
|
||||||
|
- 통계 화면은 시작일/종료일을 직접 선택해 그 기간 기준으로 지표를 다시 계산할 수 있다.
|
||||||
|
- `NEXT DAY` 영역의 요일도 본문 날짜와 같은 규칙으로 주말 색상이 적용된다.
|
||||||
|
- 플래너 화면에서는 `PRINT DAY` 버튼으로 현재 선택 날짜 문서를 바로 출력할 수 있다.
|
||||||
|
- 인쇄 시에는 현재 선택된 하루 플래너 본문만 남기고, 헤더/사이드패널/통계 화면은 숨긴다.
|
||||||
|
- 출력 버튼은 `PRINT 1-UP` / `PRINT 2-UP`으로 분리되어 있다.
|
||||||
|
- `PRINT 2-UP`은 현재 날짜와 다음 날짜를 A4 가로 기준으로 나란히 출력하는 용도다.
|
||||||
|
- 인쇄는 일반 화면을 그대로 찍는 방식이 아니라, 별도의 `print-only` 전용 레이아웃을 사용한다.
|
||||||
|
- A5 원본 비율을 유지한 채 A4 가로 안에 들어가도록 `1-UP` / `2-UP` 각각 별도 배율로 압축한다.
|
||||||
|
|
||||||
## 확정된 결정사항
|
## 확정된 결정사항
|
||||||
|
|
||||||
@@ -33,19 +56,30 @@
|
|||||||
날짜 전환, 모드 토글, 사이드 패널 요약, 이후 저장 기능 등 상태 기반 상호작용이 많기 때문이다.
|
날짜 전환, 모드 토글, 사이드 패널 요약, 이후 저장 기능 등 상태 기반 상호작용이 많기 때문이다.
|
||||||
- TailwindCSS는 Vue를 사용하더라도 반드시 유지해야 하는 스타일링 방식이다.
|
- TailwindCSS는 Vue를 사용하더라도 반드시 유지해야 하는 스타일링 방식이다.
|
||||||
- 현재 데이터는 레이아웃과 상호작용 검증을 위한 목업 데이터다.
|
- 현재 데이터는 레이아웃과 상호작용 검증을 위한 목업 데이터다.
|
||||||
|
- 현재 저장은 `localStorage`를 사용하지만, 적절한 시점에 DB를 붙여 사용자별 저장 구조로 전환해야 한다.
|
||||||
- 상단 날짜는 시스템 날짜 또는 현재 선택된 플래너 날짜 기준으로 자동 표시되어야 한다.
|
- 상단 날짜는 시스템 날짜 또는 현재 선택된 플래너 날짜 기준으로 자동 표시되어야 한다.
|
||||||
- `D-DAY`는 지금은 보류이며, 이후 별도의 목표 관리 패널과 연결해서 계산한다.
|
- `D-DAY`는 지금은 보류이며, 이후 별도의 목표 관리 패널과 연결해서 계산한다.
|
||||||
- `COMMENT`, `TASKS`, `MEMO`는 모두 입력 가능한 필드가 되어야 한다.
|
- `COMMENT`, `TASKS`, `MEMO`는 모두 입력 가능한 필드가 되어야 한다.
|
||||||
|
- TASKS 라벨은 번호만 고정하지 말고 자유 입력이 가능해야 한다.
|
||||||
|
- 번호 사용이 필요한 경우를 위해 우측 패널에서 TASKS 라벨을 순번으로 한 번에 채울 수 있어야 한다.
|
||||||
- `TOTAL TIME`은 타임테이블 선택 상태를 기반으로 자동 계산되어야 한다.
|
- `TOTAL TIME`은 타임테이블 선택 상태를 기반으로 자동 계산되어야 한다.
|
||||||
- 타임테이블은 마우스 드래그로 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 해석해야 한다.
|
- 타임테이블은 마우스 드래그로 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 해석해야 한다.
|
||||||
|
- 타임테이블 편집은 좌클릭 드래그로 칠하기, 우클릭 드래그로 지우기 방식이 더 자연스럽다.
|
||||||
- 달력에는 연/월 이동 기능이 필요하다.
|
- 달력에는 연/월 이동 기능이 필요하다.
|
||||||
- 내용이 저장된 날짜에는 달력에 빨간 점 표시가 필요하다.
|
- 내용이 저장된 날짜에는 달력에 빨간 점 표시가 필요하다.
|
||||||
|
- 현재 단계의 저장 방식은 `localStorage`이며, 이후 외부 저장소 도입 전까지 기본 저장 경로로 사용한다.
|
||||||
|
- 장기적으로는 회원 가입 후 사용자별로 각자 문서를 작성/관리할 수 있어야 한다.
|
||||||
|
- 공유 문서 서비스가 아니라, 사용자 개인 보관과 회고 중심의 서비스 구조를 목표로 한다.
|
||||||
|
- 사용자는 스스로 통계를 확인할 수 있어야 하고, 특정 날짜에 작성한 문서는 출력 가능해야 한다.
|
||||||
|
- 공유를 위해 나중에 이미지 저장 기능도 필요하지만, 실제 출력 품질과 텍스트 선명도는 HTML/CSS 인쇄 레이아웃을 우선 유지하는 편이 좋다.
|
||||||
|
|
||||||
## 다음 권장 작업
|
## 다음 권장 작업
|
||||||
|
|
||||||
- `TODO.md` 기준으로 작은 단위씩 구현을 진행한다.
|
- `TODO.md` 기준으로 작은 단위씩 구현을 진행한다.
|
||||||
- 목표나 통계 기능보다 먼저, 플래너 본문의 입력과 상호작용을 우선 구현한다.
|
- 목표나 통계 기능보다 먼저, 플래너 본문의 입력과 상호작용을 우선 구현한다.
|
||||||
- 달력 표시와 통계 기능을 본격화하기 전에 저장 구조를 먼저 정리하는 것이 좋다.
|
- 통계 화면 구현은 현재 `localStorage` 기반으로 먼저 진행해도 된다.
|
||||||
|
- DB는 기능 탐색 속도를 해치지 않는 선에서, 저장 레이어를 분리할 수 있는 적절한 시점에 붙이는 것이 좋다.
|
||||||
|
- 이미지 저장 기능은 추후 `print-only` 또는 별도 export 전용 레이아웃을 기준으로 구현하면 화면/인쇄/공유 결과를 맞추기 쉽다.
|
||||||
|
|
||||||
## 갱신 규칙
|
## 갱신 규칙
|
||||||
|
|
||||||
|
|||||||
57
TODO.md
57
TODO.md
@@ -15,16 +15,24 @@
|
|||||||
- [x] `COMMENT`를 자유 입력 가능한 입력 필드로 바꾼다.
|
- [x] `COMMENT`를 자유 입력 가능한 입력 필드로 바꾼다.
|
||||||
- [x] `TASKS` 각 줄을 텍스트 입력 + 체크박스 토글 가능하게 만든다.
|
- [x] `TASKS` 각 줄을 텍스트 입력 + 체크박스 토글 가능하게 만든다.
|
||||||
- [x] `MEMO` 각 줄을 텍스트 입력 가능하게 만든다.
|
- [x] `MEMO` 각 줄을 텍스트 입력 가능하게 만든다.
|
||||||
- [ ] `TIME TABLE`을 마우스 드래그로 칠할 수 있게 만든다.
|
- [x] `TIME TABLE`을 마우스 드래그로 칠할 수 있게 만든다.
|
||||||
- [ ] `TIME TABLE` 드래그가 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 처리한다.
|
- [x] `TIME TABLE` 드래그가 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 처리한다.
|
||||||
- [ ] 선택된 `TIME TABLE` 구간을 기준으로 `TOTAL TIME`을 자동 계산한다.
|
- [x] 선택된 `TIME TABLE` 구간을 기준으로 `TOTAL TIME`을 자동 계산한다.
|
||||||
|
|
||||||
## 2단계: 달력과 이동 기능
|
## 2단계: 달력과 이동 기능
|
||||||
|
|
||||||
- [ ] 달력에 연/월 이동 기능을 추가한다.
|
- [x] 달력에 연/월 이동 기능을 추가한다.
|
||||||
- [ ] 선택 날짜를 클릭하면 해당 날짜 플래너 데이터로 이동되게 한다.
|
- [x] 선택 날짜를 클릭하면 해당 날짜 플래너 데이터로 이동되게 한다.
|
||||||
- [ ] 입력값이 하나라도 있는 날짜에는 달력 하단에 빨간 점 표시를 추가한다.
|
- [x] 입력값이 하나라도 있는 날짜에는 달력 하단에 빨간 점 표시를 추가한다.
|
||||||
- [ ] `PREV DAY` / `NEXT DAY` 이동 시 현재 편집 중 데이터와 연결되도록 정리한다.
|
- [x] `PREV DAY` / `NEXT DAY` 이동 시 현재 편집 중 데이터와 연결되도록 정리한다.
|
||||||
|
|
||||||
|
## 추가 반영 메모
|
||||||
|
|
||||||
|
- [x] TASKS 왼쪽 라벨은 자유 입력 가능해야 한다.
|
||||||
|
- [x] 우측 패널에서 TASKS 번호를 한 번에 채우는 빠른 액션이 있어야 한다.
|
||||||
|
- [x] 달력 상단은 좌우 화살표로 월 이동하는 구조가 더 적합하다.
|
||||||
|
- [x] 연도 클릭 시 연도 선택 UI가 열려야 한다.
|
||||||
|
- [x] 오늘 날짜로 즉시 돌아가는 버튼이 필요하다.
|
||||||
|
|
||||||
## 3단계: 목표와 회고 기능
|
## 3단계: 목표와 회고 기능
|
||||||
|
|
||||||
@@ -36,18 +44,41 @@
|
|||||||
## 4단계: 데이터 구조와 저장
|
## 4단계: 데이터 구조와 저장
|
||||||
|
|
||||||
- [ ] 플래너 데이터 구조를 날짜별 상태 중심으로 정리한다.
|
- [ ] 플래너 데이터 구조를 날짜별 상태 중심으로 정리한다.
|
||||||
- [ ] 입력 데이터의 저장 위치를 결정한다.
|
- [x] 입력 데이터의 저장 위치를 결정한다.
|
||||||
- [ ] 로컬 저장 또는 외부 저장 방식 중 우선 구현 방식을 정한다.
|
- [x] 로컬 저장 또는 외부 저장 방식 중 우선 구현 방식을 정한다.
|
||||||
- [ ] 입력 상태가 새로고침 후에도 유지되도록 만든다.
|
- [x] 입력 상태가 새로고침 후에도 유지되도록 만든다.
|
||||||
|
- [ ] DB 전환 시점을 잡을 수 있도록 저장 레이어를 분리한다.
|
||||||
|
- [ ] 회원 가입 및 로그인 구조를 고려한 사용자별 데이터 모델을 설계한다.
|
||||||
|
- [ ] 사용자별 문서 저장/조회 흐름을 정리한다.
|
||||||
|
- [ ] 출력용 문서 포맷과 프린트 흐름을 고려한 데이터 구조를 정리한다.
|
||||||
|
|
||||||
|
## 추가 반영 메모
|
||||||
|
|
||||||
|
- [x] 상단 날짜 표시에서 토요일 요일 텍스트만 파란색으로 표시한다.
|
||||||
|
- [x] 상단 날짜 표시에서 일요일 요일 텍스트만 빨간색으로 표시한다.
|
||||||
|
|
||||||
## 5단계: 확장 화면
|
## 5단계: 확장 화면
|
||||||
|
|
||||||
- [ ] 통계 페이지 요구사항을 정리한다.
|
- [x] 통계 페이지 요구사항을 정리한다.
|
||||||
- [ ] 통계 페이지 라우팅 또는 화면 전환 구조를 설계한다.
|
- [x] 통계 페이지 라우팅 또는 화면 전환 구조를 설계한다.
|
||||||
- [ ] 집중 시간, 완료율, 연속 기록 같은 핵심 지표를 정의한다.
|
- [x] 집중 시간, 완료율, 연속 기록 같은 핵심 지표를 정의한다.
|
||||||
|
- [x] 사용자가 시작일과 종료일을 선택해서 기간별 통계를 볼 수 있게 한다.
|
||||||
|
- [ ] 사용자 개인 통계 화면 기준을 정리한다.
|
||||||
|
|
||||||
|
## 6단계: 계정 및 서비스 확장
|
||||||
|
|
||||||
|
- [ ] 회원 가입 / 로그인 방식 후보를 정리한다.
|
||||||
|
- [ ] 사용자별 문서 분리 저장 구조를 설계한다.
|
||||||
|
- [ ] 공유가 아닌 개인 보관용 서비스 흐름으로 요구사항을 정리한다.
|
||||||
|
- [x] 향후 출력 기능을 위한 인쇄 레이아웃 요구사항을 정리한다.
|
||||||
|
- [x] A4 가로 기준 2장 출력 모드를 지원한다.
|
||||||
|
- [ ] 공유를 위한 이미지 저장 기능을 추가한다.
|
||||||
|
|
||||||
## 메모
|
## 메모
|
||||||
|
|
||||||
- D-DAY는 현재 보류 상태다. 목표 패널 설계 후 연결한다.
|
- D-DAY는 현재 보류 상태다. 목표 패널 설계 후 연결한다.
|
||||||
- `TIME TABLE` 드래그는 단순 사각형 선택이 아니라 시간 셀 단위의 연속 선택으로 해석한다.
|
- `TIME TABLE` 드래그는 단순 사각형 선택이 아니라 시간 셀 단위의 연속 선택으로 해석한다.
|
||||||
|
- 현재는 `localStorage`로 개발을 진행하지만, 적절한 시점에 DB를 붙여 사용자별 저장 구조로 확장해야 한다.
|
||||||
|
- 최종적으로는 회원 가입 후 각자 자신의 문서를 작성/관리하고, 개인 통계를 확인하며, 특정 날짜 문서를 출력할 수 있어야 한다.
|
||||||
|
- 실제 인쇄는 HTML/CSS 기반 프린트 레이아웃으로 유지하고, 공유용으로는 별도의 이미지 저장 기능을 추가하는 방향이 적합하다.
|
||||||
- 구현할 때마다 완료된 항목은 체크하고, 큰 결정사항은 `HANDOFF.md`에도 함께 반영한다.
|
- 구현할 때마다 완료된 항목은 체크하고, 큰 결정사항은 `HANDOFF.md`에도 함께 반영한다.
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ten-minute-planner",
|
"name": "ten-minute-planner",
|
||||||
"version": "0.0.2",
|
"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.2",
|
"version": "0.1.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^3.5.13"
|
"vue": "^3.5.13"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ten-minute-planner",
|
"name": "ten-minute-planner",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.2",
|
"version": "0.1.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
804
src/App.vue
804
src/App.vue
@@ -1,10 +1,17 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, ref } 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'
|
||||||
|
|
||||||
|
const STORAGE_KEY = 'ten-minute-planner-state'
|
||||||
|
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 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',
|
||||||
@@ -13,32 +20,53 @@ const hours = [
|
|||||||
'1', '2', '3', '4', '5',
|
'1', '2', '3', '4', '5',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const timetableCellCount = hours.length * 6
|
||||||
|
|
||||||
|
function createEmptyTimetable() {
|
||||||
|
return Array.from({ length: timetableCellCount }, () => false)
|
||||||
|
}
|
||||||
|
|
||||||
|
function createTaskLabel(index) {
|
||||||
|
return `${index + 1}`.padStart(2, '0')
|
||||||
|
}
|
||||||
|
|
||||||
|
function createTimetableFromRanges(ranges) {
|
||||||
|
const timetable = createEmptyTimetable()
|
||||||
|
|
||||||
|
ranges.forEach(([start, end]) => {
|
||||||
|
for (let index = start; index <= end; index += 1) {
|
||||||
|
timetable[index] = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return timetable
|
||||||
|
}
|
||||||
|
|
||||||
const plannerSeed = {
|
const plannerSeed = {
|
||||||
'2026-04-21': {
|
'2026-04-21': {
|
||||||
dday: 'D-12 LAUNCH',
|
dday: 'D-12 LAUNCH',
|
||||||
comment: '집중 작업 3개만 남기고, 10분 단위로 흐름을 끊지 않기.',
|
comment: '집중 작업 3개만 남기고, 10분 단위로 흐름을 끊지 않기.',
|
||||||
totalTime: '09H 40M',
|
|
||||||
tasks: [
|
tasks: [
|
||||||
{ id: '01', title: '홈 화면 정보 구조 정리', checked: true },
|
{ label: '', title: '홈 화면 정보 구조 정리', checked: true },
|
||||||
{ id: '02', title: '플래너 페이지 헤더 상태 연결', checked: true },
|
{ label: '', title: '플래너 페이지 헤더 상태 연결', checked: true },
|
||||||
{ id: '03', title: '타임테이블 액티브 블록 설계' },
|
{ label: '', title: '타임테이블 액티브 블록 설계' },
|
||||||
{ id: '04', title: '우측 캘린더 빠른 이동 구현' },
|
{ label: '', title: '우측 캘린더 빠른 이동 구현' },
|
||||||
{ id: '05', title: '전날 요약 영역 문구 다듬기' },
|
{ label: '', title: '전날 요약 영역 문구 다듬기' },
|
||||||
{ id: '06', title: '다음날 할 일 자동 제안 시나리오' },
|
{ label: '', title: '다음날 할 일 자동 제안 시나리오' },
|
||||||
{ id: '07', title: '통계 카드 레이아웃 정리' },
|
{ label: '', title: '통계 카드 레이아웃 정리' },
|
||||||
{ id: '08', title: '모바일 스택 레이아웃 점검' },
|
{ label: '', title: '모바일 스택 레이아웃 점검' },
|
||||||
{ id: '09', title: '체크박스 인터랙션 연결' },
|
{ label: '', title: '체크박스 인터랙션 연결' },
|
||||||
{ id: '10', title: '페이지 넘김 애니메이션 방향 검토' },
|
{ label: '', title: '페이지 넘김 애니메이션 방향 검토' },
|
||||||
{ id: '11', title: 'Tailwind 토큰 정리' },
|
{ label: '', title: 'Tailwind 토큰 정리' },
|
||||||
{ id: '12', title: 'Vue 컴포넌트 분리 기준 정하기' },
|
{ label: '', title: 'Vue 컴포넌트 분리 기준 정하기' },
|
||||||
{ id: '13', title: '빈 상태 문구 작성' },
|
{ label: '', title: '빈 상태 문구 작성' },
|
||||||
{ id: '14', title: '주간 리듬 회고 메모 추가' },
|
{ label: '', title: '주간 리듬 회고 메모 추가' },
|
||||||
{ id: '15', title: '디자인 QA 체크리스트 정리' },
|
{ label: '', title: '디자인 QA 체크리스트 정리' },
|
||||||
],
|
],
|
||||||
memo: [
|
memo: [
|
||||||
'오른쪽 패널은 정보 확인과 이동이 한 번에 되도록 유지.',
|
{ label: '', text: '오른쪽 패널은 정보 확인과 이동이 한 번에 되도록 유지.' },
|
||||||
'2페이지 보기는 비교용으로 남기고 기본값은 집중 보기로 사용.',
|
{ label: '', text: '2페이지 보기는 비교용으로 남기고 기본값은 집중 보기로 사용.' },
|
||||||
'작업 흐름이 끊기지 않도록 클릭 포인트를 줄이기.',
|
{ label: '', text: '작업 흐름이 끊기지 않도록 클릭 포인트를 줄이기.' },
|
||||||
],
|
],
|
||||||
prevSummary: [
|
prevSummary: [
|
||||||
'어제 완료한 핵심 3개 보기',
|
'어제 완료한 핵심 3개 보기',
|
||||||
@@ -50,32 +78,36 @@ const plannerSeed = {
|
|||||||
'다음날 핵심 3개 자동 복사',
|
'다음날 핵심 3개 자동 복사',
|
||||||
'미완료 작업만 재정렬',
|
'미완료 작업만 재정렬',
|
||||||
],
|
],
|
||||||
|
timetable: createTimetableFromRanges([
|
||||||
|
[6, 13],
|
||||||
|
[24, 32],
|
||||||
|
[42, 47],
|
||||||
|
]),
|
||||||
},
|
},
|
||||||
'2026-04-22': {
|
'2026-04-22': {
|
||||||
dday: 'D-11 LAUNCH',
|
dday: 'D-11 LAUNCH',
|
||||||
comment: '초반 90분은 구현, 후반은 문장과 사용성 정리에 사용.',
|
comment: '초반 90분은 구현, 후반은 문장과 사용성 정리에 사용.',
|
||||||
totalTime: '08H 20M',
|
|
||||||
tasks: [
|
tasks: [
|
||||||
{ id: '01', title: '통계 섹션 수치 실제 계산 연결', checked: true },
|
{ label: '', title: '통계 섹션 수치 실제 계산 연결', checked: true },
|
||||||
{ id: '02', title: '날짜 선택 시 상태 동기화' },
|
{ label: '', title: '날짜 선택 시 상태 동기화' },
|
||||||
{ id: '03', title: '다음날 할 일 템플릿 개선' },
|
{ label: '', title: '다음날 할 일 템플릿 개선' },
|
||||||
{ id: '04', title: '2페이지 보기 비교 카피 작성' },
|
{ label: '', title: '2페이지 보기 비교 카피 작성' },
|
||||||
{ id: '05', title: '주간 흐름 카드 추가' },
|
{ label: '', title: '주간 흐름 카드 추가' },
|
||||||
{ id: '06', title: '메모 영역 편집 UX 개선' },
|
{ label: '', title: '메모 영역 편집 UX 개선' },
|
||||||
{ id: '07', title: '프린트 스타일 초안 점검' },
|
{ label: '', title: '프린트 스타일 초안 점검' },
|
||||||
{ id: '08', title: '색 대비 보정' },
|
{ label: '', title: '색 대비 보정' },
|
||||||
{ id: '09', title: '우측 패널 축약 버전 검토' },
|
{ label: '', title: '우측 패널 축약 버전 검토' },
|
||||||
{ id: '10', title: '마감용 체크리스트 분리' },
|
{ label: '', title: '마감용 체크리스트 분리' },
|
||||||
{ id: '11', title: '키보드 탐색 흐름 다듬기' },
|
{ label: '', title: '키보드 탐색 흐름 다듬기' },
|
||||||
{ id: '12', title: '데이터 구조 문서화' },
|
{ label: '', title: '데이터 구조 문서화' },
|
||||||
{ id: '13', title: '테스트 날짜 더미 세트 늘리기' },
|
{ label: '', title: '테스트 날짜 더미 세트 늘리기' },
|
||||||
{ id: '14', title: '브랜드 푸터 위치 확정' },
|
{ label: '', title: '브랜드 푸터 위치 확정' },
|
||||||
{ id: '15', title: '빈 상태 일러스트 여부 결정' },
|
{ label: '', title: '빈 상태 일러스트 여부 결정' },
|
||||||
],
|
],
|
||||||
memo: [
|
memo: [
|
||||||
'한 화면에 모든 정보를 모으되 시선 이동은 짧게.',
|
{ label: '', text: '한 화면에 모든 정보를 모으되 시선 이동은 짧게.' },
|
||||||
'캘린더는 검색보다 빠른 이동 장치로 동작해야 함.',
|
{ label: '', text: '캘린더는 검색보다 빠른 이동 장치로 동작해야 함.' },
|
||||||
'실행 화면은 다이어리 같고, 인터랙션은 앱처럼.',
|
{ label: '', text: '실행 화면은 다이어리 같고, 인터랙션은 앱처럼.' },
|
||||||
],
|
],
|
||||||
prevSummary: [
|
prevSummary: [
|
||||||
'이전날 메모 3줄 이어보기',
|
'이전날 메모 3줄 이어보기',
|
||||||
@@ -87,18 +119,14 @@ const plannerSeed = {
|
|||||||
'오늘 미완료 작업 넘기기',
|
'오늘 미완료 작업 넘기기',
|
||||||
'이번 주 누적 시간 요약',
|
'이번 주 누적 시간 요약',
|
||||||
],
|
],
|
||||||
|
timetable: createTimetableFromRanges([
|
||||||
|
[3, 8],
|
||||||
|
[18, 23],
|
||||||
|
[54, 62],
|
||||||
|
]),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const plannerRecords = reactive(structuredClone(plannerSeed))
|
|
||||||
|
|
||||||
const dateFormatter = new Intl.DateTimeFormat('ko-KR', {
|
|
||||||
year: 'numeric',
|
|
||||||
month: '2-digit',
|
|
||||||
day: '2-digit',
|
|
||||||
weekday: 'short',
|
|
||||||
})
|
|
||||||
|
|
||||||
function toKey(date) {
|
function toKey(date) {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = `${date.getMonth() + 1}`.padStart(2, '0')
|
const month = `${date.getMonth() + 1}`.padStart(2, '0')
|
||||||
@@ -106,22 +134,118 @@ function toKey(date) {
|
|||||||
return `${year}-${month}-${day}`
|
return `${year}-${month}-${day}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toDateValue(value, fallback = new Date()) {
|
||||||
|
const nextDate = new Date(value)
|
||||||
|
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',
|
||||||
comment: '',
|
comment: '',
|
||||||
totalTime: '00H 00M',
|
|
||||||
tasks: Array.from({ length: 15 }, (_, index) => ({
|
tasks: Array.from({ length: 15 }, (_, index) => ({
|
||||||
id: `${index + 1}`.padStart(2, '0'),
|
label: '',
|
||||||
title: '',
|
title: '',
|
||||||
checked: false,
|
checked: false,
|
||||||
})),
|
})),
|
||||||
memo: ['', '', ''],
|
memo: Array.from({ length: 3 }, () => ({
|
||||||
|
label: '',
|
||||||
|
text: '',
|
||||||
|
})),
|
||||||
prevSummary: ['이전 기록 없음', '새로운 흐름 시작', ''],
|
prevSummary: ['이전 기록 없음', '새로운 흐름 시작', ''],
|
||||||
nextFocus: ['다음 집중 블록 준비', '내일의 핵심 3개 정하기', ''],
|
nextFocus: ['다음 집중 블록 준비', '내일의 핵심 3개 정하기', ''],
|
||||||
|
timetable: createEmptyTimetable(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeRecord(record) {
|
||||||
|
return {
|
||||||
|
...record,
|
||||||
|
tasks: record.tasks.map((task, index) => ({
|
||||||
|
label: task.label ?? task.id ?? '',
|
||||||
|
title: task.title ?? '',
|
||||||
|
checked: Boolean(task.checked),
|
||||||
|
})),
|
||||||
|
memo: record.memo.map((item) => {
|
||||||
|
if (typeof item === 'string') {
|
||||||
|
return {
|
||||||
|
label: '',
|
||||||
|
text: item,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
label: item.label ?? '',
|
||||||
|
text: item.text ?? '',
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
timetable: Array.isArray(record.timetable) && record.timetable.length === timetableCellCount
|
||||||
|
? [...record.timetable]
|
||||||
|
: createEmptyTimetable(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createInitialPlannerRecords() {
|
||||||
|
const baseRecords = Object.fromEntries(
|
||||||
|
Object.entries(plannerSeed).map(([key, record]) => [key, normalizeRecord(record)]),
|
||||||
|
)
|
||||||
|
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return baseRecords
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const savedState = JSON.parse(window.localStorage.getItem(STORAGE_KEY) ?? '{}')
|
||||||
|
const savedRecords = savedState.records ?? {}
|
||||||
|
|
||||||
|
Object.entries(savedRecords).forEach(([key, record]) => {
|
||||||
|
baseRecords[key] = normalizeRecord(record)
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('저장된 플래너 상태를 불러오지 못했습니다.', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseRecords
|
||||||
|
}
|
||||||
|
|
||||||
|
const plannerRecords = reactive(createInitialPlannerRecords())
|
||||||
|
|
||||||
|
function restoreDateState() {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const savedState = JSON.parse(window.localStorage.getItem(STORAGE_KEY) ?? '{}')
|
||||||
|
|
||||||
|
if (savedState.selectedDate) {
|
||||||
|
selectedDate.value = toDateValue(savedState.selectedDate, selectedDate.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (savedState.calendarViewDate) {
|
||||||
|
calendarViewDate.value = toDateValue(savedState.calendarViewDate, selectedDate.value)
|
||||||
|
} else {
|
||||||
|
calendarViewDate.value = new Date(selectedDate.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (savedState.statsRangeStart) {
|
||||||
|
statsRangeStart.value = savedState.statsRangeStart
|
||||||
|
}
|
||||||
|
|
||||||
|
if (savedState.statsRangeEnd) {
|
||||||
|
statsRangeEnd.value = savedState.statsRangeEnd
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('저장된 날짜 상태를 불러오지 못했습니다.', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
restoreDateState()
|
||||||
|
|
||||||
function getPlannerRecord(date) {
|
function getPlannerRecord(date) {
|
||||||
const key = toKey(date)
|
const key = toKey(date)
|
||||||
|
|
||||||
@@ -142,12 +266,31 @@ const secondaryDate = computed(() => {
|
|||||||
|
|
||||||
const secondaryPlanner = computed(() => getPlannerRecord(secondaryDate.value))
|
const secondaryPlanner = computed(() => getPlannerRecord(secondaryDate.value))
|
||||||
|
|
||||||
|
function getDateDisplay(date) {
|
||||||
|
const main = `${date.getFullYear()}. ${`${date.getMonth() + 1}`.padStart(2, '0')}. ${`${date.getDate()}`.padStart(2, '0')}.`
|
||||||
|
const weekdayMap = ['(일)', '(월)', '(화)', '(수)', '(목)', '(금)', '(토)']
|
||||||
|
const weekday = weekdayMap[date.getDay()]
|
||||||
|
const weekdayTone =
|
||||||
|
date.getDay() === 0 ? 'text-red-500' : date.getDay() === 6 ? 'text-blue-500' : 'text-ink'
|
||||||
|
|
||||||
|
return {
|
||||||
|
main,
|
||||||
|
weekday,
|
||||||
|
weekdayTone,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedDateDisplay = computed(() => getDateDisplay(selectedDate.value))
|
||||||
|
const secondaryDateDisplay = computed(() => getDateDisplay(secondaryDate.value))
|
||||||
|
|
||||||
const monthLabel = computed(() =>
|
const monthLabel = computed(() =>
|
||||||
`${selectedDate.value.getFullYear()}.${`${selectedDate.value.getMonth() + 1}`.padStart(2, '0')}`,
|
`${calendarViewDate.value.getMonth() + 1}`.padStart(2, '0'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const yearLabel = computed(() => `${calendarViewDate.value.getFullYear()}`)
|
||||||
|
|
||||||
const calendarDays = computed(() => {
|
const calendarDays = computed(() => {
|
||||||
const base = selectedDate.value
|
const base = calendarViewDate.value
|
||||||
const first = new Date(base.getFullYear(), base.getMonth(), 1)
|
const first = new Date(base.getFullYear(), base.getMonth(), 1)
|
||||||
const start = new Date(first)
|
const start = new Date(first)
|
||||||
start.setDate(first.getDate() - first.getDay())
|
start.setDate(first.getDate() - first.getDay())
|
||||||
@@ -164,19 +307,82 @@ const calendarDays = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const completedTasks = computed(() => planner.value.tasks.filter((task) => task.checked).length)
|
const markedDateKeys = computed(() =>
|
||||||
const completionRate = computed(() => Math.round((completedTasks.value / planner.value.tasks.length) * 100))
|
Object.entries(plannerRecords)
|
||||||
|
.filter(([, record]) => hasPlannerContent(record))
|
||||||
|
.map(([key]) => key),
|
||||||
|
)
|
||||||
|
|
||||||
|
const filledTasks = computed(() =>
|
||||||
|
planner.value.tasks.filter((task) => task.title.trim()),
|
||||||
|
)
|
||||||
|
const completedTasks = computed(() =>
|
||||||
|
filledTasks.value.filter((task) => task.checked).length,
|
||||||
|
)
|
||||||
|
const completionRate = computed(() => {
|
||||||
|
if (filledTasks.value.length === 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.round((completedTasks.value / filledTasks.value.length) * 100)
|
||||||
|
})
|
||||||
|
|
||||||
|
function formatTotalTime(record) {
|
||||||
|
const activeCellCount = record.timetable.filter(Boolean).length
|
||||||
|
const totalMinutes = activeCellCount * 10
|
||||||
|
const hoursPart = `${Math.floor(totalMinutes / 60)}`.padStart(2, '0')
|
||||||
|
const minutesPart = `${totalMinutes % 60}`.padStart(2, '0')
|
||||||
|
|
||||||
|
return `${hoursPart}H ${minutesPart}M`
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFocusedMinutes(record) {
|
||||||
|
return record.timetable.filter(Boolean).length * 10
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCompletionRate(record) {
|
||||||
|
const activeTasks = record.tasks.filter((task) => task.title.trim())
|
||||||
|
|
||||||
|
if (activeTasks.length === 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const doneTasks = activeTasks.filter((task) => task.checked).length
|
||||||
|
return Math.round((doneTasks / activeTasks.length) * 100)
|
||||||
|
}
|
||||||
|
|
||||||
function shiftDate(amount) {
|
function shiftDate(amount) {
|
||||||
const next = new Date(selectedDate.value)
|
const next = new Date(selectedDate.value)
|
||||||
next.setDate(next.getDate() + amount)
|
next.setDate(next.getDate() + amount)
|
||||||
selectedDate.value = next
|
selectedDate.value = next
|
||||||
|
calendarViewDate.value = new Date(next)
|
||||||
|
}
|
||||||
|
|
||||||
|
function shiftCalendarMonth(amount) {
|
||||||
|
const next = new Date(calendarViewDate.value)
|
||||||
|
next.setMonth(next.getMonth() + amount)
|
||||||
|
calendarViewDate.value = next
|
||||||
|
}
|
||||||
|
|
||||||
|
function shiftCalendarYear(amount) {
|
||||||
|
const next = new Date(calendarViewDate.value)
|
||||||
|
next.setFullYear(next.getFullYear() + amount)
|
||||||
|
calendarViewDate.value = next
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectDate(date) {
|
||||||
|
selectedDate.value = new Date(date)
|
||||||
|
calendarViewDate.value = new Date(date)
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateComment(record, value) {
|
function updateComment(record, value) {
|
||||||
record.comment = value
|
record.comment = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateTaskLabel(record, { index, value }) {
|
||||||
|
record.tasks[index].label = value
|
||||||
|
}
|
||||||
|
|
||||||
function updateTaskTitle(record, { index, value }) {
|
function updateTaskTitle(record, { index, value }) {
|
||||||
record.tasks[index].title = value
|
record.tasks[index].title = value
|
||||||
}
|
}
|
||||||
@@ -186,14 +392,226 @@ function toggleTask(record, index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateMemo(record, { index, value }) {
|
function updateMemo(record, { index, value }) {
|
||||||
record.memo[index] = value
|
record.memo[index].text = value
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateMemoLabel(record, { index, value }) {
|
||||||
|
record.memo[index].label = value
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTimetable(record, nextTimetable) {
|
||||||
|
record.timetable = nextTimetable
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasPlannerContent(record) {
|
||||||
|
return Boolean(
|
||||||
|
record.comment.trim() ||
|
||||||
|
record.tasks.some((task) => task.title.trim() || task.checked) ||
|
||||||
|
record.memo.some((item) => item.label.trim() || item.text.trim()) ||
|
||||||
|
record.timetable.some(Boolean),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const plannerEntries = computed(() =>
|
||||||
|
Object.entries(plannerRecords)
|
||||||
|
.filter(([, record]) => hasPlannerContent(record))
|
||||||
|
.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(() =>
|
||||||
|
rangeEntries.value.reduce((total, [, record]) => total + getFocusedMinutes(record), 0),
|
||||||
|
)
|
||||||
|
|
||||||
|
const totalRecordedTasks = computed(() =>
|
||||||
|
rangeEntries.value.reduce(
|
||||||
|
(total, [, record]) => total + record.tasks.filter((task) => task.title.trim()).length,
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
const completedRecordedTasks = computed(() =>
|
||||||
|
rangeEntries.value.reduce(
|
||||||
|
(total, [, record]) => total + record.tasks.filter((task) => task.title.trim() && task.checked).length,
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
const aggregateCompletionRate = computed(() => {
|
||||||
|
if (totalRecordedTasks.value === 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.round((completedRecordedTasks.value / totalRecordedTasks.value) * 100)
|
||||||
|
})
|
||||||
|
|
||||||
|
const overviewCards = computed(() => [
|
||||||
|
{
|
||||||
|
label: 'TOTAL FOCUSED',
|
||||||
|
value: formatMinutes(totalFocusedMinutes.value),
|
||||||
|
caption: '지금까지 기록된 전체 집중 시간',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'AVERAGE COMPLETION',
|
||||||
|
value: `${aggregateCompletionRate.value}%`,
|
||||||
|
caption: '입력된 할 일 기준 전체 평균 완료율',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'RECORDED DAYS',
|
||||||
|
value: `${rangeEntries.value.length}일`,
|
||||||
|
caption: '기록이 남아 있는 날짜 수',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'COMPLETED TASKS',
|
||||||
|
value: `${completedRecordedTasks.value}/${totalRecordedTasks.value || 0}`,
|
||||||
|
caption: '완료된 할 일과 전체 입력된 할 일 수',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
function formatMinutes(totalMinutes) {
|
||||||
|
const hoursPart = Math.floor(totalMinutes / 60)
|
||||||
|
const minutesPart = totalMinutes % 60
|
||||||
|
return `${hoursPart}H ${`${minutesPart}`.padStart(2, '0')}M`
|
||||||
|
}
|
||||||
|
|
||||||
|
function createDateLabel(dateKey) {
|
||||||
|
const date = toDateValue(dateKey)
|
||||||
|
const display = getDateDisplay(date)
|
||||||
|
return `${display.main} ${display.weekday}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const weeklyRecords = computed(() => {
|
||||||
|
const entries = rangeEntries.value.map(([key, record]) => {
|
||||||
|
const date = toDateValue(key)
|
||||||
|
const weekdayShort = ['일', '월', '화', '수', '목', '금', '토'][date.getDay()]
|
||||||
|
const focusedMinutes = getFocusedMinutes(record)
|
||||||
|
|
||||||
|
return {
|
||||||
|
key,
|
||||||
|
weekday: weekdayShort,
|
||||||
|
focusedMinutes,
|
||||||
|
focusedTime: formatMinutes(focusedMinutes),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (entries.length === 0) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
const maxMinutes = Math.max(...entries.map((entry) => entry.focusedMinutes), 60)
|
||||||
|
|
||||||
|
return entries.map((entry) => ({
|
||||||
|
...entry,
|
||||||
|
barHeight: Math.max(12, Math.round((entry.focusedMinutes / maxMinutes) * 100)),
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
const recentRecords = computed(() =>
|
||||||
|
[...rangeEntries.value]
|
||||||
|
.sort(([leftKey], [rightKey]) => rightKey.localeCompare(leftKey))
|
||||||
|
.slice(0, 5)
|
||||||
|
.map(([key, record]) => ({
|
||||||
|
key,
|
||||||
|
dateLabel: createDateLabel(key),
|
||||||
|
comment: record.comment.trim(),
|
||||||
|
focusedTime: formatTotalTime(record),
|
||||||
|
completionRate: getCompletionRate(record),
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
|
const bestDay = computed(() => {
|
||||||
|
if (rangeEntries.value.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const [bestKey, bestRecord] = [...rangeEntries.value].reduce((bestEntry, currentEntry) => {
|
||||||
|
const [, bestRecordValue] = bestEntry
|
||||||
|
const [, currentRecordValue] = currentEntry
|
||||||
|
|
||||||
|
return getFocusedMinutes(currentRecordValue) > getFocusedMinutes(bestRecordValue) ? currentEntry : bestEntry
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
dateLabel: createDateLabel(bestKey),
|
||||||
|
summary: `${formatTotalTime(bestRecord)} 집중, 완료율 ${getCompletionRate(bestRecord)}%, 코멘트 "${
|
||||||
|
bestRecord.comment.trim() || '없음'
|
||||||
|
}"`,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
[plannerRecords, selectedDate, calendarViewDate, statsRangeStart, statsRangeEnd],
|
||||||
|
() => {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const serializableRecords = Object.fromEntries(
|
||||||
|
Object.entries(plannerRecords).map(([key, record]) => [
|
||||||
|
key,
|
||||||
|
{
|
||||||
|
...record,
|
||||||
|
tasks: record.tasks.map((task) => ({ ...task })),
|
||||||
|
memo: record.memo.map((item) => ({ ...item })),
|
||||||
|
timetable: [...record.timetable],
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
)
|
||||||
|
|
||||||
|
window.localStorage.setItem(
|
||||||
|
STORAGE_KEY,
|
||||||
|
JSON.stringify({
|
||||||
|
selectedDate: selectedDate.value.toISOString(),
|
||||||
|
calendarViewDate: calendarViewDate.value.toISOString(),
|
||||||
|
statsRangeStart: normalizedStatsRange.value.startKey,
|
||||||
|
statsRangeEnd: normalizedStatsRange.value.endKey,
|
||||||
|
records: serializableRecords,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{ deep: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
function fillTaskLabelsWithNumbers(record) {
|
||||||
|
record.tasks.forEach((task, index) => {
|
||||||
|
task.label = createTaskLabel(index)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearTaskLabels(record) {
|
||||||
|
record.tasks.forEach((task) => {
|
||||||
|
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>
|
||||||
@@ -205,6 +623,24 @@ function updateMemo(record, { index, value }) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-center gap-3">
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
|
<div class="inline-flex rounded-full border border-stone-200 bg-stone-100 p-1">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full px-4 py-2 text-xs font-bold tracking-[0.14em] transition"
|
||||||
|
:class="screenMode === 'planner' ? 'bg-white text-ink shadow-sm' : 'text-stone-500'"
|
||||||
|
@click="screenMode = 'planner'"
|
||||||
|
>
|
||||||
|
PLANNER
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full px-4 py-2 text-xs font-bold tracking-[0.14em] transition"
|
||||||
|
:class="screenMode === 'stats' ? 'bg-white text-ink shadow-sm' : 'text-stone-500'"
|
||||||
|
@click="screenMode = 'stats'"
|
||||||
|
>
|
||||||
|
STATS
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="inline-flex rounded-full border border-stone-200 bg-stone-100 p-1">
|
<div class="inline-flex rounded-full border border-stone-200 bg-stone-100 p-1">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -239,29 +675,56 @@ function updateMemo(record, { index, value }) {
|
|||||||
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="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-label="dateFormatter.format(selectedDate)"
|
<PlannerPage
|
||||||
:dday="planner.dday"
|
:date-main="selectedDateDisplay.main"
|
||||||
:comment="planner.comment"
|
:date-weekday="selectedDateDisplay.weekday"
|
||||||
:total-time="planner.totalTime"
|
:date-weekday-tone="selectedDateDisplay.weekdayTone"
|
||||||
:tasks="planner.tasks"
|
:dday="planner.dday"
|
||||||
:memo="planner.memo"
|
:comment="planner.comment"
|
||||||
:hours="hours"
|
:total-time="formatTotalTime(planner)"
|
||||||
@update:comment="updateComment(planner, $event)"
|
:tasks="planner.tasks"
|
||||||
@update:task-title="updateTaskTitle(planner, $event)"
|
:memo="planner.memo"
|
||||||
@toggle:task="toggleTask(planner, $event)"
|
:hours="hours"
|
||||||
@update:memo="updateMemo(planner, $event)"
|
: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>
|
||||||
|
|
||||||
<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">
|
||||||
@@ -275,6 +738,29 @@ function updateMemo(record, { index, value }) {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="border border-stone-200 bg-white/80 p-5">
|
||||||
|
<p class="mb-3 text-[11px] font-bold tracking-[0.22em] text-ink">TASK LABELS</p>
|
||||||
|
<p class="text-[11px] font-semibold leading-5 tracking-[0.06em] text-stone-600">
|
||||||
|
왼쪽 라벨은 직접 입력할 수 있고, 필요하면 아래 버튼으로 순번을 한 번에 채울 수 있습니다.
|
||||||
|
</p>
|
||||||
|
<div class="mt-4 flex flex-wrap gap-2">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="fillTaskLabelsWithNumbers(planner)"
|
||||||
|
>
|
||||||
|
번호 채우기
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="clearTaskLabels(planner)"
|
||||||
|
>
|
||||||
|
라벨 비우기
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<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">READ NEXT</p>
|
<p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">READ NEXT</p>
|
||||||
<div class="space-y-3">
|
<div class="space-y-3">
|
||||||
@@ -290,9 +776,14 @@ function updateMemo(record, { index, value }) {
|
|||||||
|
|
||||||
<MiniCalendar
|
<MiniCalendar
|
||||||
:month-label="monthLabel"
|
:month-label="monthLabel"
|
||||||
|
:year-label="yearLabel"
|
||||||
:days="calendarDays"
|
:days="calendarDays"
|
||||||
:selected-key="toKey(selectedDate)"
|
:selected-key="toKey(selectedDate)"
|
||||||
@select="selectedDate = $event"
|
:marked-keys="markedDateKeys"
|
||||||
|
@shift-month="shiftCalendarMonth"
|
||||||
|
@shift-year="shiftCalendarYear"
|
||||||
|
@go-today="selectDate(new Date())"
|
||||||
|
@select="selectDate"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="grid grid-cols-2 gap-4">
|
<section class="grid grid-cols-2 gap-4">
|
||||||
@@ -304,7 +795,7 @@ function updateMemo(record, { index, value }) {
|
|||||||
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-500">TASK COMPLETION</p>
|
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-500">TASK COMPLETION</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p class="text-[22px] font-semibold tracking-[-0.04em] text-stone-900">{{ planner.totalTime }}</p>
|
<p class="text-[22px] font-semibold tracking-[-0.04em] text-stone-900">{{ formatTotalTime(planner) }}</p>
|
||||||
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-500">FOCUSED TIME</p>
|
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-500">FOCUSED TIME</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -314,7 +805,8 @@ function updateMemo(record, { index, value }) {
|
|||||||
<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">
|
||||||
{{ dateFormatter.format(secondaryDate) }}
|
<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 || '새 작업 추가' }}" 로 시작합니다.
|
||||||
@@ -325,34 +817,138 @@ function updateMemo(record, { index, value }) {
|
|||||||
</aside>
|
</aside>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-else class="overflow-x-auto rounded-[32px] border border-white/60 bg-white/40 p-4 sm:p-6">
|
<section
|
||||||
|
v-else-if="screenMode === 'planner'"
|
||||||
|
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-label="dateFormatter.format(selectedDate)"
|
<PlannerPage
|
||||||
:dday="planner.dday"
|
:date-main="selectedDateDisplay.main"
|
||||||
:comment="planner.comment"
|
:date-weekday="selectedDateDisplay.weekday"
|
||||||
:total-time="planner.totalTime"
|
:date-weekday-tone="selectedDateDisplay.weekdayTone"
|
||||||
:tasks="planner.tasks"
|
:dday="planner.dday"
|
||||||
:memo="planner.memo"
|
:comment="planner.comment"
|
||||||
:hours="hours"
|
:total-time="formatTotalTime(planner)"
|
||||||
@update:comment="updateComment(planner, $event)"
|
:tasks="planner.tasks"
|
||||||
@update:task-title="updateTaskTitle(planner, $event)"
|
:memo="planner.memo"
|
||||||
@toggle:task="toggleTask(planner, $event)"
|
:hours="hours"
|
||||||
@update:memo="updateMemo(planner, $event)"
|
:timetable="planner.timetable"
|
||||||
/>
|
@update:comment="updateComment(planner, $event)"
|
||||||
<PlannerPage
|
@update:task-label="updateTaskLabel(planner, $event)"
|
||||||
:date-label="dateFormatter.format(secondaryDate)"
|
@update:task-title="updateTaskTitle(planner, $event)"
|
||||||
:dday="secondaryPlanner.dday"
|
@toggle:task="toggleTask(planner, $event)"
|
||||||
:comment="secondaryPlanner.comment"
|
@update:memo-label="updateMemoLabel(planner, $event)"
|
||||||
:total-time="secondaryPlanner.totalTime"
|
@update:memo="updateMemo(planner, $event)"
|
||||||
:tasks="secondaryPlanner.tasks"
|
@update:timetable="updateTimetable(planner, $event)"
|
||||||
:memo="secondaryPlanner.memo"
|
/>
|
||||||
:hours="hours"
|
</div>
|
||||||
@update:comment="updateComment(secondaryPlanner, $event)"
|
<div class="print-hidden">
|
||||||
@update:task-title="updateTaskTitle(secondaryPlanner, $event)"
|
<PlannerPage
|
||||||
@toggle:task="toggleTask(secondaryPlanner, $event)"
|
:date-main="secondaryDateDisplay.main"
|
||||||
@update:memo="updateMemo(secondaryPlanner, $event)"
|
: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>
|
||||||
|
|
||||||
|
<StatsDashboard
|
||||||
|
v-else
|
||||||
|
class="print-hidden"
|
||||||
|
:overview-cards="overviewCards"
|
||||||
|
:weekly-records="weeklyRecords"
|
||||||
|
:recent-records="recentRecords"
|
||||||
|
:best-day="bestDay"
|
||||||
|
: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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
defineProps({
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
monthLabel: {
|
monthLabel: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
yearLabel: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
days: {
|
days: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -12,16 +18,103 @@ defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
markedKeys: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['select'])
|
const emit = defineEmits(['select', 'shift-month', 'shift-year', 'go-today'])
|
||||||
|
|
||||||
|
const isYearPickerOpen = ref(false)
|
||||||
|
const currentYearNumber = computed(() => Number(props.yearLabel))
|
||||||
|
const yearRangeStart = computed(() => currentYearNumber.value - (currentYearNumber.value % 12))
|
||||||
|
const visibleYears = computed(() =>
|
||||||
|
Array.from({ length: 12 }, (_, index) => yearRangeStart.value + index),
|
||||||
|
)
|
||||||
|
|
||||||
|
function selectYear(year) {
|
||||||
|
emit('shift-year', year - currentYearNumber.value)
|
||||||
|
isYearPickerOpen.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="border border-stone-200 bg-white/80 p-5">
|
<section class="border border-stone-200 bg-white/80 p-5">
|
||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="relative mb-4 flex items-start justify-between gap-4">
|
||||||
<h2 class="text-[11px] font-bold tracking-[0.22em] text-ink">CALENDAR</h2>
|
<div>
|
||||||
<span class="text-[11px] font-semibold tracking-[0.16em] text-stone-500">{{ monthLabel }}</span>
|
<h2 class="text-[11px] font-bold tracking-[0.22em] text-ink">CALENDAR</h2>
|
||||||
|
<div class="mt-2 flex items-center gap-3">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="emit('shift-month', -1)"
|
||||||
|
>
|
||||||
|
←
|
||||||
|
</button>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p class="text-base font-semibold tracking-[-0.04em] text-stone-900">{{ monthLabel }}</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full px-2 py-1 text-[11px] font-semibold tracking-[0.16em] text-stone-500 transition hover:bg-stone-100 hover:text-ink"
|
||||||
|
@click="isYearPickerOpen = !isYearPickerOpen"
|
||||||
|
>
|
||||||
|
{{ yearLabel }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="emit('shift-month', 1)"
|
||||||
|
>
|
||||||
|
→
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="emit('go-today')"
|
||||||
|
>
|
||||||
|
TODAY
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="isYearPickerOpen"
|
||||||
|
class="absolute right-0 top-14 z-10 w-[220px] rounded-2xl border border-stone-200 bg-white p-4 shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="mb-3 flex items-center justify-between">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="emit('shift-year', -12)"
|
||||||
|
>
|
||||||
|
←
|
||||||
|
</button>
|
||||||
|
<p class="text-[11px] font-bold tracking-[0.16em] text-stone-500">
|
||||||
|
{{ visibleYears[0] }} - {{ visibleYears[visibleYears.length - 1] }}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
|
||||||
|
@click="emit('shift-year', 12)"
|
||||||
|
>
|
||||||
|
→
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 gap-2">
|
||||||
|
<button
|
||||||
|
v-for="year in visibleYears"
|
||||||
|
:key="year"
|
||||||
|
type="button"
|
||||||
|
class="rounded-xl border px-3 py-2 text-[11px] font-semibold transition"
|
||||||
|
:class="year === currentYearNumber ? 'border-ink bg-ink text-white' : 'border-stone-200 text-stone-700 hover:border-stone-400 hover:bg-stone-50'"
|
||||||
|
@click="selectYear(year)"
|
||||||
|
>
|
||||||
|
{{ year }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3 grid grid-cols-7 gap-2 text-center text-[10px] font-bold tracking-[0.12em] text-stone-400">
|
<div class="mb-3 grid grid-cols-7 gap-2 text-center text-[10px] font-bold tracking-[0.12em] text-stone-400">
|
||||||
<span v-for="weekday in ['S', 'M', 'T', 'W', 'T', 'F', 'S']" :key="weekday">{{ weekday }}</span>
|
<span v-for="weekday in ['S', 'M', 'T', 'W', 'T', 'F', 'S']" :key="weekday">{{ weekday }}</span>
|
||||||
@@ -40,7 +133,13 @@ const emit = defineEmits(['select'])
|
|||||||
]"
|
]"
|
||||||
@click="emit('select', day.date)"
|
@click="emit('select', day.date)"
|
||||||
>
|
>
|
||||||
{{ day.label }}
|
<span class="relative flex h-full w-full items-center justify-center">
|
||||||
|
<span>{{ day.label }}</span>
|
||||||
|
<span
|
||||||
|
v-if="markedKeys.includes(day.key)"
|
||||||
|
class="absolute bottom-[3px] h-[5px] w-[5px] rounded-full bg-red-500"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
defineProps({
|
import { onBeforeUnmount } from 'vue'
|
||||||
dateLabel: {
|
|
||||||
|
const props = defineProps({
|
||||||
|
dateMain: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
dateWeekday: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
dateWeekdayTone: {
|
||||||
|
type: String,
|
||||||
|
default: 'text-ink',
|
||||||
|
},
|
||||||
dday: {
|
dday: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -28,6 +38,10 @@ defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
timetable: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
brand: {
|
brand: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'SORI.STUDIO',
|
default: 'SORI.STUDIO',
|
||||||
@@ -36,21 +50,81 @@ defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
'update:comment',
|
'update:comment',
|
||||||
|
'update:task-label',
|
||||||
'update:task-title',
|
'update:task-title',
|
||||||
'toggle:task',
|
'toggle:task',
|
||||||
|
'update:memo-label',
|
||||||
'update:memo',
|
'update:memo',
|
||||||
|
'update:timetable',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
let dragState = null
|
||||||
|
|
||||||
|
function shouldShowTaskPlaceholder(index) {
|
||||||
|
return index === 0 && props.tasks.every((task) => !task.title.trim())
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildTimedRange(baseTimetable, startIndex, endIndex, nextValue) {
|
||||||
|
const nextTimetable = [...baseTimetable]
|
||||||
|
const rangeStart = Math.min(startIndex, endIndex)
|
||||||
|
const rangeEnd = Math.max(startIndex, endIndex)
|
||||||
|
|
||||||
|
for (let index = rangeStart; index <= rangeEnd; index += 1) {
|
||||||
|
nextTimetable[index] = nextValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return nextTimetable
|
||||||
|
}
|
||||||
|
|
||||||
|
function startTimetableDrag(index, event) {
|
||||||
|
if (event.button !== 0 && event.button !== 2) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const shouldFill = event.button === 2 ? false : !props.timetable[index]
|
||||||
|
|
||||||
|
dragState = {
|
||||||
|
startIndex: index,
|
||||||
|
baseTimetable: [...props.timetable],
|
||||||
|
nextValue: shouldFill,
|
||||||
|
}
|
||||||
|
|
||||||
|
emit('update:timetable', buildTimedRange(dragState.baseTimetable, index, index, dragState.nextValue))
|
||||||
|
}
|
||||||
|
|
||||||
|
function moveTimetableDrag(index) {
|
||||||
|
if (!dragState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
emit(
|
||||||
|
'update:timetable',
|
||||||
|
buildTimedRange(dragState.baseTimetable, dragState.startIndex, index, dragState.nextValue),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopTimetableDrag() {
|
||||||
|
dragState = null
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('pointerup', stopTimetableDrag)
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
window.removeEventListener('pointerup', stopTimetableDrag)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<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">
|
||||||
<div class="relative h-[90px] w-[394px] flex-1 border-t border-ink px-[10px] pt-[10px]">
|
<div class="relative h-[90px] w-[394px] flex-1 border-t border-ink px-[10px] pt-[10px]">
|
||||||
<span class="absolute -top-2 left-0 bg-paper px-[2px] text-muted">YEAR / MONTH / DAY</span>
|
<span class="absolute -top-2 left-0 bg-paper px-[2px] text-muted">YEAR / MONTH / DAY</span>
|
||||||
<p class="pt-6 text-xs tracking-[0.24em] text-ink sm:text-sm">{{ dateLabel }}</p>
|
<p class="pt-6 text-xs tracking-[0.24em] text-ink sm:text-sm">
|
||||||
|
<span>{{ dateMain }}</span>
|
||||||
|
<span class="ml-1" :class="dateWeekdayTone">{{ dateWeekday }}</span>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative h-[90px] w-[210px] border-t border-ink px-[10px] pt-[10px]">
|
<div class="relative h-[90px] w-[210px] border-t border-ink px-[10px] pt-[10px]">
|
||||||
<span class="absolute -top-2 left-0 bg-paper px-[2px] text-muted">D-DAY</span>
|
<span class="absolute -top-2 left-0 bg-paper px-[2px] text-muted">D-DAY</span>
|
||||||
@@ -86,25 +160,32 @@ const emit = defineEmits([
|
|||||||
class="flex h-[38px] items-center border-b"
|
class="flex h-[38px] items-center border-b"
|
||||||
:class="index % 5 === 4 || index === tasks.length - 1 ? 'border-ink' : 'border-line'"
|
:class="index % 5 === 4 || index === tasks.length - 1 ? 'border-ink' : 'border-line'"
|
||||||
>
|
>
|
||||||
<div class="h-full w-[62px] border-r border-dashed border-ink px-2 py-2 text-[9px] text-stone-500">
|
<div class="h-full w-[62px] border-r border-dashed border-ink px-2 py-[7px]">
|
||||||
{{ task.id }}
|
<input
|
||||||
|
:value="task.label"
|
||||||
|
type="text"
|
||||||
|
class="w-full bg-transparent text-center text-[9px] font-semibold tracking-[0.08em] text-stone-500 outline-none placeholder:text-stone-300"
|
||||||
|
@input="emit('update:task-label', { index, value: $event.target.value })"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex min-w-0 flex-1 items-center px-3">
|
<div class="flex min-w-0 flex-1 items-center px-3">
|
||||||
<input
|
<input
|
||||||
:value="task.title"
|
:value="task.title"
|
||||||
type="text"
|
type="text"
|
||||||
class="w-full truncate bg-transparent text-[11px] font-semibold normal-case tracking-[0.06em] text-stone-800 outline-none placeholder:text-stone-400"
|
class="w-full truncate bg-transparent text-[11px] font-semibold normal-case tracking-[0.06em] text-stone-800 outline-none placeholder:text-stone-400"
|
||||||
placeholder="할 일을 입력해 주세요."
|
:placeholder="shouldShowTaskPlaceholder(index) ? '할 일을 입력해 주세요.' : ''"
|
||||||
@input="emit('update:task-title', { index, value: $event.target.value })"
|
@input="emit('update:task-title', { index, value: $event.target.value })"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex h-full w-[42px] items-center justify-center p-[10px]">
|
<div class="flex h-full w-[42px] items-center justify-center p-[10px]">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="block h-full w-full border border-dashed transition"
|
class="flex h-full w-full items-center justify-center border border-dashed transition"
|
||||||
:class="task.checked ? 'border-ink bg-stone-100' : 'border-ink/60'"
|
:class="task.checked ? 'border-ink bg-stone-100 text-ink' : 'border-ink/60 text-transparent'"
|
||||||
@click="emit('toggle:task', index)"
|
@click="emit('toggle:task', index)"
|
||||||
></button>
|
>
|
||||||
|
<span class="text-sm leading-none">✓</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -115,17 +196,23 @@ const emit = defineEmits([
|
|||||||
<div class="border-t border-ink">
|
<div class="border-t border-ink">
|
||||||
<div
|
<div
|
||||||
v-for="(memoItem, index) in memo"
|
v-for="(memoItem, index) in memo"
|
||||||
:key="`${memoItem}-${index}`"
|
:key="`memo-${index}`"
|
||||||
class="flex h-[38px] items-center border-b"
|
class="flex h-[38px] items-center border-b"
|
||||||
:class="index === memo.length - 1 ? 'border-ink' : 'border-line'"
|
:class="index === memo.length - 1 ? 'border-ink' : 'border-line'"
|
||||||
>
|
>
|
||||||
<div class="h-full w-[62px] border-r border-dashed border-ink" />
|
<div class="h-full w-[62px] border-r border-dashed border-ink px-2 py-[7px]">
|
||||||
|
<input
|
||||||
|
:value="memoItem.label"
|
||||||
|
type="text"
|
||||||
|
class="w-full bg-transparent text-center text-[9px] font-semibold tracking-[0.08em] text-stone-500 outline-none placeholder:text-stone-300"
|
||||||
|
@input="emit('update:memo-label', { index, value: $event.target.value })"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="flex flex-1 items-center px-3">
|
<div class="flex flex-1 items-center px-3">
|
||||||
<input
|
<input
|
||||||
:value="memoItem"
|
:value="memoItem.text"
|
||||||
type="text"
|
type="text"
|
||||||
class="w-full bg-transparent text-[11px] font-semibold normal-case tracking-[0.06em] text-stone-700 outline-none placeholder:text-stone-400"
|
class="w-full bg-transparent text-[11px] font-semibold normal-case tracking-[0.06em] text-stone-700 outline-none placeholder:text-stone-400"
|
||||||
placeholder="메모를 입력해 주세요."
|
|
||||||
@input="emit('update:memo', { index, value: $event.target.value })"
|
@input="emit('update:memo', { index, value: $event.target.value })"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,13 +230,20 @@ const emit = defineEmits([
|
|||||||
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
|
||||||
v-for="quarter in 6"
|
v-for="quarter in 6"
|
||||||
:key="quarter"
|
:key="quarter"
|
||||||
class="h-full w-[30px] border-r border-dashed border-line last:border-r-0"
|
:class="props.timetable[index * 6 + quarter - 1] ? 'bg-stone-800/90' : 'bg-transparent'"
|
||||||
|
class="h-full w-[30px] cursor-crosshair border-r border-dashed border-line transition-colors last:border-r-0 touch-none select-none"
|
||||||
|
@contextmenu.prevent
|
||||||
|
@pointerdown.prevent="startTimetableDrag(index * 6 + quarter - 1, $event)"
|
||||||
|
@pointerenter="moveTimetableDrag(index * 6 + quarter - 1)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
157
src/components/StatsDashboard.vue
Normal file
157
src/components/StatsDashboard.vue
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
overviewCards: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
weeklyRecords: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
recentRecords: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
rangeStart: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
rangeEnd: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
bestDay: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
selectedDateLabel: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:range-start', 'update:range-end'])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<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">
|
||||||
|
<article
|
||||||
|
v-for="card in overviewCards"
|
||||||
|
:key="card.label"
|
||||||
|
class="rounded-[28px] border border-white/60 bg-white/80 p-5 shadow-paper backdrop-blur"
|
||||||
|
>
|
||||||
|
<p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">{{ card.label }}</p>
|
||||||
|
<p class="mt-4 text-[34px] font-semibold tracking-[-0.06em] text-stone-900">{{ card.value }}</p>
|
||||||
|
<p class="mt-2 text-[11px] font-semibold leading-5 tracking-[0.06em] text-stone-600">{{ card.caption }}</p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-6 xl:grid-cols-[minmax(0,1.3fr)_minmax(320px,0.7fr)]">
|
||||||
|
<article class="rounded-[28px] border border-white/60 bg-white/80 p-6 shadow-paper backdrop-blur">
|
||||||
|
<div class="flex items-end justify-between gap-4">
|
||||||
|
<div>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<p class="text-[11px] font-semibold tracking-[0.06em] text-stone-500">
|
||||||
|
기준 날짜: {{ selectedDateLabel }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-8 flex gap-3 overflow-x-auto pb-2">
|
||||||
|
<div
|
||||||
|
v-for="record in weeklyRecords"
|
||||||
|
:key="record.key"
|
||||||
|
class="flex min-w-[56px] flex-col items-center gap-3"
|
||||||
|
>
|
||||||
|
<div class="flex h-40 items-end">
|
||||||
|
<div
|
||||||
|
class="w-10 rounded-full bg-stone-900/90 transition-all"
|
||||||
|
:style="{ height: `${record.barHeight}%` }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<p class="text-[11px] font-bold tracking-[0.12em] text-stone-500">{{ record.weekday }}</p>
|
||||||
|
<p class="mt-1 text-[11px] font-semibold text-stone-800">{{ record.focusedTime }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<div class="grid gap-6">
|
||||||
|
<article class="rounded-[28px] border border-white/60 bg-white/80 p-6 shadow-paper backdrop-blur">
|
||||||
|
<p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">BEST DAY</p>
|
||||||
|
<div v-if="bestDay" class="mt-4">
|
||||||
|
<h2 class="text-2xl font-semibold tracking-[-0.05em] text-stone-900">
|
||||||
|
{{ bestDay.dateLabel }}
|
||||||
|
</h2>
|
||||||
|
<p class="mt-3 text-[13px] font-semibold leading-6 text-stone-700">
|
||||||
|
{{ bestDay.summary }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p v-else class="mt-4 text-[13px] font-semibold leading-6 text-stone-600">
|
||||||
|
아직 통계를 보여줄 기록이 충분하지 않습니다.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="rounded-[28px] border border-white/60 bg-white/80 p-6 shadow-paper backdrop-blur">
|
||||||
|
<p class="text-[11px] font-bold tracking-[0.22em] text-stone-500">RECENT RECORDS</p>
|
||||||
|
<div class="mt-4 space-y-4">
|
||||||
|
<div
|
||||||
|
v-for="record in recentRecords"
|
||||||
|
:key="record.key"
|
||||||
|
class="rounded-2xl border border-stone-200 bg-stone-50/80 p-4"
|
||||||
|
>
|
||||||
|
<div class="flex items-start justify-between gap-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-[12px] font-bold tracking-[0.08em] text-stone-900">{{ record.dateLabel }}</p>
|
||||||
|
<p class="mt-2 text-[11px] font-semibold leading-5 text-stone-600">
|
||||||
|
{{ record.comment || '코멘트 없음' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right">
|
||||||
|
<p class="text-sm font-semibold tracking-[-0.03em] text-stone-900">{{ record.focusedTime }}</p>
|
||||||
|
<p class="mt-1 text-[11px] font-semibold text-stone-500">{{ record.completionRate }}%</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
101
src/style.css
101
src/style.css
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user