@Zergling_man @Yoruka @sally You can do away with most of JS with just CSS counters and animations:
<div id="nojs" class="hidden"> <p>Or wait <n id="tick"></n> seconds...</p> </div> <style type="text/css"> @property --tick { syntax: "<integer>"; initial-value: 0; inherits: false; } @keyframes tick { from { --tick: 3; } } @keyframes hide { from { width: 100%; height: 100%; } } .hidden { display: none; } .nojs { display: block; position: absolute; padding: 0; margin: 0; left: 0; top: 0; right: 100%; bottom: 100%; width: 0; height: 0; overflow: hidden; animation: hide 3s steps(1, end); background: #fff; } #tick { animation: tick 3s steps(3); counter-reset: tick var(--tick); } #tick::after { content: counter(tick); } </style>then the only JS line you need:
document.getElementById("nojs").className = "nojs"