When necessities learn “when seen” your mind ought to go straight to IntersectionObserver. That’s precisely what Zach is doing right here to kick off an animation when it scrolls into view.
Besides this animation is an SVG SMIL animation: an <animate> scenario. SMIL animations have some kinda cool issues they’ll do, like start when one other animation ends, which is one thing CSS doesn’t assist with that a lot. Seems SMIL has a JavaScript API as properly, so it’s attainable to kick off the animation on demand that approach, whereas additionally respecting prefers-reduced-motion.
Additionally verify this out:
.querySelectorAll(`:scope [begin=”indefinite”]`);
That :scope factor is new to me.
Direct Hyperlink to Article — Permalink
The put up Fireplace SVG animations (SMIL) when the SVG is seen appeared first on CSS-Methods. You may assist CSS-Methods by being an MVP Supporter.
Subscribe to MarketingSolution.
Receive web development discounts & web design tutorials.
Now! Lets GROW Together!