[{"data":1,"prerenderedAt":227},["ShallowReactive",2],{"blogs":3},[4],{"id":5,"title":6,"author":7,"body":25,"date":216,"description":217,"extension":218,"image":219,"meta":220,"minRead":221,"navigation":222,"path":223,"published":222,"seo":224,"stem":225,"__hash__":226},"blog\u002Fblog\u002Fsvg-animation.md","Animating SVG on the web",{"name":8,"description":9,"avatar":10,"to":12,"socials":13},"Oskar","spaghetti chef",{"src":11,"alt":8},"\u002Fblog\u002F_meta\u002Fprofiles\u002Foskar.jpg","https:\u002F\u002Fvaa.ski",[14,17,21],{"name":15,"url":12,"icon":16},"website","material-symbols:link-rounded",{"name":18,"url":19,"icon":20},"email","mailto:noreply@vaa.ski","material-symbols:mail-outline-rounded",{"name":22,"url":23,"icon":24},"github","https:\u002F\u002Fgithub.com\u002Fvaaski","simple-icons:github",{"type":26,"value":27,"toc":212},"minimark",[28,33,37,43,46,49,62,93,101,137,141,171,175,187],[29,30,32],"h1",{"id":31},"the-problem","The Problem",[34,35,36],"p",{},"I wanted to have neat looking vector-based animations for this very site.\nLet's take the header logo as an example for what I'm trying to build.",[38,39,40],"u-card",{},[41,42],"blog-svg-animation-infinite-logo-demo",{},[34,44,45],{},"As you can see, there's a bunch of moving pieces and path transforms.",[34,47,48],{},"And as is the case with mostly everything web-based, there are many ways to approach a problem.\nHere is a quick overview of the avenues that came to my head:",[50,51,53,54,58,59],"h4",{"id":52},"animating-d-property-with-css-keyframes","Animating ",[55,56,57],"code",{},"d"," property with CSS ",[55,60,61],{},"@keyframes",[63,64,65,80],"ul",{},[66,67,68,72],"li",{},[69,70,71],"strong",{},"pros",[63,73,74,77],{},[66,75,76],{},"relatively easy to implement",[66,78,79],{},"works without js",[66,81,82,85],{},[69,83,84],{},"cons",[63,86,87,90],{},[66,88,89],{},"safari doesn't support it",[66,91,92],{},"hard to maintain",[50,94,96,97,100],{"id":95},"svg-animate-element","SVG ",[55,98,99],{},"\u003Canimate>"," element",[63,102,103,125],{},[66,104,105,107],{},[69,106,71],{},[63,108,109,111,114],{},[66,110,79],{},[66,112,113],{},"works on all major browsers",[66,115,116,117,124],{},"works even in github readme (",[118,119,123],"a",{"href":120,"rel":121},"https:\u002F\u002Fgithub.com\u002Fvaaski\u002Fvaaski\u002Fblob\u002Fmain\u002Freadme.md",[122],"nofollow","see example",")",[66,126,127,129],{},[69,128,84],{},[63,130,131,134],{},[66,132,133],{},"super annoying to create",[66,135,136],{},"weirdly hard to find documentation besides the spec",[50,138,140],{"id":139},"lottie-adobe-after-effects","Lottie + Adobe After Effects",[63,142,143,155],{},[66,144,145,147],{},[69,146,71],{},[63,148,149,152],{},[66,150,151],{},"easiest to implement; AE is a professional tool",[66,153,154],{},"can handle complex animations with many layers",[66,156,157,159],{},[69,158,84],{},[63,160,161,168],{},[66,162,163,164,167],{},"AE is paid ",[69,165,166],{},"Adobe"," software",[66,169,170],{},"only works with js, has an impact on bundle size",[50,172,174],{"id":173},"using-a-library-in-js","Using a library in JS",[34,176,177],{},[178,179,180,181,186],"em",{},"My preferred pick for this is ",[118,182,185],{"href":183,"rel":184},"https:\u002F\u002Fanimejs.com",[122],"anime.js",". I know GSAP went free recently, but the couple of minutes I spent looking at it made it feel comparatively clunky and old. Also the anime.js documentation is just super pretty to look at.",[63,188,189,201],{},[66,190,191,193],{},[69,192,71],{},[63,194,195,198],{},[66,196,197],{},"relatively easy to implement; can handle path transformations automatically",[66,199,200],{},"can orchestrate and sync with other animations",[66,202,203,205],{},[69,204,84],{},[63,206,207,209],{},[66,208,170],{},[66,210,211],{},"said path transforms can sometimes look weird if not carefully crafted",{"title":213,"searchDepth":214,"depth":214,"links":215},"",2,[],"2026-08-05","so you want buttery smooth vector-based animations that work everywhere and are easy to create? haha good luck dumbass","md","\u002Fblog\u002F_meta\u002Fhero-placeholder-image.png",{},69,true,"\u002Fblog\u002Fsvg-animation",{"title":6,"description":217},"blog\u002Fsvg-animation","m3GY2kog6Np96IDvwYGFdC8kVxaS0BUbf7lfsdjz9pg",1786208816789]