Colorful Spinning Dots Loader

Colorful Spinning Dots Loader

Source code:

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Colorful Spinning Dots Loader</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background:linear-gradient(135deg, #040e47, #5c056b);
font-family: Arial, sans-serif;
overflow: hidden;
}

/* Loader Container */
.loader-container {
position: relative;
width: 100px;
height: 100px;
}

.dot {
position: absolute;
width: 15px;
height: 15px;
background-color: #fff;
border-radius: 50%;
animation: spin 1.5s linear infinite;
}

.dot:nth-child(1) {
background-color: #ff5959;
animation-delay: 0s;
}

.dot:nth-child(2) {
background-color: #ffad33;
animation-delay: 0.2s;
}

.dot:nth-child(3) {
background-color: #53d769;
animation-delay: 0.4s;
}

.dot:nth-child(4) {
background-color: #5ac8fa;
animation-delay: 0.6s;
}

.dot:nth-child(5) {
background-color: #af52de;
animation-delay: 0.8s;
}

/* Animation */
@keyframes spin {
0% {
transform: rotate(0deg) translateX(40px) rotate(0deg);
}
100% {
transform: rotate(360deg) translateX(40px) rotate(-360deg);
}
}

/* Main Content */
.main-content {
display: none;
text-align: center;
color: white;
font-size: 2rem;
animation: fadeIn 1s ease-out forwards;
}

/* Fade-In Animation */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

/* Hide Loader and Show Content */
body.loaded .loader-container {
display: none;
}

body.loaded .main-content {
display: block;
}
</style>
</head>
<body>
<div class=”loader-container”>
<div class=”dot”></div>
<div class=”dot”></div>
<div class=”dot”></div>
<div class=”dot”></div>
<div class=”dot”></div>
</div>

<div class=”main-content”>
Welcome to the main page!
</div>
</body>
</html>

Scroll to Top