okay in simon game
i create array for colors
block=["red","blue","green","yellow"]
and i create another array
random_blocks=[]
and if the game start or the player check the colors right
i push another random color to it
and then i try simple way
just forEach(item) and for each item
item.css() change the css
then
setTimeout(function(),1000);
but it didn’t work
so i try this
for (var i =0;i<arr.length;i++){
arr[i].css();
setTimeout(function(),1000*(i+1));
}
also didn’t work
so i tried this
function the_loop(n){
arr[i].css()//change the css
setTimeout(function,1000);
}
and inside for loop
the_loop(i);
also didn’t work
and Promises also doesn’t work
all i need is just for every item in the array
change the css props to change the size and shape
wait second
and then back to the normal shape of the item
the page
is https://codepen.io/ayman-ayman/pen/mqzzwg