Progress Bar App
About this app
A simple app with a progress bar
Progress Bar App Fill +5%
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Progress Bar App</title>
<meta name="description" content="A simple app with a progress bar">
<meta name="keywords" content="progress bar, web app, button">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script type="text/javascript">
try {
document.addEventListener("DOMContentLoaded", function() {
// Get the progress bar element
var progressBar = document.getElementById("progress-bar");
// Get the fill button element
var fillButton = document.getElementById("fill-button");
// Add click event listener to the fill button
fillButton.addEventListener("click", function() {
// Get the current width of the progress bar
var currentWidth = parseFloat(progressBar.style.width || 0);
// Calculate the new width by adding 5%
var newWidth = currentWidth + 5;
// Set the new width of the progress bar
progressBar.style.width = newWidth + "%";
});
});
} catch (error) {
throw error;
}
</script>
<style>
body {
font-family: 'Roboto', sans-serif;
}
#main-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.progress-bar-container {
width: 300px;
height: 30px;
border: 1px solid gray;
background: linear-gradient(to right, #b3e6b3, #66ccff);
margin-bottom: 20px;
}
.progress-bar {
width: 0;
height: 100%;
background: linear-gradient(to right, #b3e6b3, #66ccff);
}
.fill-button {
padding: 10px 20px;
background-color: #66ccff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div class="progress-bar-container">
<div id="progress-bar" class="progress-bar"></div>
</div>
<button id="fill-button" class="fill-button">Fill +5%</button>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!