Colorful Bouncing Bar Loader

Colorful Bouncing Bar 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 Bouncing Bar Loader</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #3F51B5, #020100);
font-family: Arial, sans-serif;
overflow: hidden;
}

/* Loader Container */
.loader-container {
display: flex;
justify-content: space-between;
width: 120px;
height: 60px;
}

.bar {
width: 20px;
height: 100%;
background: #fff;
border-radius: 10px;
animation: bounce 1.2s infinite ease-in-out;
}

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

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

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

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

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

/* Animation */
@keyframes bounce {
0%, 100% {
transform: scaleY(0.3);
}
50% {
transform: scaleY(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.loaded .loader-container {
display: none;
}

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

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

Scroll to Top