I saw this article on how to create a CSS countdown timer. It seemed interesting to me, so I tried to follow the instructions and get it to work. Here's what I came up with. It doesn't look right and unfortunately the live demo link is broken. What am I doing wrong?
.tens li:nth-of-type(1) {
animation: digitcount 10s ease-in-out 0s 1;
}
.tens li:nth-of-type(2) {
animation: tencount 60s ease-in-out 1s 1;
}
.tens li:nth-of-type(3) {
animation: tencount 60s ease-in-out 11s 1;
}
.tens li:nth-of-type(4) {
animation: tencount 60s ease-in-out 11s 1;
}
.tens li:nth-of-type(5) {
animation: tencount 60s ease-in-out 11s 1;
}
.tens li:nth-of-type(6) {
animation: tencount 60s ease-in-out 11s 1;
}
@keyframes tencount {
0% {
opacity: 1
}
16.6% {
opacity: 1
}
16.7% {
opacity: 0
}
100% {
opacity: 0
}
}
.digits li:nth-of-type(1) {
animation: digitcount 10s ease-in-out 0s 6;
}
.digits li:nth-of-type(2) {
animation: digitcount 10s ease-in-out 1s 6;
}
.digits li:nth-of-type(3) {
animation: digitcount 10s ease-in-out 0s 6;
}
.digits li:nth-of-type(4) {
animation: digitcount 10s ease-in-out 1s 6;
}
.digits li:nth-of-type(5) {
animation: digitcount 10s ease-in-out 0s 6;
}
.digits li:nth-of-type(6) {
animation: digitcount 10s ease-in-out 1s 6;
}
.digits li:nth-of-type(7) {
animation: digitcount 10s ease-in-out 0s 6;
}
.digits li:nth-of-type(8) {
animation: digitcount 10s ease-in-out 1s 6;
}
.digits li:nth-of-type(9) {
animation: digitcount 10s ease-in-out 0s 6;
}
.digits li:nth-of-type(10) {
animation: digitcount 10s ease-in-out 1s 6;
}
@keyframes digitcount {
0% {
opacity: 1
}
9.9% {
opacity: 1
}
10% {
opacity: 0
}
100% {
opacity: 0
}
}
.done li {
animation: zero 1s ease-in-out 60s infinite;
}
@keyframes zero {
0% {
opacity: 1
}
90% {
opacity: 1
}
100% {
opacity: 0
}
}
<div class="clock">
<ol class="tens">
<li>6</li>
<li>5</li>
<li>4</li>
<li>3</li>
<li>2</li>
<li>1</li>
</ol>
<ol class="digits">
<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>
</ol>
<ol class="done">
<li>0</li>
</ol>
</div>