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/swup.js | 2 ++ src/js/transition.js | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/js/swup.js create mode 100644 src/js/transition.js (limited to 'src') diff --git a/src/js/swup.js b/src/js/swup.js new file mode 100644 index 00000000..0866c441 --- /dev/null +++ b/src/js/swup.js @@ -0,0 +1,2 @@ +import Swup from 'https://unpkg.com/swup@4?module'; +const swup = new Swup(); \ No newline at end of file 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