diff --git a/events.js b/events.js index 607cace..c6b32b2 100644 --- a/events.js +++ b/events.js @@ -18,5 +18,6 @@ window.SPECIAL_EVENTS = [ { start: '3edc.d430', label: 'Hochzeitstag', unit: 'cosmocycle', interval: 1 }, { start: '330d.d4ae', label: 'Zusammentag', unit: 'cosmocycle', interval: 1 }, { start: '11de.0c52', label: 'Anna', unit: 'cosmocycle', interval: 1 }, - { start: '467f.ae61', label: 'Iris', unit: 'cosmocycle', interval: 1 } + { start: '467f.ae61', label: 'Iris', unit: 'cosmocycle', interval: 1 }, + { start: '6854.7a75', cobie: '6854.7a75', label: 'Sleep', unit: 'second', interval: 86400, duration: 28800 } ]; diff --git a/index.html b/index.html index 73d0408..af18f18 100644 --- a/index.html +++ b/index.html @@ -66,13 +66,18 @@
-

Time Breakdown

diff --git a/script.js b/script.js index 830e9a0..cf732db 100644 --- a/script.js +++ b/script.js @@ -42,6 +42,7 @@ let compareManualMode = false; let compareCobiets = 0; let updateInterval; let lastRenderedEonstrip = null; +let currentDetailCob = null; function fmt(d, o) { // shift if TAI, then format @@ -685,6 +686,12 @@ function showEonstripDetails(index, startCobiets, opts) { } function showEonstripDetail(index, startCob) { + if (startCob === undefined) { + startCob = index; + const bdTmp = breakdownNonNeg(Math.abs(startCob)); + index = bdTmp.eonstrip; + } + currentDetailCob = startCob; const calendar = document.getElementById('calendarView'); const detail = document.getElementById('eonstripDetailView'); const timeline = document.getElementById('detailTimeline'); @@ -709,7 +716,7 @@ function showEonstripDetail(index, startCob) { const offsetStart = ((startCob % COBIE_UNITS.cosmocycle) + COBIE_UNITS.cosmocycle) % COBIE_UNITS.cosmocycle; const events = []; window.SPECIAL_EVENTS.forEach(ev => { - const evCob = parseCobiets(ev.cobie); + const evCob = parseCobiets(ev.cobie || ev.start); if (evCob === null) return; const evOffset = ((evCob % COBIE_UNITS.cosmocycle) + COBIE_UNITS.cosmocycle) % COBIE_UNITS.cosmocycle; if (evOffset >= offsetStart && evOffset < offsetStart + COBIE_UNITS.eonstrip) { @@ -746,6 +753,22 @@ function showEonstripDetail(index, startCob) { } } +function detailPrev() { + if (currentDetailCob === null) return; + showEonstripDetail(currentDetailCob - COBIE_UNITS.eonstrip); +} + +function detailNext() { + if (currentDetailCob === null) return; + showEonstripDetail(currentDetailCob + COBIE_UNITS.eonstrip); +} + +function detailNow() { + const now = toCobiets(new Date()); + const start = now - (now % COBIE_UNITS.eonstrip); + showEonstripDetail(start); +} + function getStep(mods) { // base step = 1 megasequence let step = 1; @@ -904,7 +927,11 @@ if (matchingOption) { document.getElementById('backToCalendar').addEventListener('click', () => { document.getElementById('eonstripDetailView').style.display = 'none'; document.getElementById('calendarView').style.display = 'block'; + currentDetailCob = null; }); +document.getElementById('detailPrev').addEventListener('click', detailPrev); +document.getElementById('detailNext').addEventListener('click', detailNext); +document.getElementById('detailNow').addEventListener('click', detailNow); updateCurrentTime(); updateCalendar(); @@ -1029,4 +1056,7 @@ if (document.readyState === 'loading') { window.navigatePeriod = navigatePeriod; window.goToNow = goToNow; +window.detailPrev = detailPrev; +window.detailNext = detailNext; +window.detailNow = detailNow; })(); diff --git a/style.css b/style.css index ee96ab1..debfe50 100644 --- a/style.css +++ b/style.css @@ -382,6 +382,12 @@ margin-bottom: 10px; } +.detail-nav { + display: flex; + gap: 10px; + align-items: center; +} + .back-btn { background: linear-gradient(45deg, #00ffff, #0080ff); border: none;