I have 6 divs that I want to activate a heartbeat CSS animation, however, I would like to do that by a sequence.
For example, I have an array:
self.generatedSequence = [0,3,5,3];
Each item in the array means the position of the div that will receive the heartbeat function.
Each dive is a UI component from AngularJs:
<div class="grid-cell"
ng-class="{'heartbeat': $ctrl.isActive
}"
></div>
I'm trying to use the controller to activate the HeartBeat animation in every position by a sequence. So in that example will be like
- The position 0 will takes 1s
- The position 3 will takes 1s after the position 0
- The position 5 will takes 1s after the position 3
- The position 3 will takes 1s after the position 5
So all the animation will take 4s.
I tried to do that with $timeout, but it does the both at the same time.
