How to make the transition in stages?

Good afternoon, prompt how better to implement the transition in phases in the block?
The logic is this: satalino is highlighted by the class of active first stage, when switching on - .active have with all the previous stages.
Maybe there is ready solution.

https://codepen.io/anon/pen/OqGzbz
March 19th 20 at 08:37
1 answer
March 19th 20 at 08:39
Solution
consider all the elements to know which number was clicked
then, by clicking first of all remove the active
and active for all who are in order to clicked the circle

https://codepen.io/anon/pen/zbXarN

Find more questions by tags Web DevelopmentHTMLJavaScript