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: home previews keep their 3D

matin66909995cfeb
diff --git a/index.html b/index.html
index 7dbcafc3..ef916e99 100644
--- a/index.html
+++ b/index.html
@@ -333,7 +333,8 @@ button,input{font:inherit;color:inherit}
}
/* ── preview library ── */
-.pv *{will-change:transform,opacity}
+/* The hint names the transform only: opacity in will-change flattens CSS 3D in Chrome (a cube draws as one flat face) */
+.pv *{will-change:transform}
.card:not(.playing) .pv .anim,.card:not(.playing) .pv .anim::before,.card:not(.playing) .pv .anim::after{animation-play-state:paused!important}
/* signature: 01 scroll */
@@ -365,12 +366,12 @@ button,input{font:inherit;color:inherit}
.pv-sig5 .s5:nth-child(1){--w:.95}.pv-sig5 .s5:nth-child(2){--w:.7;animation-delay:.15s}.pv-sig5 .s5:nth-child(3){--w:.45;animation-delay:.3s}
@keyframes s5type{0%{transform:scaleX(0)}45%,100%{transform:scaleX(var(--w,1))}}
/* signature: 06 3d cube */
-.pv-sig6{background:#070709;display:grid;place-items:center;perspective:420px}
-.pv-sig6 .cube{position:relative;width:66px;height:66px;transform-style:preserve-3d;animation:s6spin 9s linear infinite}
+.pv-sig6{background:#070709;display:grid;place-items:center;perspective:420px;container-type:size}
+.pv-sig6 .cube{--h:min(33px,19cqh);position:relative;top:5cqh;width:calc(var(--h) * 2);height:calc(var(--h) * 2);transform-style:preserve-3d;animation:s6spin 9s linear infinite} /* smaller on a small card and a little low, as 3D Model Orbit's */
.pv-sig6 .face{position:absolute;inset:0;border:1px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}
-.pv-sig6 .f1{transform:translateZ(33px)}.pv-sig6 .f2{transform:rotateY(180deg) translateZ(33px)}
-.pv-sig6 .f3{transform:rotateY(90deg) translateZ(33px)}.pv-sig6 .f4{transform:rotateY(-90deg) translateZ(33px)}
-.pv-sig6 .f5{transform:rotateX(90deg) translateZ(33px)}.pv-sig6 .f6{transform:rotateX(-90deg) translateZ(33px)}
+.pv-sig6 .f1{transform:translateZ(var(--h))}.pv-sig6 .f2{transform:rotateY(180deg) translateZ(var(--h))}
+.pv-sig6 .f3{transform:rotateY(90deg) translateZ(var(--h))}.pv-sig6 .f4{transform:rotateY(-90deg) translateZ(var(--h))}
+.pv-sig6 .f5{transform:rotateX(90deg) translateZ(var(--h))}.pv-sig6 .f6{transform:rotateX(-90deg) translateZ(var(--h))}
@keyframes s6spin{0%{transform:rotateX(-22deg) rotateY(0)}100%{transform:rotateX(-22deg) rotateY(360deg)}}
/* signature: 07 ambient drift */
.pv-sig7{background:#08090c;overflow:hidden}
@@ -919,10 +920,11 @@ button,input{font:inherit;color:inherit}
@keyframes t-hand{0%,6%{stroke-dashoffset:1;opacity:1}62%,86%{stroke-dashoffset:0;opacity:1}96%{stroke-dashoffset:0;opacity:0}100%{stroke-dashoffset:1;opacity:0}}
/* ── bespoke: 06 3D & Advanced ── */
-.pv-orbit3d{background:#05080a;display:grid;place-items:center;perspective:460px}
-.pv-orbit3d .cube{position:relative;width:60px;height:60px;transform-style:preserve-3d;animation:d-orbit 7s linear infinite}
+/* the cube's half side --h: 30px, smaller on a small card, and the cube a little low, so it turns clear of the place label (1cqh is 1% of the stage's height) */
+.pv-orbit3d{background:#05080a;display:grid;place-items:center;perspective:460px;container-type:size}
+.pv-orbit3d .cube{--h:min(30px,18cqh);position:relative;top:5cqh;width:calc(var(--h) * 2);height:calc(var(--h) * 2);transform-style:preserve-3d;animation:d-orbit 7s linear infinite}
.pv-orbit3d .face{position:absolute;inset:0;background:color-mix(in srgb,var(--accent) 26%,#0a1412);border:1px solid color-mix(in srgb,var(--accent) 60%,transparent)}
-.pv-orbit3d .f1{transform:translateZ(30px)}.pv-orbit3d .f2{transform:rotateY(180deg) translateZ(30px)}.pv-orbit3d .f3{transform:rotateY(90deg) translateZ(30px)}.pv-orbit3d .f4{transform:rotateY(-90deg) translateZ(30px)}.pv-orbit3d .f5{transform:rotateX(90deg) translateZ(30px)}.pv-orbit3d .f6{transform:rotateX(-90deg) translateZ(30px)}
+.pv-orbit3d .f1{transform:translateZ(var(--h))}.pv-orbit3d .f2{transform:rotateY(180deg) translateZ(var(--h))}.pv-orbit3d .f3{transform:rotateY(90deg) translateZ(var(--h))}.pv-orbit3d .f4{transform:rotateY(-90deg) translateZ(var(--h))}.pv-orbit3d .f5{transform:rotateX(90deg) translateZ(var(--h))}.pv-orbit3d .f6{transform:rotateX(-90deg) translateZ(var(--h))}
@keyframes d-orbit{0%{transform:rotateX(-25deg) rotateY(0)}100%{transform:rotateX(-25deg) rotateY(360deg)}}
.pv-cube3d{background:#05080a;display:grid;place-items:center;perspective:500px}
.pv-cube3d .card3d{width:50%;height:54%;border-radius:6px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 30%,#0a1412),#0a1412);border:1px solid color-mix(in srgb,var(--accent) 50%,transparent);animation:d-cube3d 5s var(--ease) infinite}
@@ -986,10 +988,8 @@ button,input{font:inherit;color:inherit}
.pv-smoke .s2{left:44%;animation:d-smoke 7s ease-in infinite -2s}
.pv-smoke .s3{left:30%;animation:d-smoke 8s ease-in infinite -4s}
@keyframes d-smoke{0%{transform:translateY(0) scale(.6);opacity:0}30%{opacity:.5}100%{transform:translateY(-170%) scale(1.4);opacity:0}}
-/* six cards in a ring (1cqw is 1% of the stage's width), seen a little from above, that turn one card at a time. The previews'
- will-change hint names opacity, which flattens 3D in Chrome, so here it names the transform only. */
+/* six cards in a ring (1cqw is 1% of the stage's width), seen a little from above, that turn one card at a time */
.pv-carousel3d{background:radial-gradient(120% 90% at 50% 10%,#17131f,#08070a);container-type:size}
-.pv-carousel3d *{will-change:transform}
.pv-carousel3d .sc{position:absolute;inset:0;display:grid;place-items:center;perspective:100cqw}
.pv-carousel3d .tl,.pv-carousel3d .rg,.pv-carousel3d .rg i{transform-style:preserve-3d}
.pv-carousel3d .tl{transform:translateZ(-21.3cqw) translateY(1cqw) rotateX(-14deg)}