Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c380e0562 | |||
| 0bc06b710a | |||
| 7704752064 | |||
| 279470dbd0 |
14
HANDOFF.md
14
HANDOFF.md
@@ -4,7 +4,7 @@
|
||||
|
||||
- 프로젝트명: 10 Minute Planner 웹 UI
|
||||
- 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript
|
||||
- 현재 기준 버전: `v0.0.2`
|
||||
- 현재 기준 버전: `v0.0.6`
|
||||
|
||||
## 기준 디자인
|
||||
|
||||
@@ -25,7 +25,14 @@
|
||||
- Tailwind 설정은 완료되어 있으며, 이 프로젝트의 스타일링 기준으로 유지한다.
|
||||
- 현재 선택 날짜는 시스템 날짜 기준으로 시작한다.
|
||||
- `COMMENT`, `TASKS`, `MEMO`는 화면에서 바로 편집할 수 있다.
|
||||
- TASKS 체크박스는 토글 가능하지만, `TOTAL TIME`과 타임테이블 계산은 아직 미구현이다.
|
||||
- TASKS 왼쪽 라벨은 순번 고정이 아니라 자유 입력 가능하다.
|
||||
- TASKS 체크박스는 토글 가능하며, 체크 상태는 바로 시각적으로 반영된다.
|
||||
- `TIME TABLE`은 드래그로 10분 블록을 연속 선택할 수 있다.
|
||||
- `TIME TABLE`은 우클릭 드래그 시 선택된 블록을 지우는 방식으로도 편집할 수 있다.
|
||||
- `TOTAL TIME`은 타임테이블에서 선택된 블록 수를 기준으로 자동 계산된다.
|
||||
- 달력은 연/월 이동이 가능하며, 현재 보이는 월과 선택된 날짜 상태를 분리해서 관리한다.
|
||||
- 달력 상단은 월 좌우 화살표, 클릭형 연도 선택, `TODAY` 버튼 구조로 동작한다.
|
||||
- 입력 내용이 있는 날짜는 달력 하단에 빨간 점으로 표시된다.
|
||||
|
||||
## 확정된 결정사항
|
||||
|
||||
@@ -36,8 +43,11 @@
|
||||
- 상단 날짜는 시스템 날짜 또는 현재 선택된 플래너 날짜 기준으로 자동 표시되어야 한다.
|
||||
- `D-DAY`는 지금은 보류이며, 이후 별도의 목표 관리 패널과 연결해서 계산한다.
|
||||
- `COMMENT`, `TASKS`, `MEMO`는 모두 입력 가능한 필드가 되어야 한다.
|
||||
- TASKS 라벨은 번호만 고정하지 말고 자유 입력이 가능해야 한다.
|
||||
- 번호 사용이 필요한 경우를 위해 우측 패널에서 TASKS 라벨을 순번으로 한 번에 채울 수 있어야 한다.
|
||||
- `TOTAL TIME`은 타임테이블 선택 상태를 기반으로 자동 계산되어야 한다.
|
||||
- 타임테이블은 마우스 드래그로 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 해석해야 한다.
|
||||
- 타임테이블 편집은 좌클릭 드래그로 칠하기, 우클릭 드래그로 지우기 방식이 더 자연스럽다.
|
||||
- 달력에는 연/월 이동 기능이 필요하다.
|
||||
- 내용이 저장된 날짜에는 달력에 빨간 점 표시가 필요하다.
|
||||
|
||||
|
||||
20
TODO.md
20
TODO.md
@@ -15,17 +15,25 @@
|
||||
- [x] `COMMENT`를 자유 입력 가능한 입력 필드로 바꾼다.
|
||||
- [x] `TASKS` 각 줄을 텍스트 입력 + 체크박스 토글 가능하게 만든다.
|
||||
- [x] `MEMO` 각 줄을 텍스트 입력 가능하게 만든다.
|
||||
- [ ] `TIME TABLE`을 마우스 드래그로 칠할 수 있게 만든다.
|
||||
- [ ] `TIME TABLE` 드래그가 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 처리한다.
|
||||
- [ ] 선택된 `TIME TABLE` 구간을 기준으로 `TOTAL TIME`을 자동 계산한다.
|
||||
- [x] `TIME TABLE`을 마우스 드래그로 칠할 수 있게 만든다.
|
||||
- [x] `TIME TABLE` 드래그가 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 처리한다.
|
||||
- [x] 선택된 `TIME TABLE` 구간을 기준으로 `TOTAL TIME`을 자동 계산한다.
|
||||
|
||||
## 2단계: 달력과 이동 기능
|
||||
|
||||
- [ ] 달력에 연/월 이동 기능을 추가한다.
|
||||
- [ ] 선택 날짜를 클릭하면 해당 날짜 플래너 데이터로 이동되게 한다.
|
||||
- [ ] 입력값이 하나라도 있는 날짜에는 달력 하단에 빨간 점 표시를 추가한다.
|
||||
- [x] 달력에 연/월 이동 기능을 추가한다.
|
||||
- [x] 선택 날짜를 클릭하면 해당 날짜 플래너 데이터로 이동되게 한다.
|
||||
- [x] 입력값이 하나라도 있는 날짜에는 달력 하단에 빨간 점 표시를 추가한다.
|
||||
- [ ] `PREV DAY` / `NEXT DAY` 이동 시 현재 편집 중 데이터와 연결되도록 정리한다.
|
||||
|
||||
## 추가 반영 메모
|
||||
|
||||
- [x] TASKS 왼쪽 라벨은 자유 입력 가능해야 한다.
|
||||
- [x] 우측 패널에서 TASKS 번호를 한 번에 채우는 빠른 액션이 있어야 한다.
|
||||
- [x] 달력 상단은 좌우 화살표로 월 이동하는 구조가 더 적합하다.
|
||||
- [x] 연도 클릭 시 연도 선택 UI가 열려야 한다.
|
||||
- [x] 오늘 날짜로 즉시 돌아가는 버튼이 필요하다.
|
||||
|
||||
## 3단계: 목표와 회고 기능
|
||||
|
||||
- [ ] 목표 관리 패널을 설계한다.
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ten-minute-planner",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ten-minute-planner",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.6",
|
||||
"dependencies": {
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ten-minute-planner",
|
||||
"private": true,
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.6",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
236
src/App.vue
236
src/App.vue
@@ -5,6 +5,7 @@ import PlannerPage from './components/PlannerPage.vue'
|
||||
|
||||
const viewMode = ref('focus')
|
||||
const selectedDate = ref(new Date())
|
||||
const calendarViewDate = ref(new Date(selectedDate.value))
|
||||
|
||||
const hours = [
|
||||
'6', '7', '8', '9', '10', '11', '12',
|
||||
@@ -13,27 +14,48 @@ const hours = [
|
||||
'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 = {
|
||||
'2026-04-21': {
|
||||
dday: 'D-12 LAUNCH',
|
||||
comment: '집중 작업 3개만 남기고, 10분 단위로 흐름을 끊지 않기.',
|
||||
totalTime: '09H 40M',
|
||||
tasks: [
|
||||
{ id: '01', title: '홈 화면 정보 구조 정리', checked: true },
|
||||
{ id: '02', title: '플래너 페이지 헤더 상태 연결', checked: true },
|
||||
{ id: '03', title: '타임테이블 액티브 블록 설계' },
|
||||
{ id: '04', title: '우측 캘린더 빠른 이동 구현' },
|
||||
{ id: '05', title: '전날 요약 영역 문구 다듬기' },
|
||||
{ id: '06', title: '다음날 할 일 자동 제안 시나리오' },
|
||||
{ id: '07', title: '통계 카드 레이아웃 정리' },
|
||||
{ id: '08', title: '모바일 스택 레이아웃 점검' },
|
||||
{ id: '09', title: '체크박스 인터랙션 연결' },
|
||||
{ id: '10', title: '페이지 넘김 애니메이션 방향 검토' },
|
||||
{ id: '11', title: 'Tailwind 토큰 정리' },
|
||||
{ id: '12', title: 'Vue 컴포넌트 분리 기준 정하기' },
|
||||
{ id: '13', title: '빈 상태 문구 작성' },
|
||||
{ id: '14', title: '주간 리듬 회고 메모 추가' },
|
||||
{ id: '15', title: '디자인 QA 체크리스트 정리' },
|
||||
{ label: '01', title: '홈 화면 정보 구조 정리', checked: true },
|
||||
{ label: '02', title: '플래너 페이지 헤더 상태 연결', checked: true },
|
||||
{ label: '03', title: '타임테이블 액티브 블록 설계' },
|
||||
{ label: '04', title: '우측 캘린더 빠른 이동 구현' },
|
||||
{ label: '05', title: '전날 요약 영역 문구 다듬기' },
|
||||
{ label: '06', title: '다음날 할 일 자동 제안 시나리오' },
|
||||
{ label: '07', title: '통계 카드 레이아웃 정리' },
|
||||
{ label: '08', title: '모바일 스택 레이아웃 점검' },
|
||||
{ label: '09', title: '체크박스 인터랙션 연결' },
|
||||
{ label: '10', title: '페이지 넘김 애니메이션 방향 검토' },
|
||||
{ label: '11', title: 'Tailwind 토큰 정리' },
|
||||
{ label: '12', title: 'Vue 컴포넌트 분리 기준 정하기' },
|
||||
{ label: '13', title: '빈 상태 문구 작성' },
|
||||
{ label: '14', title: '주간 리듬 회고 메모 추가' },
|
||||
{ label: '15', title: '디자인 QA 체크리스트 정리' },
|
||||
],
|
||||
memo: [
|
||||
'오른쪽 패널은 정보 확인과 이동이 한 번에 되도록 유지.',
|
||||
@@ -50,27 +72,31 @@ const plannerSeed = {
|
||||
'다음날 핵심 3개 자동 복사',
|
||||
'미완료 작업만 재정렬',
|
||||
],
|
||||
timetable: createTimetableFromRanges([
|
||||
[6, 13],
|
||||
[24, 32],
|
||||
[42, 47],
|
||||
]),
|
||||
},
|
||||
'2026-04-22': {
|
||||
dday: 'D-11 LAUNCH',
|
||||
comment: '초반 90분은 구현, 후반은 문장과 사용성 정리에 사용.',
|
||||
totalTime: '08H 20M',
|
||||
tasks: [
|
||||
{ id: '01', title: '통계 섹션 수치 실제 계산 연결', checked: true },
|
||||
{ id: '02', title: '날짜 선택 시 상태 동기화' },
|
||||
{ id: '03', title: '다음날 할 일 템플릿 개선' },
|
||||
{ id: '04', title: '2페이지 보기 비교 카피 작성' },
|
||||
{ id: '05', title: '주간 흐름 카드 추가' },
|
||||
{ id: '06', title: '메모 영역 편집 UX 개선' },
|
||||
{ id: '07', title: '프린트 스타일 초안 점검' },
|
||||
{ id: '08', title: '색 대비 보정' },
|
||||
{ id: '09', title: '우측 패널 축약 버전 검토' },
|
||||
{ id: '10', title: '마감용 체크리스트 분리' },
|
||||
{ id: '11', title: '키보드 탐색 흐름 다듬기' },
|
||||
{ id: '12', title: '데이터 구조 문서화' },
|
||||
{ id: '13', title: '테스트 날짜 더미 세트 늘리기' },
|
||||
{ id: '14', title: '브랜드 푸터 위치 확정' },
|
||||
{ id: '15', title: '빈 상태 일러스트 여부 결정' },
|
||||
{ label: '01', title: '통계 섹션 수치 실제 계산 연결', checked: true },
|
||||
{ label: '02', title: '날짜 선택 시 상태 동기화' },
|
||||
{ label: '03', title: '다음날 할 일 템플릿 개선' },
|
||||
{ label: '04', title: '2페이지 보기 비교 카피 작성' },
|
||||
{ label: '05', title: '주간 흐름 카드 추가' },
|
||||
{ label: '06', title: '메모 영역 편집 UX 개선' },
|
||||
{ label: '07', title: '프린트 스타일 초안 점검' },
|
||||
{ label: '08', title: '색 대비 보정' },
|
||||
{ label: '09', title: '우측 패널 축약 버전 검토' },
|
||||
{ label: '10', title: '마감용 체크리스트 분리' },
|
||||
{ label: '11', title: '키보드 탐색 흐름 다듬기' },
|
||||
{ label: '12', title: '데이터 구조 문서화' },
|
||||
{ label: '13', title: '테스트 날짜 더미 세트 늘리기' },
|
||||
{ label: '14', title: '브랜드 푸터 위치 확정' },
|
||||
{ label: '15', title: '빈 상태 일러스트 여부 결정' },
|
||||
],
|
||||
memo: [
|
||||
'한 화면에 모든 정보를 모으되 시선 이동은 짧게.',
|
||||
@@ -87,11 +113,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',
|
||||
@@ -110,18 +139,38 @@ function buildFallbackRecord(date) {
|
||||
return {
|
||||
dday: 'D-00 FOCUS',
|
||||
comment: '',
|
||||
totalTime: '00H 00M',
|
||||
tasks: Array.from({ length: 15 }, (_, index) => ({
|
||||
id: `${index + 1}`.padStart(2, '0'),
|
||||
label: createTaskLabel(index),
|
||||
title: '',
|
||||
checked: false,
|
||||
})),
|
||||
memo: ['', '', ''],
|
||||
prevSummary: ['이전 기록 없음', '새로운 흐름 시작', ''],
|
||||
nextFocus: ['다음 집중 블록 준비', '내일의 핵심 3개 정하기', ''],
|
||||
timetable: createEmptyTimetable(),
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeRecord(record) {
|
||||
return {
|
||||
...record,
|
||||
tasks: record.tasks.map((task, index) => ({
|
||||
label: task.label ?? task.id ?? createTaskLabel(index),
|
||||
title: task.title ?? '',
|
||||
checked: Boolean(task.checked),
|
||||
})),
|
||||
timetable: Array.isArray(record.timetable) && record.timetable.length === timetableCellCount
|
||||
? [...record.timetable]
|
||||
: createEmptyTimetable(),
|
||||
}
|
||||
}
|
||||
|
||||
const plannerRecords = reactive(
|
||||
Object.fromEntries(
|
||||
Object.entries(plannerSeed).map(([key, record]) => [key, normalizeRecord(record)]),
|
||||
),
|
||||
)
|
||||
|
||||
function getPlannerRecord(date) {
|
||||
const key = toKey(date)
|
||||
|
||||
@@ -143,11 +192,13 @@ const secondaryDate = computed(() => {
|
||||
const secondaryPlanner = computed(() => getPlannerRecord(secondaryDate.value))
|
||||
|
||||
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 base = selectedDate.value
|
||||
const base = calendarViewDate.value
|
||||
const first = new Date(base.getFullYear(), base.getMonth(), 1)
|
||||
const start = new Date(first)
|
||||
start.setDate(first.getDate() - first.getDay())
|
||||
@@ -164,19 +215,56 @@ const calendarDays = computed(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const markedDateKeys = computed(() =>
|
||||
Object.entries(plannerRecords)
|
||||
.filter(([, record]) => hasPlannerContent(record))
|
||||
.map(([key]) => key),
|
||||
)
|
||||
|
||||
const completedTasks = computed(() => planner.value.tasks.filter((task) => task.checked).length)
|
||||
const completionRate = computed(() => Math.round((completedTasks.value / planner.value.tasks.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 shiftDate(amount) {
|
||||
const next = new Date(selectedDate.value)
|
||||
next.setDate(next.getDate() + amount)
|
||||
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) {
|
||||
record.comment = value
|
||||
}
|
||||
|
||||
function updateTaskLabel(record, { index, value }) {
|
||||
record.tasks[index].label = value
|
||||
}
|
||||
|
||||
function updateTaskTitle(record, { index, value }) {
|
||||
record.tasks[index].title = value
|
||||
}
|
||||
@@ -188,6 +276,31 @@ function toggleTask(record, index) {
|
||||
function updateMemo(record, { index, value }) {
|
||||
record.memo[index] = 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.trim()) ||
|
||||
record.timetable.some(Boolean),
|
||||
)
|
||||
}
|
||||
|
||||
function fillTaskLabelsWithNumbers(record) {
|
||||
record.tasks.forEach((task, index) => {
|
||||
task.label = createTaskLabel(index)
|
||||
})
|
||||
}
|
||||
|
||||
function clearTaskLabels(record) {
|
||||
record.tasks.forEach((task) => {
|
||||
task.label = ''
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -251,14 +364,17 @@ function updateMemo(record, { index, value }) {
|
||||
:date-label="dateFormatter.format(selectedDate)"
|
||||
:dday="planner.dday"
|
||||
:comment="planner.comment"
|
||||
:total-time="planner.totalTime"
|
||||
: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="updateMemo(planner, $event)"
|
||||
@update:timetable="updateTimetable(planner, $event)"
|
||||
/>
|
||||
|
||||
<aside class="flex flex-col gap-4">
|
||||
@@ -275,6 +391,29 @@ function updateMemo(record, { index, value }) {
|
||||
</div>
|
||||
</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">
|
||||
<p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">READ NEXT</p>
|
||||
<div class="space-y-3">
|
||||
@@ -290,9 +429,14 @@ function updateMemo(record, { index, value }) {
|
||||
|
||||
<MiniCalendar
|
||||
:month-label="monthLabel"
|
||||
:year-label="yearLabel"
|
||||
:days="calendarDays"
|
||||
: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">
|
||||
@@ -304,7 +448,7 @@ function updateMemo(record, { index, value }) {
|
||||
<p class="text-[11px] font-semibold tracking-[0.08em] text-stone-500">TASK COMPLETION</p>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -331,27 +475,33 @@ function updateMemo(record, { index, value }) {
|
||||
:date-label="dateFormatter.format(selectedDate)"
|
||||
:dday="planner.dday"
|
||||
:comment="planner.comment"
|
||||
:total-time="planner.totalTime"
|
||||
: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="updateMemo(planner, $event)"
|
||||
@update:timetable="updateTimetable(planner, $event)"
|
||||
/>
|
||||
<PlannerPage
|
||||
:date-label="dateFormatter.format(secondaryDate)"
|
||||
:dday="secondaryPlanner.dday"
|
||||
:comment="secondaryPlanner.comment"
|
||||
:total-time="secondaryPlanner.totalTime"
|
||||
: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="updateMemo(secondaryPlanner, $event)"
|
||||
@update:timetable="updateTimetable(secondaryPlanner, $event)"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
monthLabel: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
yearLabel: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
days: {
|
||||
type: Array,
|
||||
required: true,
|
||||
@@ -12,16 +18,103 @@ defineProps({
|
||||
type: String,
|
||||
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>
|
||||
|
||||
<template>
|
||||
<section class="border border-stone-200 bg-white/80 p-5">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<h2 class="text-[11px] font-bold tracking-[0.22em] text-ink">CALENDAR</h2>
|
||||
<span class="text-[11px] font-semibold tracking-[0.16em] text-stone-500">{{ monthLabel }}</span>
|
||||
<div class="relative mb-4 flex items-start justify-between gap-4">
|
||||
<div>
|
||||
<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 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>
|
||||
@@ -40,7 +133,13 @@ const emit = defineEmits(['select'])
|
||||
]"
|
||||
@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>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
import { onBeforeUnmount } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
dateLabel: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -28,6 +30,10 @@ defineProps({
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
timetable: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
brand: {
|
||||
type: String,
|
||||
default: 'SORI.STUDIO',
|
||||
@@ -36,10 +42,62 @@ defineProps({
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:comment',
|
||||
'update:task-label',
|
||||
'update:task-title',
|
||||
'toggle:task',
|
||||
'update:memo',
|
||||
'update:timetable',
|
||||
])
|
||||
|
||||
let dragState = null
|
||||
|
||||
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>
|
||||
|
||||
<template>
|
||||
@@ -86,8 +144,14 @@ const emit = defineEmits([
|
||||
class="flex h-[38px] items-center border-b"
|
||||
: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">
|
||||
{{ task.id }}
|
||||
<div class="h-full w-[62px] border-r border-dashed border-ink px-2 py-[7px]">
|
||||
<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"
|
||||
:placeholder="`${index + 1}`.padStart(2, '0')"
|
||||
@input="emit('update:task-label', { index, value: $event.target.value })"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex min-w-0 flex-1 items-center px-3">
|
||||
<input
|
||||
@@ -101,10 +165,12 @@ const emit = defineEmits([
|
||||
<div class="flex h-full w-[42px] items-center justify-center p-[10px]">
|
||||
<button
|
||||
type="button"
|
||||
class="block h-full w-full border border-dashed transition"
|
||||
:class="task.checked ? 'border-ink bg-stone-100' : 'border-ink/60'"
|
||||
class="flex h-full w-full items-center justify-center border border-dashed transition"
|
||||
:class="task.checked ? 'border-ink bg-stone-100 text-ink' : 'border-ink/60 text-transparent'"
|
||||
@click="emit('toggle:task', index)"
|
||||
></button>
|
||||
>
|
||||
<span class="text-sm leading-none">✓</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -115,7 +181,7 @@ const emit = defineEmits([
|
||||
<div class="border-t border-ink">
|
||||
<div
|
||||
v-for="(memoItem, index) in memo"
|
||||
:key="`${memoItem}-${index}`"
|
||||
:key="`memo-${index}`"
|
||||
class="flex h-[38px] items-center border-b"
|
||||
:class="index === memo.length - 1 ? 'border-ink' : 'border-line'"
|
||||
>
|
||||
@@ -149,7 +215,11 @@ const emit = defineEmits([
|
||||
<div
|
||||
v-for="quarter in 6"
|
||||
: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>
|
||||
|
||||
Reference in New Issue
Block a user