diff --git a/src/app/globals.css b/src/app/globals.css index 24e6e06..2affeb4 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -156,6 +156,36 @@ z-index: 3; } +/* Inverted Optical Liquid Glass Refraction Chamber */ +.liquid-refraction-chamber { + position: absolute; + inset: 0; + border-radius: inherit; + overflow: hidden; + pointer-events: none; + z-index: 1; + opacity: 0.65; + filter: url("#glass-liquid-warp") blur(0.6px); + mix-blend-mode: luminosity; + transform: translateZ(0); +} + +.liquid-fluid-wave { + position: absolute; + top: -120px; + left: -25%; + width: 150%; + height: 600px; + pointer-events: none; + background: + radial-gradient(ellipse 65% 35% at 25% 25%, rgba(56, 189, 248, 0.45) 0%, transparent 60%), + radial-gradient(ellipse 70% 45% at 75% 70%, rgba(124, 58, 237, 0.42) 0%, transparent 65%), + radial-gradient(ellipse 85% 55% at 50% 45%, rgba(37, 99, 235, 0.35) 0%, transparent 70%), + linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, transparent 45%, rgba(255, 255, 255, 0.5) 100%); + will-change: transform; + transform: translateZ(0) scaleY(-1); +} + /* Liquid Glass Mobile Dropdown */ .liquid-glass-dropdown { position: relative; diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index 533995a..817c288 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Menu, X, Smartphone, Layers, ArrowUpRight } from 'lucide-react'; @@ -17,6 +17,8 @@ export function Navbar({ config, currentLocale }: NavbarProps) { const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [mousePos, setMousePos] = useState({ x: 50, y: 50, active: false }); const pathname = usePathname(); + const navRef = useRef(null); + const mirrorRef = useRef(null); useEffect(() => { const handleScroll = () => { @@ -26,6 +28,43 @@ export function Navbar({ config, currentLocale }: NavbarProps) { return () => window.removeEventListener('scroll', handleScroll); }, []); + // Ultra-Fast Hardware-Accelerated Optical Liquid Refraction Wave (120 FPS on Mobile & Desktop) + useEffect(() => { + let rafId: number; + + const updateWave = () => { + if (!mirrorRef.current) return; + const lenis = (window as any).lenis; + const scrollY = lenis && typeof lenis.scroll === 'number' ? lenis.scroll : window.scrollY; + // Invert on Y (scaleY(-1)) and translate in opposite optical direction on scroll + const offset = (scrollY * 0.45) % 400; + mirrorRef.current.style.transform = `translate3d(0, -${offset}px, 0) scaleY(-1)`; + }; + + const onScroll = () => { + cancelAnimationFrame(rafId); + rafId = requestAnimationFrame(updateWave); + }; + + const lenis = (window as any).lenis; + if (lenis && typeof lenis.on === 'function') { + lenis.on('scroll', updateWave); + } + + window.addEventListener('scroll', onScroll, { passive: true }); + window.addEventListener('resize', onScroll, { passive: true }); + updateWave(); + + return () => { + if (lenis && typeof lenis.off === 'function') { + lenis.off('scroll', updateWave); + } + window.removeEventListener('scroll', onScroll); + window.removeEventListener('resize', onScroll); + cancelAnimationFrame(rafId); + }; + }, []); + const handleMouseMove = (e: React.MouseEvent) => { const rect = e.currentTarget.getBoundingClientRect(); const x = ((e.clientX - rect.left) / rect.width) * 100; @@ -39,13 +78,42 @@ export function Navbar({ config, currentLocale }: NavbarProps) { return (
+ {/* SVG Optical Liquid Glass Refraction & Distortion Filter (Single Octave Ultra-Fast GPU Shader) */} + +
+ {/* Optical Inverted Liquid Glass Refraction Chamber */} +