Progress Bar App
About this app
App de Barra de progresso de 1 Milhão até 10 milhões com números na tela em 3 min
Progress Bar App Progress Bar App 0
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="App de Barra de progresso de 1 Milhão até 10 milhões com números na tela em 3 min">
<meta name="keywords" content="progress bar, contador, números, tempo, app">
<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">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
document.addEventListener("DOMContentLoaded", function() {
// Get the progress bar element
var progressBar = document.getElementById('progress-bar');
// Get the number element
var number = document.getElementById('number');
// Set the initial values
var startValue = 1000000;
var endValue = 10000000;
var currentValue = startValue;
var increment = Math.ceil((endValue - startValue) / 180); // Incrementing the value every 3 seconds (180 seconds total)
var interval = setInterval(function() {
// Update the progress bar and number
progressBar.style.width = ((currentValue - startValue) / (endValue - startValue)) * 100 + '%';
number.innerText = currentValue.toLocaleString();
// Check if the end value is reached
if (currentValue >= endValue) {
clearInterval(interval);
} else {
currentValue += increment;
}
}, 1000); // Update every second
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Roboto', sans-serif;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 40px 20px;
text-align: center;
}
.progress-container {
height: 20px;
background-color: #e9ecef;
border-radius: 10px;
overflow: hidden;
}
.progress-bar {
height: 100%;
transition: width 0.5s ease-in-out;
}
.number {
margin-top: 10px;
font-size: 24px;
font-weight: bold;
color: #343a40;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Progress Bar App</h1>
<div class="progress-container">
<div id="progress-bar" class="progress-bar" style="width: 0;"></div>
</div>
<div id="number" class="number">0</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!