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: Stacking Cards: on phones See inside's labels wrap into a narrow right column and the card text leaves that column free

Claudeee867418a915
diff --git a/animations/01-scroll-based/stacking-cards/index.html b/animations/01-scroll-based/stacking-cards/index.html
index f53e54d1..2b2014a2 100644
--- a/animations/01-scroll-based/stacking-cards/index.html
+++ b/animations/01-scroll-based/stacking-cards/index.html
@@ -112,6 +112,14 @@
.stage[data-hb-mode="compare"] .cap.cmp-a,.stage[data-hb-mode="compare"] .cap.cmp-b,.stage[data-hb-mode="compare"] .mid{display:block}
.stage[data-hb-mode="inside"] .card.covered::after{content:"";position:absolute;left:0;right:0;bottom:0;top:calc(var(--index0) * var(--peek));
z-index:-1;border:2px dashed rgba(255,210,122,.95);border-radius:16px;background:rgba(255,210,122,.3);pointer-events:none}
+ /* Phones: the cards' text runs the full width, so the two labels wrap into a narrow column at the right and See inside
+ leaves that column free of text */
+ @media(max-width:600px){
+ .stage[data-hb-mode="inside"] .cap{white-space:normal;width:116px;text-align:center;padding:4px 6px;border-radius:14px;line-height:1.15}
+ .stage[data-hb-mode="inside"] .in-b{top:calc((var(--n) - 1) * var(--peek) + 8px)}
+ .stage[data-hb-mode="inside"] .in-a{top:calc((var(--n) - 1) * var(--peek) + 54px)}
+ .stage[data-hb-mode="inside"] .card__text{padding-right:130px}
+ }
.stage[data-hb-mode="compare"] .copy{display:flex}
.stage[data-hb-mode="compare"] #cards{margin-left:50%}
/* Reduced motion: nothing shrinks, so each covered card shows an inner outline of the size it would shrink to */