From ead5d58d21b3dc65e56a035e040b89aef09e88db Mon Sep 17 00:00:00 2001 From: Kiyomichi Kosaka Date: Fri, 20 Jun 2025 08:02:40 +0200 Subject: [PATCH] Fix detail view timeline --- script.js | 10 ++++++++++ style.css | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/script.js b/script.js index 36bffcc..9e8e0e6 100644 --- a/script.js +++ b/script.js @@ -701,6 +701,16 @@ function showEonstripDetail(index, startCob) { timeline.appendChild(block); } + let markerCob = manualMode ? manualCobiets : toCobiets(new Date()); + const rel = (markerCob - startCob) / COBIE_UNITS.eonstrip; + if (rel >= 0 && rel <= 1) { + const line = document.createElement('div'); + line.className = 'current-time-line'; + line.style.top = (rel * 100) + '%'; + line.textContent = formatCobieTimestamp(markerCob); + timeline.appendChild(line); + } + if (Array.isArray(window.SPECIAL_EVENTS)) { const events = []; const start = startCob; diff --git a/style.css b/style.css index e36fd9b..91cacd3 100644 --- a/style.css +++ b/style.css @@ -415,6 +415,20 @@ color: #aaa; font-size: 0.8em; padding-top: 2px; + pointer-events: none; + z-index: 1; +} + +.current-time-line { + position: absolute; + left: -40px; + width: calc(100% + 40px); + border-top: 2px solid #ff00ff; + color: #ff00ff; + font-size: 0.8em; + padding-top: 2px; + pointer-events: none; + z-index: 2; } .event-box, .event-line {