Guest User

Untitled

a guest
Feb 11th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. const loadingSection = document.getElementById('loading');
  2. const loadStop = document.getElementById('loadstop');
  3. const loadCircle = document.querySelector('div.circle');
  4. const j2logo = document.querySelector('#loading img');
  5. window.addEventListener('load', () => {
  6. setTimeout(() => {
  7. loadCircle.addEventListener('animationend', () => {
  8. if (loadCircle.classList.contains('spin')) {
  9. loadCircle.classList.remove('spin');
  10. loadCircle.classList.add('fullwidth');
  11. j2logo.classList.add('j2hide');
  12. j2logo.style.opacity = "0";
  13. setTimeout(() => {
  14. loadingSection.style.backgroundColor = "transparent";
  15. j2logo.style.opacity = "0";
  16. j2logo.style.visibility = "hidden";
  17. }, 1000)
  18. } else if (loadCircle.classList.contains('fullwidth') && j2logo.classList.contains('j2hide')) {
  19. loadCircle.classList.remove('fullwidth');
  20. loadCircle.style.visibility = "hidden";
  21. loadCircle.classList.remove('j2hide');
  22. loadingSection.style.height = "0px";
  23. }
  24. });
  25. }, 200);
  26. });
Add Comment
Please, Sign In to add comment