From f9c98a87b4e1f3e0c0ab7dc1b12c1e70f6695a7c Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Tue, 3 Nov 2026 18:30:13 +0530 Subject: [PATCH] feat(ui): refine homepage and improve core interactions --- src/components/sections/HeroSection.tsx | 134 +++++++----------------- src/components/sections/TryItWidget.tsx | 16 +++ src/components/ui/Navbar.tsx | 23 +++- 3 files changed, 71 insertions(+), 102 deletions(-) diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index 06f5000..f50b6ea 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -2,14 +2,13 @@ import React from 'react'; import Link from 'next/link'; -import { Sparkles, ArrowRight, Smartphone, Layers, Zap } from 'lucide-react'; +import { Sparkles, ArrowRight, Smartphone, Layers, ShieldCheck, LockKeyhole, ImagePlus } from 'lucide-react'; import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types'; import { TryItWidget } from './TryItWidget'; import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas'; import { Kinetic3DText } from '@/components/ui/Kinetic3DText'; import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge'; import { BorderBeam } from '@/components/animate-ui/BorderBeam'; -import { MorphingText } from '@/components/animate-ui/MorphingText'; interface HeroSectionProps { title?: any; @@ -41,108 +40,49 @@ export function HeroSection({ if (variant === 'tryit' && tool) { return ( -
- {/* Ambient Radial Lighting Glow */} -
+
+
+ -
- {/* Subtle Massive 3D Background Typographic Watermark (Enigma Style) */} - +
+
+
+
+ + {resolvedBadge || 'A calmer way to create'} +
- {/* 3D Ambient Kinetic Prism Floating Behind Header */} -
- -
+ - {/* Main Hero Header */} -
- {/* Live Core Status & Animate UI Shimmer Badge */} -
- - - - - - {resolvedBadge || 'NEXT-GEN NEURAL STUDIO v4.2'} - +
+ + Explore the tools + + + Our apps + +
-
- FP16 LOSSLESS PIPELINE +
+ No account needed + Photos aren’t stored + Try with a sample
- {/* 3D Kinetic Interactive Typography */} - - - {/* Pixelcut-Style Dynamic Morphing Capability Bar */} -
- Live Engine Focus: - - - -
- - {/* Pixelcut-Style Interactive Tool Chips */} -
- - ✨ Retouch Skin - - - ✂️ Cut Out Hair - - - 🔍 4K Upscale - - - 🎨 Colorize B&W - -
-
- - {/* Embedded Interactive Free Try-It Widget wrapped with Animate UI Border Beam */} -
-
- - +
+
+
+
+ +
diff --git a/src/components/sections/TryItWidget.tsx b/src/components/sections/TryItWidget.tsx index 11bfeb5..a625c0f 100644 --- a/src/components/sections/TryItWidget.tsx +++ b/src/components/sections/TryItWidget.tsx @@ -61,6 +61,12 @@ export function TryItWidget({ const handleFileChange = (file: File) => { const maxMB = tool.tryIt?.limits?.maxMB || 12; + const acceptedTypes = ['image/jpeg', 'image/png', 'image/webp']; + if (!acceptedTypes.includes(file.type)) { + setStatus('error'); + setErrorMessage('Choose a JPG, PNG, or WebP image.'); + return; + } if (file.size > maxMB * 1024 * 1024) { setStatus('error'); setErrorMessage(`File exceeds ${maxMB}MB limit.`); @@ -210,6 +216,15 @@ export function TryItWidget({ }} onDragLeave={() => setIsDragOver(false)} onClick={() => fileInputRef.current?.click()} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + fileInputRef.current?.click(); + } + }} + role="button" + tabIndex={0} + aria-label="Choose a JPG, PNG, or WebP photo to edit" className={`border-2 border-dashed rounded-3xl p-8 sm:p-14 text-center cursor-pointer transition-all duration-300 group ${ isDragOver ? 'border-blue-500 bg-blue-50/50 scale-[1.01]' @@ -220,6 +235,7 @@ export function TryItWidget({ ref={fileInputRef} type="file" accept="image/jpeg,image/png,image/webp" + accept="image/jpeg,image/png,image/webp" className="hidden" onChange={(e) => e.target.files?.[0] && handleFileChange(e.target.files[0])} /> diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index 212559a..eb1d362 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -27,6 +27,15 @@ export function Navbar({ config, currentLocale }: NavbarProps) { return () => window.removeEventListener('scroll', handleScroll); }, []); + useEffect(() => { + if (!mobileMenuOpen) return; + const closeOnEscape = (event: KeyboardEvent) => { + if (event.key === 'Escape') setMobileMenuOpen(false); + }; + document.addEventListener('keydown', closeOnEscape); + return () => document.removeEventListener('keydown', closeOnEscape); + }, [mobileMenuOpen]); + const handleMouseMove = (e: React.MouseEvent) => { if (!glintRef.current) return; const rect = e.currentTarget.getBoundingClientRect(); @@ -71,11 +80,12 @@ export function Navbar({ config, currentLocale }: NavbarProps) { {/* Center Navigation Links - Protected Optical Floating Pill */} )} );