Colorful Rotating Dots Loader

Colorful Rotating 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 Rotating Dots Loader</title>
<style>
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #02171a;
}

.loader-container{
position: relative;
width: 100px;
height: 100px;
}

.dot {
position: absolute;
width: 15px;
height: 15px;
background: white;
border-radius: 50%;
animation: rotate 1.5s linear infinite;
}

.dot:nth-child(1) {
top: 0;
left: 50%;
transform: translateX(-50%);
background: #ff5959;
}

.dot:nth-child(2) {
top: 25%;
left: 85%;
background: #ffad33;
}

.dot:nth-child(3) {
top: 75%;
left: 85%;
background: #53d769;
}

.dot:nth-child(4) {
top: 100%;
left: 50%;
background: #5ac8fa;
transform: translate(-50%, -100%);
}

.dot:nth-child(5) {
top: 75%;
left: 15%;
background: #af52de;
}

.dot:nth-child(6) {
top: 25%;
left: 15%;
background: #ff2d55;
}

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

</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 class=”dot”></div>
</div>

</body>
</html>

Scroll to Top