Skip to content

Commit ba4f0d1

Browse files
committed
fix: header of earth story page
1 parent 3738b32 commit ba4f0d1

4 files changed

Lines changed: 37 additions & 5 deletions

File tree

docs/country_overview.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ <h1 style="color: var(--text-mid);">No country selected</h1>
386386
}
387387
}
388388

389-
function animate(ts) {
389+
const FRAME_MS = 1000 / 30;
390+
let lastFrame = 0;
391+
392+
function drawFrame(ts) {
390393
ctx.fillStyle = bgGrad;
391394
ctx.fillRect(0, 0, w, h);
392395

@@ -405,7 +408,13 @@ <h1 style="color: var(--text-mid);">No country selected</h1>
405408

406409
ctx.fillStyle = vigGrad;
407410
ctx.fillRect(0, 0, w, h);
411+
}
408412

413+
function animate(ts) {
414+
if (ts - lastFrame >= FRAME_MS) {
415+
lastFrame = ts;
416+
drawFrame(ts);
417+
}
409418
animId = requestAnimationFrame(animate);
410419
}
411420

docs/css/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,15 @@ button {
450450
white-space: nowrap;
451451
}
452452

453+
.breadcrumb a {
454+
color: rgba(255, 255, 255, 0.6);
455+
text-decoration: none;
456+
}
457+
458+
.breadcrumb a:hover {
459+
color: rgba(255, 255, 255, 0.9);
460+
}
461+
453462
.breadcrumb .sep {
454463
margin: 0 10px;
455464
opacity: 0.5;

docs/earth_story.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
<a href="curators.html"><span class="brand-earth">Earth</span> Natural Disaster Museum<span class="brand-dim"> · est. 2026</span></a>
1818
</div>
1919
<nav class="breadcrumb" id="top-breadcrumb">
20-
<a class="crumb crumb-link back-to-globe" href="globe.html">The Globe: Earth</a>
20+
<a class="back-to-globe" href="globe.html">The Globe: Earth</a>
2121
<span class="sep">/</span>
22-
<span class="crumb">Earth Story</span>
22+
<span>Earth Story</span>
2323
</nav>
24-
<div class="top-bar-action" id="top-bar-action"></div>
24+
<a class="pill-btn back-to-globe" href="globe.html">
25+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
26+
<path d="M10 8H2M2 8L6 4M2 8L6 12" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
27+
</svg>
28+
Return to Globe
29+
</a>
2530
</header>
2631

2732
<!-- Sticky 3D globe: stays put while the chapters scroll over it -->

docs/globe.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ <h2 id="earthStoryCardTitle">Earth Story</h2>
182182
}
183183
}
184184

185-
function animate(ts) {
185+
const FRAME_MS = 1000 / 30; /* 30 fps cap */
186+
let lastFrame = 0;
187+
188+
function drawFrame(ts) {
186189
ctx.fillStyle = '#0C1116';
187190
ctx.fillRect(0, 0, w, h);
188191

@@ -201,7 +204,13 @@ <h2 id="earthStoryCardTitle">Earth Story</h2>
201204

202205
ctx.fillStyle = vigGrad;
203206
ctx.fillRect(0, 0, w, h);
207+
}
204208

209+
function animate(ts) {
210+
if (ts - lastFrame >= FRAME_MS) {
211+
lastFrame = ts;
212+
drawFrame(ts);
213+
}
205214
animId = requestAnimationFrame(animate);
206215
}
207216

0 commit comments

Comments
 (0)