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: keep the space visible between words in Letter-by-Letter Stagger

matinca70291d6dce
diff --git a/animations/02-entrance-and-exit/letter-by-letter-stagger/index.html b/animations/02-entrance-and-exit/letter-by-letter-stagger/index.html
index 31f63854..d59e1d1d 100644
--- a/animations/02-entrance-and-exit/letter-by-letter-stagger/index.html
+++ b/animations/02-entrance-and-exit/letter-by-letter-stagger/index.html
@@ -194,7 +194,7 @@
[...text].forEach((c,i)=>{
const s=document.createElement('span');
s.className='char';s.style.setProperty('--i',i);
- s.textContent=c===' '?' ':c;
+ s.textContent=c===' '?'\u00a0':c; // a lone plain space would collapse inside its inline-block
target.appendChild(s);
});
if(mode==='typewriter'&&cursorTog.checked){