A Pen by Demetrios Kalcassinas on CodePen.
Last active
July 24, 2023 14:35
-
-
Save desinas/28f7b8172320171ee67d5e8e0d2c30dc to your computer and use it in GitHub Desktop.
progress-bar_implement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="progress-bar"></div> | |
</div> | |
<button onclick="loadBar()">Load</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bar = document.querySelector('.progress-bar'); | |
function loadBar () { | |
bar.classList.add('load'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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