Colorful Pulsating Squares Loader

Colorful Pulsating Squares Loader – CSS 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 Pulsating Squares Loader </title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #06134b, #21010b);
font-family: Arial, sans-serif;
overflow: hidden;
}

/* Loader Container */
.loader-container {
display: flex;
justify-content: space-around;
align-items: center;
width: 120px;
}

.square {
width: 20px;
height: 20px;
background: #fff;
animation: pulse 1.5s infinite ease-in-out;
}

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

.square:nth-child(2) {
background: #ffad33;
animation-delay: 0.3s;
}

.square:nth-child(3) {
background: #53d769;
animation-delay: 0.6s;
}

.square:nth-child(4) {
background: #5ac8fa;
animation-delay: 0.9s;
}

.square:nth-child(5) {
background: #af52de;
animation-delay: 1.2s;
}

/* Animation */
@keyframes pulse {
0%, 100% {
transform: scale(1);
opacity: 0.6;
}
50% {
transform: scale(1.5);
opacity: 1;
}
}

/* 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.square .loader-container {
display: none;
}

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

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

 

</body>
</html>

Scroll to Top