feat(ui): implement true liquid glass with high refraction, specular lens glare, chromatic caustics, and interactive cursor tracking
This commit is contained in:
+78
-30
@@ -75,54 +75,102 @@
|
|||||||
border: 1px solid rgba(15, 23, 42, 0.06);
|
border: 1px solid rgba(15, 23, 42, 0.06);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Authentic Liquid Glass Capsule (Squared Media Style) */
|
/* Authentic True Liquid Glass Capsule with High Refraction & Real Specular Gloss */
|
||||||
.liquid-glass-nav {
|
.liquid-glass-nav {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: linear-gradient(
|
/* Crystal transparent optical liquid baseline */
|
||||||
180deg,
|
background:
|
||||||
rgba(255, 255, 255, 0.75) 0%,
|
linear-gradient(
|
||||||
rgba(255, 255, 255, 0.38) 45%,
|
180deg,
|
||||||
rgba(250, 248, 245, 0.68) 100%
|
rgba(255, 255, 255, 0.48) 0%,
|
||||||
);
|
rgba(255, 255, 255, 0.08) 40%,
|
||||||
backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
|
rgba(240, 246, 255, 0.18) 100%
|
||||||
-webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
|
),
|
||||||
|
rgba(255, 255, 255, 0.12);
|
||||||
|
backdrop-filter: blur(14px) saturate(210%) contrast(108%) brightness(1.08);
|
||||||
|
-webkit-backdrop-filter: blur(14px) saturate(210%) contrast(108%) brightness(1.08);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.75);
|
border: 1px solid rgba(255, 255, 255, 0.75);
|
||||||
outline: 1px solid rgba(15, 23, 42, 0.05);
|
outline: 1px solid rgba(15, 23, 42, 0.06);
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1.5px 0.5px rgba(255, 255, 255, 0.95),
|
/* Primary intense top specular ridge */
|
||||||
inset 0 -1px 1px rgba(15, 23, 42, 0.03),
|
inset 0 2px 1px 0 rgba(255, 255, 255, 1),
|
||||||
inset 1px 0 1px rgba(255, 255, 255, 0.4),
|
/* Bottom ambient refraction shadow */
|
||||||
inset -1px 0 1px rgba(255, 255, 255, 0.4),
|
inset 0 -2px 1.5px 0 rgba(15, 23, 42, 0.07),
|
||||||
inset 0 0 20px rgba(255, 255, 255, 0.25),
|
/* Side lens rim caustics */
|
||||||
0 16px 36px -6px rgba(15, 23, 42, 0.08),
|
inset 2px 0 2px 0 rgba(255, 255, 255, 0.65),
|
||||||
0 4px 14px -2px rgba(15, 23, 42, 0.03);
|
inset -2px 0 2px 0 rgba(255, 255, 255, 0.65),
|
||||||
|
/* Deep volumetric liquid glow */
|
||||||
|
inset 0 0 24px 2px rgba(255, 255, 255, 0.5),
|
||||||
|
/* Refractive drop shadows with subtle caustic tint */
|
||||||
|
0 24px 50px -10px rgba(15, 23, 42, 0.15),
|
||||||
|
0 10px 22px -4px rgba(37, 99, 235, 0.08);
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure inner contents sit crisply above liquid reflection layers */
|
||||||
|
.liquid-glass-nav > * {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Diagonal Specular Lens Glare Reflection Slice */
|
||||||
.liquid-glass-nav::before {
|
.liquid-glass-nav::before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: -50%;
|
||||||
left: 8%;
|
left: -20%;
|
||||||
right: 8%;
|
width: 140%;
|
||||||
height: 1px;
|
height: 200%;
|
||||||
background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.95) 50%, transparent 100%);
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
border-radius: 9999px;
|
background: linear-gradient(
|
||||||
|
115deg,
|
||||||
|
transparent 22%,
|
||||||
|
rgba(255, 255, 255, 0.06) 34%,
|
||||||
|
rgba(255, 255, 255, 0.42) 42%,
|
||||||
|
rgba(255, 255, 255, 0.75) 45%,
|
||||||
|
rgba(255, 255, 255, 0.22) 48%,
|
||||||
|
transparent 58%
|
||||||
|
);
|
||||||
|
transform: rotate(-10deg);
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Prismatic Chromatic Caustic Highlight Line */
|
||||||
|
.liquid-glass-nav::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 4%;
|
||||||
|
right: 4%;
|
||||||
|
height: 2px;
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
transparent 0%,
|
||||||
|
rgba(56, 189, 248, 0.75) 15%,
|
||||||
|
rgba(255, 255, 255, 1) 50%,
|
||||||
|
rgba(168, 85, 247, 0.65) 85%,
|
||||||
|
transparent 100%
|
||||||
|
);
|
||||||
|
pointer-events: none;
|
||||||
|
filter: blur(0.2px);
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Liquid Glass Mobile Dropdown */
|
||||||
.liquid-glass-dropdown {
|
.liquid-glass-dropdown {
|
||||||
|
position: relative;
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
180deg,
|
180deg,
|
||||||
rgba(255, 255, 255, 0.9) 0%,
|
rgba(255, 255, 255, 0.72) 0%,
|
||||||
rgba(250, 248, 245, 0.94) 100%
|
rgba(250, 248, 245, 0.85) 100%
|
||||||
);
|
);
|
||||||
backdrop-filter: blur(28px) saturate(190%);
|
backdrop-filter: blur(16px) saturate(200%) brightness(1.06);
|
||||||
-webkit-backdrop-filter: blur(28px) saturate(190%);
|
-webkit-backdrop-filter: blur(16px) saturate(200%) brightness(1.06);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.85);
|
border: 1px solid rgba(255, 255, 255, 0.85);
|
||||||
outline: 1px solid rgba(15, 23, 42, 0.06);
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1px 1px rgba(255, 255, 255, 0.9),
|
inset 0 2px 1px rgba(255, 255, 255, 1),
|
||||||
0 20px 48px -8px rgba(15, 23, 42, 0.12);
|
inset 0 0 20px rgba(255, 255, 255, 0.35),
|
||||||
|
0 24px 60px -10px rgba(15, 23, 42, 0.16);
|
||||||
}
|
}
|
||||||
|
|
||||||
.glass-card {
|
.glass-card {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ interface NavbarProps {
|
|||||||
export function Navbar({ config, currentLocale }: NavbarProps) {
|
export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||||
const [isScrolled, setIsScrolled] = useState(false);
|
const [isScrolled, setIsScrolled] = useState(false);
|
||||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||||
|
const [mousePos, setMousePos] = useState({ x: 50, y: 50, active: false });
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -25,18 +26,40 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
|||||||
return () => window.removeEventListener('scroll', handleScroll);
|
return () => window.removeEventListener('scroll', handleScroll);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
|
const rect = e.currentTarget.getBoundingClientRect();
|
||||||
|
const x = ((e.clientX - rect.left) / rect.width) * 100;
|
||||||
|
const y = ((e.clientY - rect.top) / rect.height) * 100;
|
||||||
|
setMousePos({ x, y, active: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleMouseLeave = () => {
|
||||||
|
setMousePos((prev) => ({ ...prev, active: false }));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="fixed top-3 sm:top-5 left-0 right-0 z-50 px-3 sm:px-6 lg:px-8 pointer-events-none transition-all duration-300">
|
<header className="fixed top-3 sm:top-5 left-0 right-0 z-50 px-3 sm:px-6 lg:px-8 pointer-events-none transition-all duration-300">
|
||||||
<div
|
<div
|
||||||
className={`max-w-6xl mx-auto liquid-glass-nav rounded-2xl sm:rounded-[22px] px-3.5 sm:px-6 py-2.5 sm:py-3 flex items-center justify-between transition-all duration-300 pointer-events-auto ${
|
onMouseMove={handleMouseMove}
|
||||||
|
onMouseLeave={handleMouseLeave}
|
||||||
|
className={`relative max-w-6xl mx-auto liquid-glass-nav rounded-2xl sm:rounded-[22px] px-3.5 sm:px-6 py-2.5 sm:py-3 flex items-center justify-between transition-all duration-300 pointer-events-auto ${
|
||||||
isScrolled ? 'shadow-cream-lg' : 'shadow-cream-md'
|
isScrolled ? 'shadow-cream-lg' : 'shadow-cream-md'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
{/* Dynamic Specular Caustic Glint */}
|
||||||
|
<div
|
||||||
|
className="absolute inset-0 pointer-events-none transition-opacity duration-300 z-[2]"
|
||||||
|
style={{
|
||||||
|
opacity: mousePos.active ? 1 : 0.5,
|
||||||
|
background: `radial-gradient(ellipse 320px 110px at ${mousePos.x}% ${mousePos.y}%, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.2) 40%, transparent 75%)`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Brand Logo */}
|
{/* Brand Logo */}
|
||||||
<BrandLogo size="md" />
|
<BrandLogo size="md" />
|
||||||
|
|
||||||
{/* Center Navigation Links - Floating Glass Track */}
|
{/* Center Navigation Links - Floating Glass Track */}
|
||||||
<nav className="hidden md:flex items-center gap-1 px-1.5 py-1 rounded-full bg-slate-900/[0.03] border border-white/70 shadow-inner">
|
<nav className="hidden md:flex items-center gap-1 px-1.5 py-1 rounded-full bg-white/40 backdrop-blur-sm border border-white/80 shadow-inner">
|
||||||
{config.nav.header.map((item) => {
|
{config.nav.header.map((item) => {
|
||||||
const active = pathname === item.href;
|
const active = pathname === item.href;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user