@noilda/ng-loader
Version:
Loaders library
106 lines (105 loc) • 2.34 kB
HTML
<style>
:root,
[data-theme='default'] {
--ld: #1e2329;
--ld-bg: #89b1cb;
--ld-txt: #eaecef;
}
:root,
[data-theme='dark'] {
--ld-bg: #1e2329;
--ld: #89b1cb;
--ld-txt: #eaecef;
}
.ld {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 9998;
background-color: rgba(0, 0, 0, 0.5);
opacity: 1;
transition: 0.5s ease-in-out;
}
.ld__section {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 1.8em 0px 0px;
padding: 1rem;
box-shadow: rgba(20, 21, 26, 0.16) 0px 8px 16px,
rgba(71, 77, 87, 0.16) 0px 16px 32px, rgba(20, 21, 26, 0.1) 0px 0px 1px;
border-radius: 0.5rem;
background-color: var(--ld-bg);
min-width: 8rem;
width: fit-content;
max-width: 20em;
}
.ld__animation {
display: flex;
align-items: center;
justify-content: space-between;
width: 2rem;
height: 2.5rem;
}
.ld__txt {
margin: 0.8rem 0px 0px;
font-weight: 400;
font-size: 0.9rem;
color: var(--ld-txt);
width: 100%;
text-align: center;
word-break: break-word;
}
.ld__animation div {
background-color: var(--ld);
height: 100%;
width: 3px;
}
.ld__animation > div:nth-child(1) {
animation: 1.2s ease-in-out -0.3s infinite normal none running animation-loader;
}
.ld__animation > div:nth-child(2) {
animation: 1.2s ease-in-out -0.2s infinite normal none running animation-loader;
}
.ld__animation > div:nth-child(3) {
animation: 1.2s ease-in-out -0.1s infinite normal none running animation-loader;
}
.ld__animation > div:nth-child(4) {
animation: 1.2s ease-in-out 0s infinite normal none running animation-loader;
}
@keyframes animation-loader {
0% {
transform: scaleY(0.4);
}
25% {
transform: scaleY(1);
}
40% {
transform: scaleY(0.4);
}
to {
transform: scaleY(0.4);
}
}
.ld__fade--out {
opacity: 0;
}
</style>
<div class="ld">
<div class="ld__section">
<div class="ld__animation">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="ld__txt">Loading...</div>
</div>
</div>