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: 2.5D / Pseudo-3D: Compare's arrows stay inside their own half during a run at Large on phones

matine2c04c957a41
diff --git a/animations/06-3d-advanced/2-5d-pseudo-3d/index.html b/animations/06-3d-advanced/2-5d-pseudo-3d/index.html
index bad45b74..e196f8a1 100644
--- a/animations/06-3d-advanced/2-5d-pseudo-3d/index.html
+++ b/animations/06-3d-advanced/2-5d-pseudo-3d/index.html
@@ -452,7 +452,7 @@
for(let i=0;i<twinLayers.length;i++)twinLayers[i].style.transform=t;
const hw=stage.clientWidth/2;
for(let n=0;n<arrows.length;n++){
- const a=arrows[n],v=-nx*strength*(a.half?a.layer.depth:SHARE)*3,s=v<0?-1:1,x=a.half*hw+(s<0?hw-10:10),w=Math.min(7,Math.abs(v)/2.2);
+ const a=arrows[n],v=Math.max(20-hw,Math.min(hw-20,-nx*strength*(a.half?a.layer.depth:SHARE)*3)),s=v<0?-1:1,x=a.half*hw+(s<0?hw-10:10),w=Math.min(7,Math.abs(v)/2.2);
const d=`M${x} ${a.y}L${x+v} ${a.y}`+(Math.abs(v)>=8?`M${x+v-s*w} ${a.y-w*.7}L${x+v} ${a.y}L${x+v-s*w} ${a.y+w*.7}`:'');
a.out.setAttribute('d',d);a.inn.setAttribute('d',d);
}