Creating .lottie
After following the installation steps for dotlottie-js, you can start creating your own .lotties:
async function createDotLottie() {
const dotLottie = new DotLottie();
// build dotLottie
await dotLottie
.addAnimation({
id: 'dog_animation',
url: 'https://my_dog_animation.json',
loop: true,
autoplay: true
})
.addAnimation({
id: 'cat_animation',
url: 'https://my_cat_animation.json',
loop: true,
autoplay: true,
direction: -1,
playMode: 'bounce'
})
.build()
// download dotLottie
await dotlottie.download('my_animation.lottie');
}
Last modified 2mo ago