Lottie JSON Vector State Machine.
Lightweight JSON vector animation runtime with interactive frame scrubbing and marker event triggers.
View code
<script src="https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/build/player/lottie.min.js"></script>
<div class="lottie" role="img" aria-label="A looping vector rosette"></div>:root { color-scheme: dark; font: 15px system-ui, sans-serif; color: #dbff55; }
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; display: grid; place-items: center; overflow: hidden; background: transparent; }
.tile { display: grid; place-items: center; width: 68px; aspect-ratio: 1; border-radius: 18px; background: currentColor; }
.tile { background: #dbff55; color: #202415; font-size: 30px; }
canvas { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
button { font: inherit; color: #f3f1e9; background: #191919; border: 1px solid #ffffff66; padding: 8px 14px; border-radius: 24px; cursor: pointer; }
:focus-visible { outline: 2px solid #dbff55; outline-offset: -3px; }
.notice { max-width: 34ch; padding: 16px; color: #fff; }
@media (prefers-reduced-motion: reduce) { .sprite { animation-play-state: paused; } }
.lottie { width: min(70vw, 60vh); aspect-ratio: 1; }const scalar = k => ({a:0,k});
const animated = (from,to) => ({a:1,k:[
{t:0,s:[from],i:{x:[.6],y:[1]},o:{x:[.4],y:[0]}}, {t:90,s:[to]}
]});
const animationData = {
v:'5.12.0',fr:30,ip:0,op:90,w:200,h:200,nm:'Motion rosette',assets:[],
layers:[{
ty:4,ind:1,ip:0,op:90,st:0,sr:1,
ks:{o:scalar(100),r:animated(0,360),p:scalar([100,100,0]),a:scalar([0,0,0]),s:scalar([100,100,100])},
shapes:Array.from({length:8},(_,i)=>{
const angle=i*Math.PI/4;
return {ty:'gr',it:[
{ty:'el',d:1,p:scalar([0,0]),s:scalar([54,54])},
{ty:'st',c:scalar([.65,.83,1,1]),o:scalar(100),w:scalar(3),lc:2,lj:2},
{ty:'tr',p:scalar([49*Math.cos(angle),49*Math.sin(angle)]),a:scalar([0,0]),s:scalar([100,100]),r:scalar(0),o:scalar(100),sk:scalar(0),sa:scalar(0)}
]};
})
}]
};
const player = lottie.loadAnimation({
container:document.querySelector('.lottie'), renderer:'svg', loop:true,
autoplay:!new URLSearchParams(location.search).has('embed') && !matchMedia('(prefers-reduced-motion: reduce)').matches,
animationData
});
addEventListener('message',event=>{
if (event.source !== parent || event.origin !== location.origin || event.data?.type !== 'motion-play') return;
if (event.data.active) player.play();
else player.pause();
});