1
I created a code that the numbers increase and decrease on the screen with CSS, and created the Divs by javascript. However I need "GO!" after a second and I couldn’t find out.
function start(){
var number = document.getElementById("number");
number.innerHTML = `
<div id="cinco">5</div>
<div id="quatro">4</div>
<div id="tres">3</div>
<div id="dois">2</div>
<div id="um">1</div>
<div id="go">GO!</div>
`
}
.container {
text-align: center;
margin: 0 auto;
}
#cinco, #quatro, #tres, #dois, #um, #go {
font-size: 0;
animation: .5s ease-in-out 2 forwards alternate zoom;
}
#quatro {
animation-delay: 1s;
}
#tres {
animation-delay: 2s;
}
#dois {
animation-delay: 3s;
}
#um {
animation-delay: 4s;
}
#go {
animation-delay: 5s;
animation-iteration-count: 1;
}
@keyframes zoom {
0% { font-size: 0; }
100% { font-size: 150px; }
}
<body onload="start()">
<div id="number" class="container"></div>
</body>
Brunno, you can ask in Portuguese, we are at [pt.so].
– Woss