Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create an on-scroll animation trigger using IntersectionObserver with Tailwind-friendly animation classes and keyframes. Use when asked for scroll-reveal, animate-on-scroll, or sequencing element animations when they enter the viewport.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 2% | 0% |
<head> after the keyframes.animate-on-scroll to elements.html<script> /* Sequence animation on scroll when visible. Requires Animation Keyframe. Usage: 1) Insert this code in the <head> along with the Animation Keyframe code. 2) Add to Tailwind Classes: [animation:animationIn_0.8s_ease-out_0.1s_both] animate-on-scroll */ (function () { // Inject CSS for paused/running states const style = document.createElement("style"); style.textContent = ` /* Default: paused */ .animate-on-scroll { animation-play-state: paused !important; } /* Activated by JS */ .animate-on-scroll.animate { animation-play-state: running !important; } `; document.head.appendChild(style); const once = true; if (!window.__inViewIO) { window.__inViewIO = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add("animate"); if (once) window.__inViewIO.unobserve(entry.target); } }); }, { threshold: 0.2, rootMargin: "0px 0px -10% 0px" }); } window.initInViewAnimations = function (selector = ".animate-on-scroll") { document.querySelectorAll(selector).forEach((el) => { window.__inViewIO.observe(el); // observing twice is a no-op }); }; document.addEventListener("DOMContentLoaded", () => initInViewAnimations()); })(); </script>
html<style> /* Sequence animation intro. Usage: 1) Insert this code in the <head> 2) Add to Tailwind Classes: [animation:animationIn_0.8s_ease-out_0.1s_both] */ @keyframes animationIn { 0% { opacity: 0; transform: translateY(30px); filter: blur(8px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0px); } } </style>
html<div class="animate-on-scroll [animation:animationIn_0.8s_ease-out_0.1s_both]"> ... </div>
threshold and rootMargin for earlier/later reveals.once = false to allow replays when re-entering.translateY and blur in keyframes.Other measured skills in the registry, with their headline benchmark lift.