-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html-aaaaaaaaaaaaaaaahh2h3h
More file actions
281 lines (238 loc) · 15.2 KB
/
Copy pathindex.html-aaaaaaaaaaaaaaaahh2h3h
File metadata and controls
281 lines (238 loc) · 15.2 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!DOCTYPE html>
<html lang="id" style="color-scheme: dark;">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Galactic Odyssey V2 - Cosmic Hierarchy Final</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700;900&display=swap" rel="stylesheet" />
<style>
/* --- MODERN CSS ENGINE --- */
@property --ion-x { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --ion-y { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --warp-scale { syntax: '<number>'; inherits: true; initial-value: 1; }
:root {
--accent-primary: #fbbf24;
--accent-secondary: #22d3ee;
--today-glow: rgba(59, 130, 246, 0.5);
--bg: light-dark(#f8fafc, #020617);
--border: light-dark(#cbd5e1, #1e293b);
--cell-bg: light-dark(#ffffff, #020617);
--text-main: light-dark(#0f172a, #f1f5f9);
--text-muted: light-dark(#64748b, #64748b);
--month-start-bg: light-dark(#e2e8f0, #0f172a);
--dust-opacity: light-dark(0.05, 0.15);
--ion-color: light-dark(rgba(8, 145, 178, 0.1), rgba(34, 211, 238, 0.12));
--weekend-shimmer: light-dark(rgba(0,0,0,0.02), rgba(255,255,255,0.03));
/* NEW: Monday Pulse Color */
--monday-glow: light-dark(rgba(251, 191, 36, 0.05), rgba(251, 191, 36, 0.08));
}
[data-theme='light'] { color-scheme: light; }
[data-theme='dark'] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
html, body { height: 100dvh; width: 100vw; background: var(--bg); color: var(--text-main); font-family: 'Space Grotesk', sans-serif; overflow: hidden; perspective: 1200px; }
/* --- CURSOR DISPLAY --- */
@media (pointer: fine) { html, body, .cell { cursor: none !important; } #cursor-wrapper, #ion-drive { display: block; } }
@media (pointer: coarse) { #cursor-wrapper, #ion-drive { display: none !important; } html, body, .cell { cursor: auto !important; } }
#ion-drive {
position: fixed; inset: 0; z-index: 5; pointer-events: none;
background: radial-gradient(var(--glow-size, 600px) circle at calc(var(--ion-x) * 1px) calc(var(--ion-y) * 1px), var(--ion-color) 0%, transparent 70%);
transform: translate3d(0,0,0); will-change: background;
}
#cursor-wrapper { position: fixed; top: 0; left: 0; z-index: 10000; pointer-events: none; will-change: transform; transform: translate3d(0,0,0); opacity: 0; }
#cursor-dot { width: 6px; height: 6px; background: var(--accent-secondary); border-radius: 50%; box-shadow: 0 0 15px var(--accent-secondary); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#cursor-wrapper.is-hovering #cursor-dot { transform: scale(3.5); background: var(--accent-primary); }
#viewport { width: 100vw; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; position: relative; -webkit-overflow-scrolling: touch; }
#viewport::-webkit-scrollbar { display: none; }
#infinite-canvas { position: relative; width: 100%; contain: layout; }
.year-block { position: absolute; left: 0; width: 100vw; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; overflow: hidden; content-visibility: auto; contain-intrinsic-size: 100vw 100dvh; transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), filter 0.8s ease, opacity 0.6s ease; transform-origin: center center; }
.year-block:not(.active) { transform: scale(0.92) translateZ(-150px); filter: blur(10px); opacity: 0.35; }
.grid-container { position: relative; flex: 1; display: flex; background: var(--bg); overflow-x: hidden; scrollbar-width: none; }
.grid-container::-webkit-scrollbar { display: none; }
.watermark-embedded {
position: absolute; top: 0; right: 5%; height: 100%; display: flex; align-items: center;
font-size: clamp(100px, 30dvh, 400px); font-weight: 900; color: transparent;
background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary), transparent);
background-clip: text; -webkit-background-clip: text; -webkit-text-stroke: 1px rgba(148, 163, 184, 0.1); writing-mode: vertical-rl; pointer-events: none; z-index: 10; opacity: 0.15; transition: opacity 1s, transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.year-block.is-scrolling .watermark-embedded { position: fixed; opacity: 0.08; }
.grid-layer { display: grid; width: 100.1%; margin-left: -0.5px; min-height: 100%; opacity: 0; transition: opacity 0.8s ease; z-index: 2; gap: 0; background: transparent; }
.year-block.active .grid-layer { opacity: 1; }
/* --- CELL SYSTEM --- */
.cell { background: var(--cell-bg); position: relative; contain: strict; box-shadow: inset 0 0 0 0.5px var(--border); min-height: 60px; will-change: background; display: flex; flex-direction: column; }
.cell.filler { background: color-mix(in srgb, var(--bg), transparent 60%); }
.cell.filler .date-num { color: var(--text-muted); opacity: 0.2; }
/* Weekend Style: Deep Space Texture */
.cell.weekend { background-image: repeating-linear-gradient(45deg, var(--weekend-shimmer), var(--weekend-shimmer) 2px, transparent 2px, transparent 8px); }
/* NEW Monday Style: Radiant Star Focus */
.cell.week-start {
background: radial-gradient(circle at 10% 10%, var(--monday-glow) 0%, transparent 60%);
}
.cell.week-start .info-meta:last-child {
color: var(--accent-primary);
font-weight: 700;
}
.cell.month-start { background: var(--month-start-bg); box-shadow: inset 4px 0 0 var(--accent-secondary), inset 0 0 0 0.5px var(--border); }
.cell.month-start .info-meta.top-label { color: var(--accent-secondary); font-weight: 900; }
.cell.today { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important; z-index: 11; box-shadow: 0 15px 35px -5px var(--today-glow), inset 0 0 0 0.5px var(--border); }
.cell.today .date-num { font-weight: 900; color: #fff !important; }
.cell-content { flex: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 8px 4px; text-align: center; pointer-events: none; }
.info-meta { font-size: clamp(7px, 0.9dvh, 8px); text-transform: uppercase; font-weight: 500; color: var(--text-muted); letter-spacing: 0.1em; }
.date-num { font-size: clamp(16px, 3dvh, 28px); font-weight: 300; line-height: 1.1; color: var(--text-main); }
#theme-veil { position: fixed; inset: 0; z-index: 9999; background: var(--bg); pointer-events: none; opacity: 0; transition: opacity 0.5s; }
#theme-veil.active { opacity: 1; }
</style>
</head>
<body>
<div id="ion-drive"></div>
<div id="cursor-wrapper"><div id="cursor-dot"></div></div>
<div id="theme-veil"></div>
<main id="viewport"><div id="infinite-canvas"></div></main>
<script type="module">
class GridArchitect {
#viewport = document.getElementById('viewport');
#canvas = document.getElementById('infinite-canvas');
#cursorWrapper = document.getElementById('cursor-wrapper');
#ionDrive = document.getElementById('ion-drive');
#today = new Date();
#yearHeight = window.innerHeight;
#activeYears = new Map();
#lastScrollPos = 0;
#mouse = { x: window.innerWidth/2, y: window.innerHeight/2 };
#current = { x: window.innerWidth/2, y: window.innerHeight/2 };
#months = ['JAN', 'FEB', 'MAR', 'APR', 'MEI', 'JUN', 'JUL', 'AGS', 'SEP', 'OKT', 'NOV', 'DES'];
#days = ['MIN', 'SEN', 'SEL', 'RAB', 'KAM', 'JUM', 'SAB'];
constructor() {
this.totalYears = 2000;
this.startY = (this.totalYears / 2) * this.#yearHeight;
this.#init();
}
async #init() {
this.#applyTheme(localStorage.getItem('theme') || 'dark');
this.#canvas.style.height = `${this.totalYears * this.#yearHeight}px`;
this.#viewport.scrollTop = this.startY;
this.#lastScrollPos = this.startY;
this.observer = new IntersectionObserver((entries) => {
entries.forEach(e => {
const block = e.target;
block.classList.toggle('active', e.isIntersecting);
if (e.isIntersecting && this.#viewport.scrollTop < this.#lastScrollPos) {
const container = block.querySelector('.grid-container');
if (container && block.classList.contains('is-scrolling')) container.scrollTop = container.scrollHeight;
}
this.#lastScrollPos = this.#viewport.scrollTop;
});
}, { threshold: 0.15 });
this.#setupListeners();
this.#cursorLoop();
this.#render();
setTimeout(() => this.#autoFocusToday(), 150);
}
#autoFocusToday() {
const block = this.#activeYears.get(this.#today.getFullYear());
if (block && block.classList.contains('is-scrolling')) {
const todayCell = block.querySelector('.cell.today');
const container = block.querySelector('.grid-container');
if (todayCell && container) container.scrollTop = todayCell.offsetTop - (window.innerHeight / 3);
}
}
#setupListeners() {
window.addEventListener('pointermove', (e) => {
this.#mouse.x = e.clientX; this.#mouse.y = e.clientY;
if(e.pointerType === 'mouse') this.#cursorWrapper.style.opacity = '1';
}, { passive: true });
document.addEventListener('mouseover', (e) => {
const cell = e.target.closest('.cell');
if (cell && !cell.classList.contains('filler')) {
this.#cursorWrapper.classList.add('is-hovering');
this.#ionDrive.style.setProperty('--glow-size', '800px');
}
});
document.addEventListener('mouseout', (e) => {
if (e.target.closest('.cell')) {
this.#cursorWrapper.classList.remove('is-hovering');
this.#ionDrive.style.setProperty('--glow-size', '600px');
}
});
this.#viewport.addEventListener('scroll', () => { requestAnimationFrame(() => { this.#render(); this.#handleParallax(); }); }, { passive: true });
window.addEventListener('keydown', (e) => { if (e.key.toLowerCase() === 't') this.#toggleTheme(); });
window.addEventListener('resize', () => location.reload());
}
#applyTheme(theme) { document.documentElement.setAttribute('data-theme', theme); document.documentElement.style.colorScheme = theme; }
#toggleTheme() {
const veil = document.getElementById('theme-veil');
veil.classList.add('active');
setTimeout(() => {
const next = document.documentElement.getAttribute('data-theme') === 'light' ? 'dark' : 'light';
this.#applyTheme(next);
localStorage.setItem('theme', next);
setTimeout(() => veil.classList.remove('active'), 200);
}, 400);
}
#cursorLoop() {
if (window.matchMedia("(pointer: coarse)").matches) return;
this.#current.x += (this.#mouse.x - this.#current.x) * 0.18;
this.#current.y += (this.#mouse.y - this.#current.y) * 0.18;
this.#cursorWrapper.style.transform = `translate3d(${this.#current.x}px, ${this.#current.y}px, 0)`;
this.#ionDrive.style.setProperty('--ion-x', this.#current.x);
this.#ionDrive.style.setProperty('--ion-y', this.#current.y);
requestAnimationFrame(() => this.#cursorLoop());
}
#handleParallax() {
const idx = Math.round(this.#viewport.scrollTop / this.#yearHeight);
const year = this.#today.getFullYear() + (idx - this.totalYears / 2);
const block = this.#activeYears.get(year);
if (block && !block.classList.contains('is-scrolling')) {
const offset = (this.#viewport.scrollTop % this.#yearHeight) - (this.#yearHeight / 2);
const wm = block.querySelector('.watermark-embedded');
if (wm) wm.style.transform = `translate3d(0, ${offset * 0.06}px, 0)`;
}
}
#render() {
const idx = Math.round(this.#viewport.scrollTop / this.#yearHeight);
const baseYear = this.#today.getFullYear() + (idx - this.totalYears / 2);
for (let i = -1; i <= 1; i++) this.#drawYear(baseYear + i, (idx + i) * this.#yearHeight);
this.#activeYears.forEach((block, year) => { if (Math.abs(year - baseYear) > 1) { this.observer.unobserve(block); block.remove(); this.#activeYears.delete(year); } });
}
#drawYear(year, yPos) {
if (this.#activeYears.has(year)) return;
const block = document.createElement('section');
block.className = 'year-block';
block.style.top = `${yPos}px`;
const jan1 = new Date(year, 0, 1);
const daysInYear = ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) ? 366 : 365;
const vw = window.innerWidth, vh = window.innerHeight;
let cols = vw < 600 ? 7 : Math.ceil(Math.sqrt(365 * (vw / vh)));
const globalOffset = Math.floor(jan1.getTime() / 86400000) % cols;
let rows = Math.ceil((daysInYear + globalOffset) / cols);
if ((vh / rows) < 60) block.classList.add('is-scrolling');
const iterDate = new Date(year, 0, 1 - globalOffset);
const todayStr = this.#today.toDateString();
let cellsHtml = '';
for (let s = 0; s < cols * rows; s++) {
const isMain = iterDate.getFullYear() === year;
const dDate = iterDate.getDate(), dDay = iterDate.getDay();
const isToday = iterDate.toDateString() === todayStr && isMain;
let cls = `cell ${!isMain ? 'filler' : ''} ${isToday ? 'today' : ''}`;
if (isMain) {
if (dDate === 1) cls += ' month-start';
if (dDay === 0 || dDay === 6) cls += ' weekend';
if (dDay === 1) cls += ' week-start';
}
cellsHtml += `<div class="${cls}"><div class="cell-content">
<span class="info-meta ${dDate === 1 && isMain ? 'top-label' : ''}">${isMain ? this.#months[iterDate.getMonth()] : ''}</span>
<span class="date-num">${dDate}</span>
<span class="info-meta">${isMain ? this.#days[dDay] : ''}</span>
</div></div>`;
iterDate.setDate(dDate + 1);
}
block.innerHTML = `<div class="grid-container" style="${block.classList.contains('is-scrolling')?'overflow-y:auto':'overflow-y:hidden'}"><div class="watermark-embedded">${year}</div><div class="grid-layer" style="grid-template-columns:repeat(${cols},1fr); height: ${block.classList.contains('is-scrolling') ? 'auto' : '100%'};">${cellsHtml}</div></div>`;
this.#canvas.appendChild(block);
this.#activeYears.set(year, block);
this.observer.observe(block);
}
}
new GridArchitect();
</script>
</body>
</html>