This commit is contained in:
NotSoToothless
2026-06-07 20:53:30 -07:00
committed by GitHub
parent 28ce4f0541
commit a3776ec038
+56 -13
View File
@@ -45,7 +45,7 @@
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
.timeline-hero { .timeline-hero {
padding-top: 8.5rem; /* clearance below the fixed nav */ padding-top: 9.75rem; /* clearance below the fixed nav (~20px lower on tall screens) */
padding-bottom: 1.75rem; /* JS centering adds the rest of the hero→row1 gap */ padding-bottom: 1.75rem; /* JS centering adds the rest of the hero→row1 gap */
} }
} }
@@ -295,6 +295,38 @@
100% { top: 100%; } 100% { top: 100%; }
} }
/* Full hint (text + animated line) only on tall desktop, where there's
a roomy void below the comet for it to sit in. */
@media (min-width: 1024px) and (min-height: 1081px) {
#scroll-hint { display: flex; }
}
/* Small bouncing arrow for shorter screens (and mobile), tucked just
under the comet's resting area. */
#scroll-arrow {
display: flex;
position: fixed;
bottom: 1.4rem;
left: 50%;
transform: translateX(-50%);
z-index: 50;
color: rgba(144, 238, 144, 0.55);
font-size: 1.05rem;
pointer-events: none;
transition: opacity 0.5s ease;
animation: arrowBounce 1.6s ease-in-out infinite;
}
@media (min-width: 1024px) and (min-height: 1081px) {
#scroll-arrow { display: none; }
}
@keyframes arrowBounce {
0%, 100% { transform: translateX(-50%) translateY(0); }
50% { transform: translateX(-50%) translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
#scroll-arrow { animation: none; }
}
.timeline-node { .timeline-node {
position: relative; position: relative;
z-index: 2; z-index: 2;
@@ -389,11 +421,13 @@
</div> </div>
</section> </section>
<!-- Scroll hint — fades out on first scroll --> <!-- Scroll hints — fade out on first scroll. Full version (tall desktop)
and a compact bouncing arrow (short screens / mobile). -->
<div id="scroll-hint"> <div id="scroll-hint">
<span><%= t('timeline.scroll') %></span> <span><%= t('timeline.scroll') %></span>
<div class="hint-line"></div> <div class="hint-line"></div>
</div> </div>
<div id="scroll-arrow" aria-hidden="true"><i class="fas fa-chevron-down"></i></div>
<!-- Footer --> <!-- Footer -->
<%- include('partials/footer') %> <%- include('partials/footer') %>
@@ -591,7 +625,15 @@
var REVEAL_FRACTION = 0.85; var REVEAL_FRACTION = 0.85;
function frontierProgress() { function frontierProgress() {
if (!pathLength || !_samples) return state.progress; if (!pathLength || !_samples) return state.progress;
var revealY = window.innerHeight * REVEAL_FRACTION - timeline.getBoundingClientRect().top; var tlTop = timeline.getBoundingClientRect().top;
var revealY = window.innerHeight * REVEAL_FRACTION - tlTop;
// The line/comet render behind the opaque cards, so never let the
// comet rest within column 3's card — keep it at least COMET_BAND
// below card 3's bottom (node index 2, the column the line descends).
if (nodes[2]) {
var card3Bottom = nodes[2].getBoundingClientRect().bottom - tlTop;
revealY = Math.max(revealY, card3Bottom + COMET_BAND);
}
var frontierL = 0; var frontierL = 0;
for (var i = 0; i < _samples.length; i++) { for (var i = 0; i < _samples.length; i++) {
if (_samples[i].y <= revealY) frontierL = _samples[i].l; if (_samples[i].y <= revealY) frontierL = _samples[i].l;
@@ -704,8 +746,19 @@
}); });
} }
// Fade both scroll hints out for good on the first scroll (CSS media
// queries decide which one is actually visible per screen size).
function setupScrollHints() {
var hints = [document.getElementById('scroll-hint'),
document.getElementById('scroll-arrow')];
function hide() { hints.forEach(function (h) { if (h) h.style.opacity = '0'; }); }
if (window.scrollY > 8) { hide(); return; }
window.addEventListener('scroll', hide, { once: true, passive: true });
}
function init() { function init() {
build(); build();
setupScrollHints();
if (reduceMotion) { if (reduceMotion) {
drawProgress = 1; drawProgress = 1;
state.progress = 1; state.progress = 1;
@@ -717,16 +770,6 @@
createScrollTriggers(); createScrollTriggers();
ScrollTrigger.refresh(); ScrollTrigger.refresh();
updateFromScroll(); updateFromScroll();
var hint = document.getElementById('scroll-hint');
function hideScrollHint() {
if (!hint) return;
hint.style.opacity = '0';
hint = null;
}
if (window.scrollY > 8) hideScrollHint();
window.addEventListener('scroll', hideScrollHint, { once: true, passive: true });
} else { } else {
advanceTo(1, 0); advanceTo(1, 0);
} }