Skip to content

Commit

Permalink
fixed loader
Browse files Browse the repository at this point in the history
  • Loading branch information
wolulcmit committed May 11, 2024
1 parent 2de5dc8 commit f1bbd4f
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/_includes/webc/c-loader.webc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<div id="loader" webc:root="override"><span class="loader"></span></div>

<style webc:scoped>
@keyframes fade{
0%{
background-position:-50% 50%;
opacity: 0;
}
50%{
background-position:200% 50%;
opacity: 1;
}
100%{
background-position:400% 50%;
opacity: 0;
}
}

:host{
display: none;
width: 100%;
height: 6px;
position: absolute;
left: 0; top: 0;
overflow: hidden;
}

:host .loader{
animation: fade 2s infinite;
width: 100vw;
display: block;
height: 100%;
position: absolute;
top: 0px;
left: 0;
background: linear-gradient( 90deg, hwb(var(--blueHWB)/0), hwb(var(--blueHWB)/0.5), hwb(var(--blueHWB)/0));
background-size: 75% 100%;
}

</style>
<style>
/* show loader animaton shimmer bar, when requests are being made */
body:has(#nav .htmx-request, #content a.htmx-request) #loader,
body:has(.htmx-request) #loader
{
display: block;
}
</style>

0 comments on commit f1bbd4f

Please sign in to comment.