From 4a2835154ffc7b7356d229d233132c5430d42f86 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 27 Mar 2024 15:43:28 +0800 Subject: added swup effect/transition when switching pages --- src/js/transition.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/js/transition.js (limited to 'src/js/transition.js') diff --git a/src/js/transition.js b/src/js/transition.js new file mode 100644 index 00000000..01bd11fc --- /dev/null +++ b/src/js/transition.js @@ -0,0 +1,13 @@ +let a = document.querySelectorAll("a") + +a.forEach(element => { + element.onclick = event => { + element.classList.add("openlink") + element.innerHTML = ` + + ` + element.style.zIndex = 999999 + element.style.overflow = "auto !important" + setTimeout(function(){element.classList.remove("openlink")}, 3000); + } +}) -- cgit v1.2.3