Skip to content

Instantly share code, notes, and snippets.

@desinas
Last active July 24, 2023 14:35
Show Gist options
  • Save desinas/28f7b8172320171ee67d5e8e0d2c30dc to your computer and use it in GitHub Desktop.
Save desinas/28f7b8172320171ee67d5e8e0d2c30dc to your computer and use it in GitHub Desktop.
progress-bar_implement
<div class="container">
<div class="progress-bar"></div>
</div>
<button onclick="loadBar()">Load</button>
const bar = document.querySelector('.progress-bar');
function loadBar () {
bar.classList.add('load');
}
.container {
width: 300px;
height: 50px;
background-color: #D3D3D3;
}
.progress-bar {
width: 0%;
height: 50px;
background-color: #90EE90;
transition: width 3s linear;
}
.load {
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment