fix(hero+tools+navbar): uncrop complete image, dial down white gradient, vertical mobile tools list, and opaque solid mobile navbar

This commit is contained in:
2026-11-05 18:14:27 +05:30
parent d225e7ab6e
commit f8f7a737dc
4 changed files with 82 additions and 35 deletions
+7 -9
View File
@@ -270,7 +270,7 @@ export function HeroSection({
// -------------------------------------------------------------
return (
<section id="hero-section" className="relative min-h-[92vh] sm:min-h-screen flex items-center overflow-hidden bg-[#FAF8F5] pt-20 sm:pt-24 pb-14 sm:pb-20">
{/* 1. Background Image with Responsive Ultra-Fast Loading & Subtle Dimming */}
{/* 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" />
@@ -279,18 +279,16 @@ export function HeroSection({
<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 opacity-72 brightness-[0.82] contrast-[0.98]"
className="w-full h-full object-cover object-[75%_center] sm:object-right select-none pointer-events-none opacity-90 brightness-[0.95]"
loading="eager"
fetchPriority="high"
decoding="async"
/>
</picture>
{/* White / Cream Gradient Overlay: Extended towards the right (~88%) for smooth, balanced contrast */}
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5] from-30% via-[#FAF8F5]/90 via-55% via-[#FAF8F5]/50 via-75% to-transparent to-90% pointer-events-none" />
{/* Mobile vertical soft overlay to keep text completely readable on small screens */}
<div className="absolute inset-0 bg-gradient-to-b from-[#FAF8F5]/80 via-[#FAF8F5]/60 via-40% to-[#FAF8F5] sm:hidden pointer-events-none" />
{/* Perfect Bottom Fade: Seamlessly blends with upcoming scroll content (#our-tools) */}
<div className="absolute inset-x-0 bottom-0 h-44 sm:h-64 lg:h-80 bg-gradient-to-t from-[#FAF8F5] from-20% via-[#FAF8F5]/95 via-50% via-[#FAF8F5]/50 via-80% to-transparent pointer-events-none" />
{/* White / Cream Gradient Overlay: Restrained to left text side (~55%) so complete image stays vibrant & visible */}
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5] via-[#FAF8F5]/65 via-30% to-transparent to-55% pointer-events-none" />
{/* Soft Bottom Fade: Seamlessly blends into #our-tools without covering her necklace or shoulder */}
<div className="absolute inset-x-0 bottom-0 h-24 sm:h-32 lg:h-36 bg-gradient-to-t from-[#FAF8F5] via-[#FAF8F5]/85 via-40% to-transparent pointer-events-none" />
</div>
{/* Hero End Sentinel for exact scroll position detection */}
@@ -310,7 +308,7 @@ export function HeroSection({
</h1>
{/* Subtitle */}
<p className="mt-5 sm:mt-7 text-sm sm:text-base md:text-lg text-slate-600 max-w-xl text-left font-sans leading-relaxed">
<p className="mt-5 sm:mt-7 text-sm sm:text-base md:text-lg text-slate-800 sm:text-slate-600 max-w-xl text-left font-sans leading-relaxed font-medium">
Turn ordinary moments into extraordinary visual art, Instant, effortless, and private photo magic right in your browser.
</p>
@@ -134,12 +134,17 @@ export function ShiftableToolsGridSection({
</p>
</div>
{/* 2-Row Shiftable Grid Container (Slow, Calm, Pure Horizontal Expansion with Locked Height) */}
<div className="space-y-6 sm:space-y-8">
{/* Desktop View (md and up): 2-Row Shiftable Expansion Grid */}
<div className="hidden md:block space-y-8">
<ShiftableRow items={row1} />
<ShiftableRow items={row2} />
</div>
{/* Mobile / Phone View (<md): Pure Vertical Stack (NOT placed horizontally) */}
<div className="block md:hidden">
<MobileVerticalToolsList items={displayItems} />
</div>
{/* See More Section Button Redirecting to /tools */}
<div className="pt-6 text-center">
<Link
@@ -155,11 +160,55 @@ export function ShiftableToolsGridSection({
);
}
function MobileVerticalToolsList({ items }: { items: ToolMediaItem[] }) {
return (
<div className="flex flex-col gap-6 w-full">
{items.map((item) => (
<div key={item.id} className="w-full flex flex-col">
{item.mediaType === 'comparison' ? (
<div
style={{ borderRadius: '24px' }}
className="group block relative w-full h-[240px] rounded-[24px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm"
>
<ToolWindowMedia item={item} isHovered={false} />
<Link
href={`/tools/${item.slug}`}
className="absolute top-3 right-3 z-30 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-[10px] font-mono font-bold tracking-wider uppercase bg-slate-950/90 text-white border border-white/20 hover:bg-blue-600 transition-colors shadow-sm cursor-pointer"
aria-label={`Open ${item.title}`}
>
<span>TRY TOOL</span>
<ArrowRight className="w-2.5 h-2.5" />
</Link>
</div>
) : (
<Link
href={`/tools/${item.slug}`}
style={{ borderRadius: '24px' }}
className="group block relative w-full h-[240px] rounded-[24px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm cursor-pointer"
>
<ToolWindowMedia item={item} isHovered={false} />
</Link>
)}
{/* Title Below Window */}
<Link
href={`/tools/${item.slug}`}
className="mt-2.5 px-1 flex items-center justify-between text-sm font-display font-bold text-slate-900 hover:text-blue-600 transition-colors"
>
<span>{item.title}</span>
<ArrowRight className="w-4 h-4 text-slate-400 group-hover:text-blue-600 group-hover:translate-x-0.5 transition-transform" />
</Link>
</div>
))}
</div>
);
}
function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
const [hoveredId, setHoveredId] = useState<string | null>(null);
return (
<div className="flex flex-row md:flex-row gap-4 sm:gap-6 w-full items-start overflow-x-auto md:overflow-visible pb-2 no-scrollbar scroll-smooth snap-x snap-mandatory touch-pan-x -mx-4 px-4 md:mx-0 md:px-0">
<div className="flex flex-row gap-6 w-full items-start overflow-visible">
{items.map((item) => {
const isHovered = hoveredId === item.id;
const hasOtherHovered = hoveredId !== null && !isHovered;