Introduction
Nowadays it is common that the interface, in this case a website, takes care of all the logic asking the server for data without reloading the page. For those waiting times that are visible, here are 7 animations made 100% in CSS. Say goodbye to boring "Loading..." text. By using keyframes (as we saw in this article), we can animate elements very easily.
Pulse
@keyframes loading {
0%, 100% {
margin-top: 25px;
height: 10px;
}
50%{
margin-top: 0px;
height: 50px;
}
}
ul {
display: inline-flex;
margin: 0;
padding: 0;
list-style: none;
gap: 5px;
}
li {
background-color: var(--color-primary);
width: 10px;
height: 10px;
animation: loading 1s ease-in-out infinite;
}
li:nth-child(1) {
animation-delay: 0s;
}
li:nth-child(2) {
animation-delay: -0.2s;
}
li:nth-child(3) {
animation-delay: -0.4s;
}
li:nth-child(4) {
animation-delay: -0.6s;
}
li:nth-child(5) {
animation-delay: -0.8s;
}