$(() => { const skip = localStorage.getItem('skip-splash'); if (skip && skip == 'true') { setTimeout(() => { $('#splash').addClass('none'); }, 200); } else { $('#splash-logo').removeClass('hide'); const loaderInterval = loader(); setTimeout(() => { $('#splash-loader').removeClass('hide'); }, 200); $('#splash-line-1').removeClass('hide').addClass('anim-typewriter'); $('#splash-line-1').one('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() { $('#splash-line-2').removeClass('hide').addClass('anim-typewriter'); }); $('#splash-line-2').one('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() { $('#splash-line-3').removeClass('hide').addClass('anim-typewriter'); }); $('#splash-line-3').one('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() { clearInterval(loaderInterval); $('#splash').addClass('none'); }); } }); const spinner = { interval:80, frames:[ "[        ]", "[=       ]", "[==      ]", "[===     ]", "[====    ]", "[=====   ]", "[ =====  ]", "[  ===== ]", "[   =====]", "[    ====]", "[     ===]", "[      ==]", "[       =]", "[        ]", "[       =]", "[      ==]", "[     ===]", "[    ====]", "[   =====]", "[  ===== ]", "[ =====  ]", "[=====   ]", "[====    ]", "[===     ]", "[==      ]", "[=       ]"] } function loader() { const grid = document.getElementById('splash-loader') const spin = document.createElement('div'); spin.innerText = spinner.frames[0]; grid.appendChild(spin); let i = 0; return setInterval(() => { requestAnimationFrame(() => { spin.innerHTML = spinner.frames[++i % spinner.frames.length]; }); }, spinner.interval); }