From 7687601dac2269227943a3a10725f38a246d70c2 Mon Sep 17 00:00:00 2001 From: Escher WD Date: Tue, 24 Sep 2024 13:53:07 +0200 Subject: [PATCH] disable 3d hover on smaller viewports --- assets/js/app.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 03feee7..955a61f 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -31,19 +31,20 @@ document.getElementById("menuToggle").addEventListener("click", () => { } }); -// Universal Tilt -UniversalTilt.init({ - elements: document.querySelectorAll('[tilt]'), - settings: { - // options... - shine: true, - 'shine-opacity': 0.5, - 'shine-save': true, - scale: 1.2, - exclude: /(iPod|iPhone|iPad|Android)/ - }, - callbacks: { - // callbacks... - } -}); +// Universal Tilt (only initialize on devices larger than 'sm' breakpoint) +if (window.innerWidth > 640) + UniversalTilt.init({ + elements: document.querySelectorAll('[tilt]'), + settings: { + // options... + shine: true, + 'shine-opacity': 0.5, + scale: 1.2, + speed: 500, + exclude: /(iPod|iPhone|iPad|Android)/ + }, + callbacks: { + // callbacks... + } + });