While you should generally use CSS for transitions as much as possible, there are some effects that can't be achieved without JavaScript, such as a typewriter effect:
functiontypewriter(node, { speed =1 }) {constvalid= (node.childNodes.length===1&&node.childNodes[0].nodeType ===Node.TEXT_NODE );if (!valid) {thrownewError(`This transition only works on elements with a single text node child`); }consttext=node.textContent;constduration=text.length/ (speed *0.01);return { duration,tick: t => {consti=Math.trunc(text.length* t);node.textContent =text.slice(0, i); } };}