fix: remove animated sheen from hero background

On narrow phone heroes the sheen, a diagonal light stripe sliding across for 54s after load, rendered as a near-vertical band sweeping sideways that read as a loading or progress bar.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen 2026-10-21 19:57:47 +08:00
parent d4a49e5f88
commit 82320c9d23
No known key found for this signature in database
GPG key ID: B93DE4F003C33630
6 changed files with 2 additions and 37 deletions

View file

@ -78,16 +78,6 @@ if (window.location.hash === "#library-index") {
);
}
// Pause hero animations when scrolled out of view
(function () {
const hero = document.querySelector(".hero");
if (!hero || !("IntersectionObserver" in window)) return;
const observer = new IntersectionObserver(function (entries) {
hero.classList.toggle("offscreen", !entries[0].isIntersecting);
});
observer.observe(hero);
})();
function relativeTime(isoStr) {
const date = new Date(isoStr);
const now = new Date();

View file

@ -177,25 +177,12 @@ kbd {
pointer-events: none;
}
.hero-sheen,
.hero-noise {
position: absolute;
inset: 0;
pointer-events: none;
}
.hero-sheen {
background:
linear-gradient(118deg, transparent 35%, oklch(100% 0 0 / 0.09) 49%, transparent 63%);
transform: translateX(-30%);
animation: sheen-drift 18s linear 3;
}
.hero.offscreen .hero-sheen,
.hero.offscreen .hero-noise {
animation-play-state: paused;
}
.hero-noise {
opacity: 0.1;
background-image:
@ -1725,15 +1712,6 @@ th[data-sort].sort-asc::after {
}
}
@keyframes sheen-drift {
from {
transform: translateX(-30%);
}
to {
transform: translateX(35%);
}
}
@media (max-width: 960px) {
.hero-shell {
padding-bottom: 2rem;

View file

@ -8,7 +8,6 @@
{% endblock %}
{% block header %}
<header class="category-hero">
<div class="hero-sheen" aria-hidden="true"></div>
<div class="hero-noise" aria-hidden="true"></div>
<div class="category-hero-shell">

View file

@ -4,7 +4,6 @@
{% endblock %}
{% block header %}
<header class="hero">
<div class="hero-sheen" aria-hidden="true"></div>
<div class="hero-noise" aria-hidden="true"></div>
<div class="hero-shell">

View file

@ -8,7 +8,6 @@
{% endblock %}
{% block header %}
<header class="category-hero sponsorship-hero">
<div class="hero-sheen" aria-hidden="true"></div>
<div class="hero-noise" aria-hidden="true"></div>
<div class="category-hero-shell">