Imagine the following HTML structure:
<div class="myClass" />
<div class="myClass" />
<div class="myClass" />
Those divs represent an object, that has this SASS:
.myClass {
position: absolute;
animation: shake 5s infinite;
animation-timing-function: linear;
}
Now, I would like all of them to implement shake
animation, but in a different way - first div to move left/right, second to move top/bottom etc - generally all of them should have same animation with minor tweaks.
I've come to a point where I made 3 different animations using SASS's @for
but that doesn't solve my problem, because after compilation, all elements with same class are being given the same animation.
Example: I'm generating 3 different shake-1
, shake-2
, shake-3
animations, and even if I make SASS function, only one of them is applied to all html elements with same class.
Any ideas on how to approach this?