I want some transformations which are all targeting the same property to stack on top of each other.
Given my example below: If the button is clicked multiple times, the effects should add up. The box should then also move faster to the right according to the frequency of the clicks.
const clickHandler = () => {box.classList.add("move-box");}
.box{
width: 50px;
padding: 10px;
margin-top: 50px;
border: 1px solid black;
}
.move-box {
margin-left: 100px;
transition: margin-left 0.5s linear;
}
<button onclick="clickHandler()">Go over there</button>
<div id="box" class="box">Alright</div>