diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-03-27 15:43:28 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-03-27 15:43:28 +0800 |
| commit | 4a2835154ffc7b7356d229d233132c5430d42f86 (patch) | |
| tree | 3b60377adc179edc43dfb667ee56c739d4b617b0 /src | |
| parent | ff253a30044553da0fcd6372fd32500eb55759a1 (diff) | |
added swup effect/transition when switching pages
Diffstat (limited to 'src')
| -rw-r--r-- | src/js/swup.js | 2 | ||||
| -rw-r--r-- | src/js/transition.js | 13 |
2 files changed, 15 insertions, 0 deletions
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 = ` + <iframe src="/" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> + ` + element.style.zIndex = 999999 + element.style.overflow = "auto !important" + setTimeout(function(){element.classList.remove("openlink")}, 3000); + } +}) |
