Guest User

Untitled

a guest
Jun 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <div class="progress-bar-container">
  2. <div class="progress-bar"></div>
  3. </div>
  4.  
  5. :root {
  6. --progress: 0;
  7. }
  8. body {
  9. background-color: lightgrey;
  10. }
  11. .progress-bar {
  12. background-color: orange;
  13. width: 10%;
  14. position: absolute;
  15. }
  16. .progress-bar-container {
  17. display: flex;
  18. flex-direction: column;
  19. justify-content: center;
  20. align-items: center;
  21. height: 30px;
  22. border: 2px solid white;
  23. }
  24.  
  25. const progress = () => {
  26. let array = [...Array(100).keys()];
  27. for (let i of array) {
  28. document.documentElement.style.setProperty('--progress', i);
  29. }
  30.  
  31. }
  32.  
  33. document.body.addEventListener("click", progress);
Add Comment
Please, Sign In to add comment