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: FLIP Technique: the cards drop and take their layer again at the end of each glide, so a card at rest is drawn the same after a run as before it (the page check's screenshot during the run on arrival no longer leaves a different rest picture); Normal's pixels are unchanged

matin976f9fa7cca7
diff --git a/animations/03-page-transitions/flip-technique/index.html b/animations/03-page-transitions/flip-technique/index.html
index 8f160f8a..37cd68a3 100644
--- a/animations/03-page-transitions/flip-technique/index.html
+++ b/animations/03-page-transitions/flip-technique/index.html
@@ -265,7 +265,7 @@
function settle(){
timers.forEach(clearTimeout);timers=[];wayBack=0;afterMove=null;
grid.style.minHeight='';
- grid.querySelectorAll('.flip-card').forEach(c=>{c.style.transition='';c.style.transform='';c.getAnimations().forEach(a=>a.cancel())});
+ grid.querySelectorAll('.flip-card').forEach(c=>{c.style.transition='';c.style.transform='';c.style.willChange='';c.getAnimations().forEach(a=>a.cancel())});
animating=false;
}
@@ -304,8 +304,10 @@
cards.forEach(c=>{c.style.transition=`transform ${d}ms ${curve}`;c.style.transform=''});
later(()=>{
grid.style.minHeight='';
- cards.forEach(c=>{c.style.transition=''});
+ cards.forEach(c=>{c.style.transition='';c.style.willChange='auto'});
finish();
+ // The cards drop their layer for a moment and take it again, so a card at rest is drawn as a new one is, whatever happened while it glided
+ setTimeout(()=>cards.forEach(c=>{c.style.willChange=''}),50);
},d+50);
}