From f32b247fd02c1591ef03d844a9bcae4844f1b399 Mon Sep 17 00:00:00 2001 From: "Unisko PENG," Date: Wed, 19 Apr 2023 10:50:43 +0800 Subject: [PATCH] Updated. --- theme/pagetoc.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/theme/pagetoc.js b/theme/pagetoc.js index 35964fa..96d2b40 100644 --- a/theme/pagetoc.js +++ b/theme/pagetoc.js @@ -49,5 +49,18 @@ window.addEventListener('load', function() { window.addEventListener("scroll", updateFunction); if(document.querySelector("#document-not-found404")) { + let timeLeft = 10; + + setInterval(var timerId = function() { + if(timeLeft == -1) { + clearTimeout(timerId); + } else { + let secCounts = document.querySelectorAll(".sec-count") + secCounts.forEach(count => { + count.innerHTML = timeLeft; + }); + timeLeft--; + } + }, 1000); console.log("Page not found"); }