mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 23:40:28 +05:30
#22: use opaque loader background on first show
This commit is contained in:
parent
64cb197756
commit
a860e10847
@ -1,4 +1,4 @@
|
||||
<div id="loader" class="loader-overlay">
|
||||
<div id="loader" class="loader-overlay is-first-launch">
|
||||
<div class="loader">
|
||||
<div class="loader__cube loader__cube--1"></div>
|
||||
<div class="loader__cube loader__cube--2"></div>
|
||||
|
@ -12,12 +12,19 @@
|
||||
|
||||
transition: 0.4s ease;
|
||||
|
||||
&.is-first-launch {
|
||||
// if loader is shown for the first time, we will
|
||||
// remove opacity and hide the entire site contents
|
||||
background: #f2efeb;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.loader {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
@ -3,14 +3,15 @@ let stack = 1;
|
||||
|
||||
export default {
|
||||
show() {
|
||||
if (++stack !== 1) {
|
||||
if (++stack >= 0) {
|
||||
document.getElementById('loader').classList.add('is-active');
|
||||
}
|
||||
},
|
||||
|
||||
hide() {
|
||||
if (--stack === 0) {
|
||||
document.getElementById('loader').classList.remove('is-active');
|
||||
if (--stack <= 0) {
|
||||
stack = 0;
|
||||
document.getElementById('loader').classList.remove('is-active', 'is-first-launch');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user