perf(smoothness): eliminate scroll lag via responsive WebP hero, native 120Hz smooth scroll, intersection observer navbar, and removing 50+ backdrop-filter blur bottlenecks
This commit is contained in:
@@ -268,21 +268,30 @@ export function HeroSection({
|
||||
// -------------------------------------------------------------
|
||||
return (
|
||||
<section className="relative min-h-[92vh] sm:min-h-screen flex items-center overflow-hidden bg-black pt-20 sm:pt-24 pb-14 sm:pb-20">
|
||||
{/* 1. Background Image with Left Dark Gradient Overlay */}
|
||||
<div className="absolute inset-0 z-0">
|
||||
<img
|
||||
src="/management/pages/home/Image_homepage.jpg"
|
||||
alt="CRE AI Photo Magic"
|
||||
className="w-full h-full object-cover object-[75%_center] sm:object-right-top select-none pointer-events-none"
|
||||
loading="eager"
|
||||
decoding="async"
|
||||
/>
|
||||
{/* 1. Background Image with Responsive Ultra-Fast Loading */}
|
||||
<div className="absolute inset-0 z-0 overflow-hidden">
|
||||
<picture>
|
||||
<source media="(max-width: 768px)" srcSet="/management/pages/home/hero_mobile.webp" type="image/webp" />
|
||||
<source media="(max-width: 768px)" srcSet="/management/pages/home/hero_mobile.jpg" type="image/jpeg" />
|
||||
<source srcSet="/management/pages/home/hero_desktop.webp" type="image/webp" />
|
||||
<img
|
||||
src="/management/pages/home/hero_desktop.jpg"
|
||||
alt="CRE AI Photo Magic"
|
||||
className="w-full h-full object-cover object-[75%_center] sm:object-right-top select-none pointer-events-none"
|
||||
loading="eager"
|
||||
fetchPriority="high"
|
||||
decoding="async"
|
||||
/>
|
||||
</picture>
|
||||
{/* Dark Gradient Overlay for Maximum Text Readability */}
|
||||
<div className="absolute inset-0 bg-gradient-to-r from-black/95 via-black/75 to-black/30 sm:via-black/55 sm:to-transparent" />
|
||||
<div className="absolute inset-0 bg-gradient-to-r from-black/95 via-black/75 to-black/30 sm:via-black/55 sm:to-transparent pointer-events-none" />
|
||||
{/* Smooth Bottom Blend to Section Below */}
|
||||
<div className="absolute inset-x-0 bottom-0 h-28 bg-gradient-to-t from-[#FAF8F5] via-[#FAF8F5]/70 to-transparent pointer-events-none" />
|
||||
</div>
|
||||
|
||||
{/* Zero-Overhead Scroll Sentinel for Navbar Transformation */}
|
||||
<div id="hero-sentinel" className="absolute bottom-28 left-0 w-full h-1 pointer-events-none opacity-0" aria-hidden="true" />
|
||||
|
||||
{/* 2. Left-Aligned Content Container */}
|
||||
<div className="relative z-10 max-w-[1640px] w-full mx-auto px-4 sm:px-8 lg:px-14 flex flex-col justify-center min-h-[90vh] sm:min-h-[92vh]">
|
||||
<div className="max-w-2xl sm:max-w-3xl">
|
||||
@@ -318,8 +327,8 @@ export function HeroSection({
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* Glass Metrics Pill Capsule */}
|
||||
<div className="mt-12 sm:mt-16 w-full max-w-2xl sm:max-w-3xl rounded-3xl sm:rounded-full bg-white/[0.06] backdrop-blur-xl border border-white/20 p-4 sm:py-4 sm:px-8 grid grid-cols-2 sm:grid-cols-4 gap-4 sm:gap-6 shadow-2xl">
|
||||
{/* Glass Metrics Pill Capsule (0% CPU, Hardware-Accelerated) */}
|
||||
<div className="mt-12 sm:mt-16 w-full max-w-2xl sm:max-w-3xl rounded-3xl sm:rounded-full bg-slate-950/75 border border-white/15 p-4 sm:py-4 sm:px-8 grid grid-cols-2 sm:grid-cols-4 gap-4 sm:gap-6 shadow-2xl">
|
||||
{/* Metric 1 */}
|
||||
<div className="flex flex-col text-left">
|
||||
<span className="text-xl sm:text-2xl font-display font-black tracking-tight text-blue-400">
|
||||
|
||||
Reference in New Issue
Block a user