<!-- This one does work in safari & ios and other modern browsers -->
<div class="wrap">
<ol class="hundreds">
<li>1</li>
<li>0</li>
</ol>
<ol class="tens">
<li>0</li>
<li>9</li>
<li>8</li>
<li>7</li>
<li>6</li>
<li>5</li>
<li>4</li>
<li>3</li>
<li>2</li>
<li>1</li>
<li>0</li>
</ol>
<ol class="units">
<li>0</li>
<li>9</li>
<li>8</li>
<li>7</li>
<li>6</li>
<li>5</li>
<li>4</li>
<li>3</li>
<li>2</li>
<li>1</li>
<li>0</li>
</ol>
</div>
html,
body,
ol {
margin: 0;
padding: 0;
}
ol {
list-style: none;
}
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
body:before {
content: "";
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -1;
background: linear-gradient(red, red);
background-size: 100% 0;
background-repeat: no-repeat;
animation: bg 5s linear forwards;
}
.wrap {
text-align: center;
border: 5px solid #000;
font-size: 4rem;
box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.5);
overflow: hidden;
width: 145px;
height: 35px;
line-height: 35px;
padding: 0 10px;
position: relative;
border: 5px solid #000;
background: #eee;
display: flex;
justify-content: center;
background: linear-gradient(#ccc, #eee);
mix-blend-mode: luminosity;
}
.wrap ol {
font-family: monospace;
font-size: 35px;
font-weight: bold;
line-height: 1;
margin: 0 2px;
transform: translateY(0%);
}
@keyframes bg {
100% {
background-size: 100% 100%;
}
}
.wrap ol {
line-height: 35px;
}
.wrap li {
height: 35px;
}
ol.units {
animation: units 0.5s steps(100) forwards;
animation-iteration-count: 10;
}
ol.tens {
animation: tens 5s steps(10) forwards;
animation-iteration-count: 1;
}
ol.hundreds {
animation: hundreds 5s steps(1) forwards;
animation-iteration-count: 1;
}
@keyframes units {
0% {
transform: translateY(-1000%);
}
100% {
transform: translateY(0%);
}
}
@keyframes tens {
0% {
transform: translateY(-1000%);
}
100% {
transform: translateY(0%);
}
}
@keyframes hundreds {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(0%);
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.