Skip to content

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.

fix: Pin Animation: scroll anchoring off in Compare so the box never bounces, half names drawn without a backing

Claude3636175f9189
diff --git a/animations/01-scroll-based/pin-animation/index.html b/animations/01-scroll-based/pin-animation/index.html
index b88f0a89..3dddeb73 100644
--- a/animations/01-scroll-based/pin-animation/index.html
+++ b/animations/01-scroll-based/pin-animation/index.html
@@ -72,6 +72,8 @@
@media(max-width:600px){.stage[data-hb-mode="inside"] .intro,.stage[data-hb-mode="inside"] .outro,.stage[data-hb-mode="inside"] .pin-inner{padding-bottom:72px}}
/* Compare: the section becomes two columns. On the left a copy of the frame that is not sticky, so it leaves with the
page; on the right the page's own frame, still sticky in its column. The intro and the outro are untouched. */
+ /* The copy's title changes height, which scroll anchoring would answer by moving the box: it stays off in Compare */
+ .stage[data-hb-mode="compare"]{overflow-anchor:none}
.stage[data-hb-mode="compare"] .pin-section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
.stage[data-hb-mode="compare"] .pin-section::after{content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:rgba(255,255,255,.45)}
.stage[data-hb-mode="compare"] .pin-inner{align-self:start;flex-direction:column;gap:10px;padding:12px;text-align:center;min-width:0}
@@ -81,7 +83,7 @@
.stage[data-hb-mode="compare"] .feat-desc{display:none}
.stage[data-hb-mode="compare"] .feat-title{font-size:clamp(14px,2vw,18px);margin-bottom:0}
.stage[data-hb-mode="compare"] .feat-num{margin-bottom:6px}
- .stage[data-hb-mode="compare"] .name{display:block;position:absolute;top:8px;padding:5px 10px;border-radius:999px;background:rgba(11,11,13,.86);
+ .stage[data-hb-mode="compare"] .name{display:block;position:absolute;top:8px;padding:5px 10px;
color:#f4f4f2;font:600 13px/1.2 var(--hb-font);white-space:nowrap}
.n1{left:8px}.n2{left:calc(50% + 8px)}
.gone svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}