I recently came across an article discussing the creation of a CSS countdown timer. Intrigued by the concept, I decided to give it a try myself. However, my implementation seems flawed and the live demo link provided in the article is not working. Can someone help me identify the issue at hand?
.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>