<div class="first-section">
<h1 style="text-align: center">Toggle animation</h1>
</div>
<div style="width: 30%; height: 30%; justify-content: center; align-items: center; margin: auto">
<lottie-player
id="firstLottie"
src="https://assets8.lottiefiles.com/private_files/lf30_tnblylie.json"
style="border-color: red; border-style: solid; border-width: 5px"
>
</lottie-player>
</div>
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap');
.first-section {
background-color: white;
}
.second-section {
height: 100vh;
width: 100%;
background-color: white;
}
.third-section {
height: 100vh;
width: 100%;
background-color: white;
}
h1 {
font-family: 'Roboto Mono', monospace;
}
.my-font {
font-family: 'Roboto Mono', monospace;
}
let player = document.getElementById("firstLottie");
player.addEventListener("ready", () => {
LottieInteractivity.create({
player: "#firstLottie",
mode:"cursor",
actions: [ {
type: "toggle"
}
]
});
});
This Pen doesn't use any external CSS resources.