mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-20 06:40:51 +00:00
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:
parent
d4a49e5f88
commit
82320c9d23
6 changed files with 2 additions and 37 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue