Refine desktop glass effects
This commit is contained in:
@@ -15,7 +15,11 @@ declare global {
|
||||
export default function LiquidGlass() {
|
||||
useEffect(() => {
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
||||
if (!window.matchMedia("(min-width: 1024px)").matches) return;
|
||||
|
||||
const userAgent = navigator.userAgent || "";
|
||||
const isMobileUserAgent = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(userAgent);
|
||||
const hasCoarsePrimaryPointer = window.matchMedia("(pointer: coarse)").matches;
|
||||
if (isMobileUserAgent || hasCoarsePrimaryPointer) return;
|
||||
|
||||
let cancelled = false;
|
||||
let attempts = 0;
|
||||
@@ -64,7 +68,7 @@ export default function LiquidGlass() {
|
||||
shadow: true,
|
||||
specular: true,
|
||||
reveal: "fade",
|
||||
tilt: window.innerWidth >= 768,
|
||||
tilt: true,
|
||||
tiltFactor: 3.5,
|
||||
magnify: 1.01
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user