Progress Bar
HTML CODE:-
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> </head> <body> <div class="container"> <div style="--i:0"></div> <div style="--i:1"></div> <div style="--i:2"></div> <div style="--i:3"></div> <div style="--i:4"></div> </div> </body> </html> |
CSS CODE:-
body{ padding: 0px; margin: 0px; min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: #282828; } .container{ display: flex; flex-direction: row; } .container div{ position: relative; width: 35px; height: 200px; margin: 20px; border-radius: 40px; border: 2px solid #272727; overflow: hidden; background: linear-gradient(to bottom, rgba(0,0,0,0.5)); box-shadow: -5px -5px 5px rgba(92,92,92,0.1),10px 10px 10px rgba(0,0,0,0.4), inset -5px -5px 5px rgba(82,82,82,0.2),inset 10px 10px 10px rgba(0,0,0,0.4); } .container div::before{ content: ""; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 10; border-radius: 40px; background: linear-gradient(to bottom, rgba(0,0,0,0.5)); box-shadow: -5px -5px 5px rgba(92,92,92,0.1),10px 10px 10px rgba(0,0,0,0.4), inset -5px -5px 5px rgba(82,82,82,0.2),inset 10px 10px 10px rgba(0,0,0,0.4); } .container div::after{ content: ""; width: 35px; height: 35px; position: absolute; top: 0; left: 0; background: #343434; border-radius: 50%; box-shadow: inset -5px -5px 5px rgba(0,0,0,0.2),0 420px 0 400px yellow; transform: translateY(150px); animation: animate 3s ease-in-out infinite; animation-delay: calc(-0.5s * var(--i)); } @keyframes animate{ 0%{ transform: translateY(150px); filter: hue-rotate(360deg); } 50%{ transform: translateY(0px); } 100%{ transform: translateY(150px); filter: hue-rotate(0deg); } } |