Create a Neon Progress Bar Animation with HTML, CSS, and JavaScript


Want to add a glowing, modern touch to your website UI? In this tutorial, you'll learn how to create a smooth neon progress bar animation using only HTML, CSS, and JavaScript. Perfect for download/upload indicators or loading animations in dark-themed designs.
🔧 What We'll Build
A progress bar that:
Glows with a neon gradient
Expands smoothly from 0% to 100%
Simulates upload or download progress
Is built without any external libraries
🧱 HTML Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neon Progress Bar</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Neon Progress Bar</h2>
<div class="progress-container">
<div class="progress-bar">0%</div>
</div>
<button class="submit-btn">Submit</button>
<script src="app.js"></script>
</body>
</html>
🎨 CSS for Neon Style
*{
margin: 0;
padding: 0;
}
body{
background-color: #0f0f0f;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
font-family: Arial, Helvetica, sans-serif;
}
h2{
color: #00ffe7;
text-shadow: 0 0 10px #00ffe7;
}
.progress-container{
width: 80%;
background-color: #1e1e1e;
border-radius: 20px;
overflow: hidden;
height: 30px;
box-shadow: 0 0 10px #00ffe7;
margin: 20px 0;
}
.progress-bar{
height: 100%;
width: 0%;
background: linear-gradient(90deg, #00ffe7,#00ff99);
color: #fff;
text-align: center;
line-height: 30px;
font-weight: bold;
border-radius: 20px 0 0 20px;
transition: width 0.3s ease;
}
.submit-btn{
padding: 12px 25px;
background: #00ffe7;
border: none;
color: #fff;
font-size: 16px;
border-radius: 10px;
cursor: pointer;
box-shadow: 0 0 15px #00ffe7;
transition: all 0.3s ease;
font-weight: bold;
}
.submit-btn:hover{
background: #00ff99;
box-shadow: 0 0 20px #00ff99;
}
⚙️ JavaScript to Animate Progress
const btn = document.querySelector('.submit-btn');
const progressBar = document.querySelector('.progress-bar');
btn.addEventListener('click', () => {
let progress = 0;
const interval = setInterval(() => {
if(progress >= 100){
clearInterval(interval);
progressBar.textContent = 'Complete!';
progressBar.style.color = '#fff';
} else {
progress++;
progressBar.style.width = progress + '%';
progressBar.textContent = progress + '%';
}
}, 50);
});
🚀 Final Result
Click the Submit button and the neon progress bar will animate from 0% to 100% with a glowing effect.
💡 Tip
Use this effect in dark-mode UIs to draw attention to loading states or actions. You can also adjust the gradient colors and glow intensity for different vibes.
Happy coding! ✨
Subscribe to my newsletter
Read articles from Rizal Azky directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
