176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
fix: stage.scrollTop in watermark, binary snap in slider/toggle handlers, remove dead clamp
matinec0e3850a0d6
diff --git a/animations/01-scroll-based/cover-card-to-fixed-header/index.html b/animations/01-scroll-based/cover-card-to-fixed-header/index.htmlindex 9a42b3fd..9803266a 100644--- a/animations/01-scroll-based/cover-card-to-fixed-header/index.html+++ b/animations/01-scroll-based/cover-card-to-fixed-header/index.html@@ -41,7 +41,7 @@.cover-inner{position:relative;z-index:1;display:flex;flex-direction:column;height:100%;padding:0 24px 20px}.cover-spacer{flex:1}.cover-meta{font-size:10px;color:#3d7a52;letter-spacing:1px;text-transform:uppercase;margin-bottom:8px}- .cover-title{font-size:clamp(18px,4vw,26px);color:#d1f7d6;line-height:1.2;letter-spacing:-.5px;margin-bottom:8px}+ .cover-title{font-size:26px;color:#d1f7d6;line-height:1.2;letter-spacing:-.5px;margin-bottom:8px}.cover-sub{font-size:12px;color:#3d7a52;line-height:1.5;margin-bottom:14px;}@@ -128,7 +128,7 @@<div class="cover" id="cover"><div class="cover-bg" id="cover-bg"></div><div class="cover-code" aria-hidden="true">- const p = scrollY / RANGE;<br>+ const p = stage.scrollTop / RANGE;<br>const e = easeOutCubic(p);<br>height = lerp(530, 56, e);</div>@@ -264,7 +264,7 @@colSlider.addEventListener('input', () => {manual = true;const p = colSlider.value / 100;- const rawE = ease(p);+ const rawE = binaryTog.checked ? (p > 0.5 ? 1 : 0) : ease(p);colVal.textContent = colSlider.value + '%';collapseProg.textContent = Math.round(rawE * 100) + '%';apply(rawE);@@ -277,8 +277,10 @@});binaryTog.addEventListener('change', () => {- if (manual) apply(ease(colSlider.value / 100));- else update();+ if (manual) {+ const p = colSlider.value / 100;+ apply(binaryTog.checked ? (p > 0.5 ? 1 : 0) : ease(p));+ } else update();});resetBtn.addEventListener('click', () => {