-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.ts
More file actions
135 lines (125 loc) · 3.14 KB
/
constants.ts
File metadata and controls
135 lines (125 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import { ITrack, IEvent } from './types';
// Helper to get date string relative to today (local timezone)
const getDateStr = (daysFromCenterDate: number): string => {
const date = new Date();
// set center date to 2026-04-20
date.setMonth(3);
date.setDate(20);
date.setHours(0, 0, 0, 0);
date.setDate(date.getDate() + daysFromCenterDate);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
};
const getCurrentYear = () => {
const date = new Date();
return date.getFullYear();
};
export const DEFAULT_MIN_YEAR = getCurrentYear();
export const DEFAULT_MAX_YEAR = getCurrentYear() + 1;
export const DEFAULT_TRACKS: ITrack[] = [
{ id: 'work', title: 'Work', color: '#3b82f6', order: 0 },
{ id: 'personal', title: 'Personal', color: '#10b981', order: 1 },
{ id: 'learning', title: 'Learning', color: '#8b5cf6', order: 2 },
];
export const DEFAULT_EVENTS: IEvent[] = [
// Work Track - Projects with some overlap to show lanes
{
id: 'w1',
trackId: 'work',
title: 'Website Redesign',
startDate: getDateStr(-60),
endDate: getDateStr(-25),
color: '#3b82f6',
},
{
id: 'w2',
trackId: 'work',
title: 'Mobile App Launch',
startDate: getDateStr(-35),
endDate: getDateStr(-10),
color: '#06b6d4',
},
{
id: 'w3',
trackId: 'work',
title: 'Q1 Planning',
startDate: getDateStr(-5),
endDate: getDateStr(14),
color: '#6366f1',
},
// Personal Track - Life events
{
id: 'p1',
trackId: 'personal',
title: 'Vacation',
startDate: getDateStr(-45),
endDate: getDateStr(-38),
color: '#14b8a6',
},
{
id: 'p2',
trackId: 'personal',
title: 'Home Renovation',
startDate: getDateStr(-30),
endDate: getDateStr(-5),
color: '#10b981',
},
{
id: 'p3',
trackId: 'personal',
title: 'Birthday Party',
startDate: getDateStr(7),
endDate: getDateStr(7),
color: '#f43f5e',
},
// Learning Track - Courses and growth
{
id: 'l1',
trackId: 'learning',
title: 'React Course',
startDate: getDateStr(-50),
endDate: getDateStr(-30),
color: '#8b5cf6',
},
{
id: 'l2',
trackId: 'learning',
title: 'TypeScript Workshop',
startDate: getDateStr(-25),
endDate: getDateStr(-18),
color: '#a855f7',
},
{
id: 'l3',
trackId: 'learning',
title: 'Design Bootcamp',
startDate: getDateStr(-10),
endDate: getDateStr(20),
color: '#d946ef',
},
];
export const DRAG_THRESHOLD_PX = 3;
// Pixels per day
// 0.5 = 180px/year (Year view)
// 2 = 60px/month (Month view)
// 10 = Month view detailed
// 50 = Day view
// 200 = Detailed day/hour view
export const ZOOM_LEVELS = [0.1, 0.5, 1, 2.5, 5, 10, 25, 50, 100, 200];
export const DEFAULT_ZOOM_INDEX = 4; // 10px/day
export const COLOR_PALETTE = [
'#ef4444', // Red
'#f97316', // Orange
'#f59e0b', // Amber
'#84cc16', // Lime
'#10b981', // Emerald
'#06b6d4', // Cyan
'#3b82f6', // Blue
'#6366f1', // Indigo
'#8b5cf6', // Violet
'#d946ef', // Fuchsia
'#f43f5e', // Rose
'#64748b', // Slate
];