diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
| commit | 631547a75142326a7c71bdf123e1475217a5ad73 (patch) | |
| tree | f3cfef6b3c5b42bf626fc823ddcf63b8dcf4cdbb /assets/js/glitch.js | |
| parent | 77ccbe72fad5a4870185fff374f75471c16a9043 (diff) | |
| download | danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.tar.gz danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.zip | |
chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme)
Diffstat (limited to 'assets/js/glitch.js')
| -rw-r--r-- | assets/js/glitch.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/assets/js/glitch.js b/assets/js/glitch.js deleted file mode 100644 index 85f8a00..0000000 --- a/assets/js/glitch.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * glitch.js - * Random glitch effect on .hero-name every 4-11 seconds - */ - -export function initGlitch() { - 'use strict'; - - const heroName = document.querySelector('.hero-name'); - if (!heroName) return; - - if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return; - - function triggerGlitch() { - heroName.classList.add('is-glitching'); - setTimeout(() => { - heroName.classList.remove('is-glitching'); - }, 450); - } - - function scheduleNextGlitch() { - const delay = Math.random() * 7000 + 4000; // 4-11 seconds - setTimeout(() => { - triggerGlitch(); - scheduleNextGlitch(); - }, delay); - } - - scheduleNextGlitch(); -} |
