From acba642b0590ba611609f041d4c048c0f297ef63 Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Thu, 5 Nov 2026 17:24:02 +0530 Subject: [PATCH] fix(mobile+navbar): remove white cloudy bottom haze, immediate solid navbar transition on scroll, and restore horizontal category scroller on mobile --- src/components/sections/HeroSection.tsx | 2 - .../sections/ShiftableToolsGridSection.tsx | 4 +- src/components/sections/ToolGridSection.tsx | 39 ++++++++++++++----- src/components/ui/Navbar.tsx | 32 +++++---------- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index 775f133..95fd550 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -285,8 +285,6 @@ export function HeroSection({ {/* Dark Gradient Overlay for Maximum Text Readability */}
- {/* Smooth Bottom Blend to Section Below */} -
{/* Zero-Overhead Scroll Sentinel for Navbar Transformation */} diff --git a/src/components/sections/ShiftableToolsGridSection.tsx b/src/components/sections/ShiftableToolsGridSection.tsx index d16ad7e..6dd0031 100644 --- a/src/components/sections/ShiftableToolsGridSection.tsx +++ b/src/components/sections/ShiftableToolsGridSection.tsx @@ -159,7 +159,7 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) { const [hoveredId, setHoveredId] = useState(null); return ( -
+
{items.map((item) => { const isHovered = hoveredId === item.id; const hasOtherHovered = hoveredId !== null && !isHovered; @@ -182,7 +182,7 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) { flexShrink: 1, flexBasis: '0%', }} - className="w-full transition-[flex-grow] duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] will-change-[flex-grow] flex flex-col min-w-0" + className="w-[82vw] sm:w-[320px] md:w-full shrink-0 md:shrink snap-start transition-[flex-grow] duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] will-change-[flex-grow] flex flex-col min-w-0" > {/* Window Container with strictly locked pixel height & landscape aspect */} {item.mediaType === 'comparison' ? ( diff --git a/src/components/sections/ToolGridSection.tsx b/src/components/sections/ToolGridSection.tsx index 20b94e8..f91becf 100644 --- a/src/components/sections/ToolGridSection.tsx +++ b/src/components/sections/ToolGridSection.tsx @@ -478,12 +478,23 @@ export function ToolGridSection({
{searchResults.length > 0 ? ( - /* High-Density 2-Col Grid on Phones, Responsive 3-Col Grid on Web */ -
- {searchResults.map((tool) => ( - - ))} -
+ <> + {/* Search Results Mobile Horizontal Scroller */} +
+ {searchResults.map((tool) => ( +
+ +
+ ))} +
+ + {/* Search Results Web Responsive Grid */} +
+ {searchResults.map((tool) => ( + + ))} +
+ ) : (

@@ -569,10 +580,18 @@ export function ToolGridSection({

- {/* Responsive Visual Grid: - - 2-Column High-Density Visual Gallery on Phones (< sm) - - 3-Column Responsive Grid on Web/Desktop (>= sm) that continuously fills as tools are added */} -
+ {/* Category Tools Layout: + - Phones (< sm): Smooth horizontal scroller with prominent cards & snapping + - Web / Desktop (>= sm): Grid that keeps filling inside naturally */} +
+ {group.tools.map((tool) => ( +
+ +
+ ))} +
+ +
{group.tools.map((tool) => ( ))} diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index f2f978c..9ad0407 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -17,36 +17,22 @@ export function Navbar({ config, currentLocale }: NavbarProps) { const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const pathname = usePathname(); - // 100% Off-Main-Thread Observer: 0% CPU, 0 Scroll Lag + // Fast, scroll-aware navbar transformation: + // - Homepage at rest (scrollY <= 25): Transparent text buttons over dark hero + // - As soon as scrolled (scrollY > 25) or on any other page: Transforms into solid navbar useEffect(() => { - // On non-homepage pages, navbar is immediately in solid state if (pathname !== '/') { setIsScrolled(true); return; } - setIsScrolled(false); - const sentinel = document.getElementById('hero-sentinel'); - if (!sentinel) { - const handleScroll = () => { - setIsScrolled(window.scrollY > 400); - }; - window.addEventListener('scroll', handleScroll, { passive: true }); - return () => window.removeEventListener('scroll', handleScroll); - } + const checkScroll = () => { + setIsScrolled(window.scrollY > 25); + }; - const observer = new IntersectionObserver( - ([entry]) => { - setIsScrolled(!entry.isIntersecting && entry.boundingClientRect.top < 0); - }, - { - threshold: 0, - rootMargin: '-60px 0px 0px 0px', - } - ); - - observer.observe(sentinel); - return () => observer.disconnect(); + checkScroll(); + window.addEventListener('scroll', checkScroll, { passive: true }); + return () => window.removeEventListener('scroll', checkScroll); }, [pathname]); // Close mobile menu on Escape key