<section id="css-keyframes" class="animate-things-wrapper">
<button id="trigger">Trigger</button>
<div id="box" class="box">
Hi there
</div>
</section>
<script src="../../js/components/css-keyframes.js"></script>
<section id="css-keyframes" class="animate-things-wrapper">
<button id="trigger">Trigger</button>
<div id="box" class="box">
Hi there
</div>
</section>
<script src="{{ path '/js/components/css-keyframes.js' }}"></script>
/* No context defined. */
(function () {
document.addEventListener('DOMContentLoaded', function () {
console.log("css-keyframes active");
const button = document.querySelector('#trigger');
const box = document.querySelector('#box');
button.addEventListener('click', function() {
box.classList.add('active');
})
});
})();
@keyframes demoSample {
0% {
transform: none;
}
25% {
transform: translate(25%, 35%);
}
50% {
transform: rotate(400deg) translate(25%, 35%);
}
75% {
transform: scale(2, 2) rotate(400deg) translate(25%, 35%);
}
100% {
transform: scale(1, 1) rotate(-400deg) translate(0, 100%);
}
}
#css-keyframes {
.box {
&.active {
transform-origin: center center;
animation: 3s demoSample ease-in-out;
}
}
}
No notes defined.