Fireplace SVG animations (SMIL) when the SVG is seen

No Comments

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 ArticlePermalink

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.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment