15 lines
414 B
JavaScript
15 lines
414 B
JavaScript
const overlay = document.getElementById('offline-overlay');
|
|
|
|
const stopJS = document.getElementById('stopJS');
|
|
|
|
const heartbeat = () => {
|
|
overlay.classList.remove("animate-overlay");
|
|
void overlay.offsetWidth;
|
|
overlay.classList.add("animate-overlay");
|
|
}
|
|
|
|
const heartbeatInterval = setInterval(heartbeat, 1000);
|
|
|
|
stopJS.addEventListener("click", function () {
|
|
clearInterval(heartbeatInterval);
|
|
}); |