Created
March 3, 2023 06:38
-
-
Save rexthecoder/77d061818704044a560dede3f3a24fba to your computer and use it in GitHub Desktop.
Loader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let intro = document.querySelector('.intro'); | |
let logo = document.querySelector('.logo-header'); | |
let logoSpan = document.querySelectorAll('.logo'); | |
window.addEventListener('load', () => { | |
setTimeout(() => { | |
logoSpan.forEach((span, idx) => { | |
setTimeout(() => { | |
span.classList.add('active'); | |
}, (idx + 1) * 400) | |
}); | |
const observer = new MutationObserver(( | |
mutations, obs | |
) => { | |
let fltGlassPane = document.querySelector('flt-glass-pane'); | |
if (fltGlassPane) { | |
setTimeout(() => { | |
logoSpan.forEach((span, idx) => { | |
setTimeout(() => { | |
span.classList.remove('active'); | |
span.classList.add('fade'); | |
}, (idx + 1) * 50) | |
}) | |
}, 2000) | |
setTimeout(() => { | |
intro.style.top = '-100vh'; | |
}, 2300) | |
obs.disconnect(); | |
return | |
} | |
}); | |
observer.observe(document, { | |
childList: true, | |
subtree: true, | |
}); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment