I've seen this element that actually works as a " loader " while the image is loading etc. And I tried to replicate it. Not the dynamics to function as a loader , but rather this effect of the passing line at the top.
WhatIhavetocodesofaristhis,Ialignedthebaratthetopandeverything,butwhatIwouldliketoputisthis"candy bar" animated effect inside the bar from the top. How do you make these lines go like this?
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
body {
background-image: url(https://unsplash.it/600/300);
background-size: cover;
}
.bar {
position: fixed;
top: 0;
z-index: 1000;
height: 10px;
width: 100%;
background-color: rgba(255,0,0,.25);
border-bottom: 1px solid rgba(0,0,0,.25);
box-shadow: inset 0 5px 5px 0 rgba(255,255,255,.25);
}
<div class="bar"></div>