<section id="multiple-transforms" class="animate-things-wrapper">
<button id="trigger">Trigger</button>
<div id="box" class="box">
Hi there
</div>
</section>
<script src="../../js/components/multiple-transforms.js"></script>
<section id="multiple-transforms" class="animate-things-wrapper">
<button id="trigger">Trigger</button>
<div id="box" class="box">
Hi there
</div>
</section>
<script src="{{ path '/js/components/multiple-transforms.js' }}"></script>
/* No context defined. */
(function () {
document.addEventListener('DOMContentLoaded', function () {
console.log("multiple-transforms active");
const button = document.querySelector('#trigger');
const box = document.querySelector('#box');
button.addEventListener('click', function() {
box.classList.toggle('active');
})
});
})();
#multiple-transforms {
.box {
transform: scale(1, 1) rotate(0) translate(0, 0);
transition: transform 1.25s ease-in-out;
&.active {
transform: scale(5, 0.5) rotate(900deg) translate(0, -100%);
}
}
}
No notes defined.