From 53e72cb46a59f7fabd218b87744f4c19a0917043 Mon Sep 17 00:00:00 2001 From: OpenCode Date: Sat, 16 May 2026 14:12:42 +0100 Subject: [PATCH] Refine desktop glass effects --- CHANGELOG.md | 2 ++ components/HeroSection.tsx | 2 +- components/LiquidGlass.tsx | 8 ++++++-- components/TrustSection.tsx | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dc00dd..5488d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ All notable changes to the New Optic website will be documented in this file. ### Changed +- Re-enabled liquid glass on desktop PCs using user-agent and pointer capability detection, while keeping it disabled on phones and tablets. +- Changed trust stat label accent from blue to a softer neutral white tone. - Refined contact and trust UI: stat labels are now accented above values, French WhatsApp CTA says "Discuter sur WhatsApp", hours information is emphasized, and mobile navbar shows WhatsApp without opening the menu. - Updated customer-corrected business facts: New Optic is active since around 2004, does not offer eye exams, and offers contact lenses plus colored contact lenses. - Optimized mobile rendering by disabling heavy blur, fixed backgrounds, ambient animations, and WebGL glass below desktop widths. diff --git a/components/HeroSection.tsx b/components/HeroSection.tsx index 1235fc7..09db017 100644 --- a/components/HeroSection.tsx +++ b/components/HeroSection.tsx @@ -65,7 +65,7 @@ export default function HeroSection({ t, whatsappUrl }: { t: Messages; whatsappU className="relative mx-auto w-full max-w-xl lg:max-w-none lg:will-change-transform" >
-
+
{t.hero.imageAlt} diff --git a/components/LiquidGlass.tsx b/components/LiquidGlass.tsx index e477748..4a20bec 100644 --- a/components/LiquidGlass.tsx +++ b/components/LiquidGlass.tsx @@ -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 }); diff --git a/components/TrustSection.tsx b/components/TrustSection.tsx index 8740281..e2e6a02 100644 --- a/components/TrustSection.tsx +++ b/components/TrustSection.tsx @@ -11,7 +11,7 @@ export default function TrustSection({ t }: { t: Messages }) { {t.trust.stats.map((stat) => ( -

{stat.label}

+

{stat.label}

{stat.value}

))}