perf(animations): refactor ShiftableToolsGrid, cursor, hero & sections to locked 60-120fps with zero layout thrashing
This commit is contained in:
@@ -35,7 +35,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
}, [mobileMenuOpen]);
|
||||
|
||||
return (
|
||||
<header className="fixed top-0 left-0 right-0 w-full z-50 pointer-events-none transition-all duration-300">
|
||||
<header className="fixed top-0 left-0 right-0 w-full z-50 pointer-events-none">
|
||||
{/* 1. Ultra-Smooth High-Performance Gradient Blur Canopy (Zero lag, locks at 60/120fps) */}
|
||||
<div className="absolute top-0 inset-x-0 h-28 sm:h-32 pointer-events-none overflow-hidden select-none">
|
||||
{/* Single hardware-accelerated progressive blur */}
|
||||
@@ -57,7 +57,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
<div className="absolute top-0 inset-x-0 h-[1px] bg-gradient-to-r from-transparent via-white/80 to-transparent pointer-events-none z-30" />
|
||||
|
||||
{/* 3. Main Aligned Edge-to-Edge Navigation Bar */}
|
||||
<div className={`relative z-30 pointer-events-auto transition-all duration-300 ${isScrolled ? 'py-3' : 'py-3.5 sm:py-4'}`}>
|
||||
<div className="relative z-30 pointer-events-auto py-3 sm:py-3.5">
|
||||
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
|
||||
{/* Brand Logo */}
|
||||
<div className="relative z-20 flex-shrink-0">
|
||||
@@ -70,7 +70,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
<Link
|
||||
href="/"
|
||||
aria-current={pathname === '/' ? 'page' : undefined}
|
||||
className={`relative flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-all duration-200 ${
|
||||
className={`relative flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-[background-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
|
||||
pathname === '/'
|
||||
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
|
||||
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60'
|
||||
@@ -87,7 +87,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
aria-current={active ? 'page' : undefined}
|
||||
className={`relative px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-all duration-200 ${
|
||||
className={`relative px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-[background-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
|
||||
active
|
||||
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
|
||||
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60'
|
||||
@@ -112,7 +112,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
<div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
className="group relative inline-flex items-center gap-1.5 lg:gap-2 px-3.5 py-2 lg:px-5 lg:py-2.5 rounded-full text-xs font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 hover:shadow-lg hover:shadow-blue-500/35 transition-all duration-300 hover:scale-105 active:scale-95"
|
||||
className="group relative inline-flex items-center gap-1.5 lg:gap-2 px-3.5 py-2 lg:px-5 lg:py-2.5 rounded-full text-xs font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 hover:shadow-lg hover:shadow-blue-500/35 transition-[transform,opacity,box-shadow] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-105 active:scale-95"
|
||||
>
|
||||
<Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" />
|
||||
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
||||
|
||||
Reference in New Issue
Block a user