mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-23 17:40:32 +08:00
perf(hero): pause animations when hero scrolls out of view
Uses IntersectionObserver to toggle an .offscreen class on the hero element, which sets animation-play-state: paused on the sheen, noise, and scroll-cue animations. Avoids unnecessary GPU work while the hero is not visible. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,12 @@ kbd {
|
||||
animation: sheen-drift 18s linear infinite;
|
||||
}
|
||||
|
||||
.hero.offscreen .hero-sheen,
|
||||
.hero.offscreen .hero-noise,
|
||||
.hero.offscreen .hero-scrollcue::after {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
.hero-noise {
|
||||
opacity: 0.1;
|
||||
background-image:
|
||||
|
||||
Reference in New Issue
Block a user