Spaces:
Running
Running
Upload 301 files
Browse files- index.html +41 -3
index.html
CHANGED
|
@@ -77,7 +77,7 @@ footer{background:#000;color:#a99b84;text-align:center;padding:3rem 1rem;font-fa
|
|
| 77 |
</head>
|
| 78 |
<body>
|
| 79 |
<header class="hero" id="top">
|
| 80 |
-
<video id="heroVideo" autoplay muted
|
| 81 |
<div class="cover-border"></div>
|
| 82 |
<div class="hero-content">
|
| 83 |
<div class="kicker">Public Review Copy 路 Plate A-00 路 Source Preserved</div>
|
|
@@ -90,7 +90,7 @@ footer{background:#000;color:#a99b84;text-align:center;padding:3rem 1rem;font-fa
|
|
| 90 |
<a href="#integrity" class="btn">Integrity Register</a>
|
| 91 |
</div>
|
| 92 |
</div>
|
| 93 |
-
<button class="sound" id="soundBtn">SOUND OFF</button>
|
| 94 |
</header>
|
| 95 |
|
| 96 |
<section class="signal" id="signal">
|
|
@@ -184,6 +184,44 @@ function renderRows(){
|
|
| 184 |
function setCategory(cat){ document.getElementById('categoryFilter').value=cat; renderRows(); }
|
| 185 |
document.getElementById('search').addEventListener('input',renderRows); document.getElementById('statusFilter').addEventListener('change',renderRows); document.getElementById('categoryFilter').addEventListener('change',renderRows); renderRows();
|
| 186 |
const vid=document.getElementById('heroVideo'), snd=document.getElementById('soundBtn');
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
</script>
|
| 189 |
</body></html>
|
|
|
|
| 77 |
</head>
|
| 78 |
<body>
|
| 79 |
<header class="hero" id="top">
|
| 80 |
+
<video id="heroVideo" autoplay muted playsinline preload="auto" data-stop-at="9.85" poster="assets/hir-opening-poster.jpg"><source src="assets/hir-opening.mp4" type="video/mp4"></video>
|
| 81 |
<div class="cover-border"></div>
|
| 82 |
<div class="hero-content">
|
| 83 |
<div class="kicker">Public Review Copy 路 Plate A-00 路 Source Preserved</div>
|
|
|
|
| 90 |
<a href="#integrity" class="btn">Integrity Register</a>
|
| 91 |
</div>
|
| 92 |
</div>
|
| 93 |
+
<button class="sound" id="soundBtn" type="button" aria-pressed="false" title="Toggle hero video sound">SOUND: OFF</button>
|
| 94 |
</header>
|
| 95 |
|
| 96 |
<section class="signal" id="signal">
|
|
|
|
| 184 |
function setCategory(cat){ document.getElementById('categoryFilter').value=cat; renderRows(); }
|
| 185 |
document.getElementById('search').addEventListener('input',renderRows); document.getElementById('statusFilter').addEventListener('change',renderRows); document.getElementById('categoryFilter').addEventListener('change',renderRows); renderRows();
|
| 186 |
const vid=document.getElementById('heroVideo'), snd=document.getElementById('soundBtn');
|
| 187 |
+
const HERO_STOP_AT = parseFloat(vid?.dataset?.stopAt || '9.85');
|
| 188 |
+
if (vid) {
|
| 189 |
+
vid.loop = false;
|
| 190 |
+
vid.volume = 1;
|
| 191 |
+
vid.addEventListener('loadedmetadata', () => {
|
| 192 |
+
vid.loop = false;
|
| 193 |
+
if (Number.isFinite(HERO_STOP_AT) && vid.duration && HERO_STOP_AT >= vid.duration) {
|
| 194 |
+
vid.dataset.stopAt = Math.max(0, vid.duration - 0.35).toFixed(2);
|
| 195 |
+
}
|
| 196 |
+
});
|
| 197 |
+
vid.addEventListener('timeupdate', () => {
|
| 198 |
+
const stopAt = parseFloat(vid.dataset.stopAt || HERO_STOP_AT);
|
| 199 |
+
if (!vid.dataset.stopped && Number.isFinite(stopAt) && vid.currentTime >= stopAt) {
|
| 200 |
+
vid.dataset.stopped = 'true';
|
| 201 |
+
vid.pause();
|
| 202 |
+
try { vid.currentTime = stopAt; } catch (e) {}
|
| 203 |
+
}
|
| 204 |
+
});
|
| 205 |
+
vid.addEventListener('ended', () => { vid.dataset.stopped = 'true'; });
|
| 206 |
+
}
|
| 207 |
+
function setSoundLabel(){
|
| 208 |
+
const on = vid && !vid.muted;
|
| 209 |
+
snd.textContent = on ? 'SOUND: ON' : 'SOUND: OFF';
|
| 210 |
+
snd.setAttribute('aria-pressed', on ? 'true' : 'false');
|
| 211 |
+
}
|
| 212 |
+
if (snd && vid) {
|
| 213 |
+
setSoundLabel();
|
| 214 |
+
snd.addEventListener('click', async () => {
|
| 215 |
+
const turningOn = vid.muted;
|
| 216 |
+
vid.muted = !turningOn;
|
| 217 |
+
if (turningOn && (vid.dataset.stopped === 'true' || vid.paused)) {
|
| 218 |
+
vid.dataset.stopped = '';
|
| 219 |
+
try { vid.currentTime = 0; } catch (e) {}
|
| 220 |
+
try { await vid.play(); } catch (e) {}
|
| 221 |
+
}
|
| 222 |
+
setSoundLabel();
|
| 223 |
+
});
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
</script>
|
| 227 |
</body></html>
|