Update homepage design and navigation for better user experience

Refactors the homepage component (`home.tsx`) to improve its visual appearance and navigation. This includes replacing `NetflixGrid` with `VideoCard`, updating the header with a sticky effect, and restyling the search input and icon.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 890577b1-c154-40a4-a177-a0c6d55320c3
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/890577b1-c154-40a4-a177-a0c6d55320c3/iQc0AVS
This commit is contained in:
sebastjanartic 2025-09-01 19:47:24 +00:00
parent 823006bbaf
commit dac2c566f9

View File

@ -1,7 +1,7 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { type Video } from "@shared/schema"; import { type Video } from "@shared/schema";
import NetflixGrid from "@/components/netflix-grid"; import VideoCard from "@/components/video-card";
import { Link } from "wouter"; import { Link } from "wouter";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Search, Menu, X } from "lucide-react"; import { Search, Menu, X } from "lucide-react";
@ -60,31 +60,33 @@ export default function Home() {
} }
}, [searchQuery, refetch]); }, [searchQuery, refetch]);
const handleVideoClick = (video: Video) => {
window.location.href = `/video/${video.id}`;
};
return ( return (
<div className="has-fixed-header" style={{minHeight: '100vh', background: 'linear-gradient(135deg, hsl(250, 50%, 15%) 0%, hsl(240, 30%, 25%) 100%)', color: 'white'}}> <div style={{minHeight: '100vh', background: 'linear-gradient(135deg, hsl(250, 50%, 15%) 0%, hsl(240, 30%, 25%) 100%)', color: 'white'}}>
{/* STICKY HEADER */} {/* Header */}
<div className="header-sticky bg-transparent overflow-hidden"> <header className="sticky top-0 z-50 bg-black/30 backdrop-blur-md border-b border-white/10">
<div className="container py-4"> <div className="container py-4">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
{/* Left side - Logo */} {/* Logo */}
<div className="flex items-center space-x-4"> <Link href="/" className="flex items-center space-x-3">
<Link href="/" className="flex items-center space-x-2 hover:opacity-80 transition-opacity"> <div className="w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg flex items-center justify-center">
<div className="w-9 h-9 gradient-primary rounded-lg flex items-center justify-center shadow-lg"> <div className="w-0 h-0 border-l-[12px] border-l-white border-y-[8px] border-y-transparent ml-1"></div>
<div className="w-0 h-0 border-l-[10px] border-l-white border-y-[7px] border-y-transparent ml-1"></div> </div>
</div> <h1 className="text-2xl font-bold text-white">go4.video</h1>
<h1 className="text-2xl font-bold text-white tracking-wide">go4.video</h1> </Link>
</Link>
</div>
{/* Right side - Navigation + Search */} {/* Navigation & Search */}
<div className="flex items-center gap-4"> <div className="flex items-center gap-6">
{/* Desktop navigation */} {/* Desktop navigation */}
<div className="hidden md:flex items-center space-x-6"> <div className="hidden md:flex items-center space-x-6">
<nav className="flex space-x-6"> <nav className="flex space-x-6">
<Link href="/" className="text-bunny-light hover:text-bunny-blue transition-colors"> <Link href="/" className="text-white/80 hover:text-white transition-colors">
Home Home
</Link> </Link>
<Link href="/folx-stadl" className="text-bunny-light hover:text-bunny-blue transition-colors"> <Link href="/folx-stadl" className="text-white/80 hover:text-white transition-colors">
FOLX STADL FOLX STADL
</Link> </Link>
</nav> </nav>
@ -95,71 +97,76 @@ export default function Home() {
placeholder="Videos suchen..." placeholder="Videos suchen..."
value={searchQuery} value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)} onChange={(e) => setSearchQuery(e.target.value)}
className="bg-white border border-gray-300 rounded-lg px-4 py-2 pl-10 text-sm text-gray-900 placeholder-gray-500 focus:outline-none focus:border-bunny-blue transition-colors w-64" className="bg-white/10 border-white/20 text-white placeholder-white/50 w-64"
/> />
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" /> <Search className="absolute right-3 top-1/2 transform -translate-y-1/2 text-white/50 w-4 h-4" />
</div> </div>
</div> </div>
{/* Mobile menu button */} {/* Mobile menu button */}
<button <button
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)} onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
className="md:hidden p-2 rounded-lg bg-white/10 hover:bg-white/20 transition-colors" className="md:hidden p-2 text-white"
data-testid="button-mobile-menu"
> >
{isMobileMenuOpen ? ( {isMobileMenuOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
<X className="w-6 h-6 text-white" />
) : (
<Menu className="w-6 h-6 text-white" />
)}
</button> </button>
</div> </div>
</div> </div>
</div>
{/* Mobile menu dropdown */} {/* Mobile Menu */}
{isMobileMenuOpen && ( {isMobileMenuOpen && (
<div className="md:hidden border-t border-white/20 bg-bunny-dark/95 backdrop-blur-md"> <div className="md:hidden mt-4 pt-4 border-t border-white/20">
<div className="px-4 py-3"> <nav className="flex flex-col space-y-3 mb-4">
<nav className="flex space-x-6 mb-3"> <Link href="/" className="text-white/80 hover:text-white">Home</Link>
<Link <Link href="/folx-stadl" className="text-white/80 hover:text-white">FOLX STADL</Link>
href="/"
className="text-bunny-light hover:text-bunny-blue transition-colors text-sm font-medium"
onClick={() => setIsMobileMenuOpen(false)}
>
Home
</Link>
<Link
href="/folx-stadl"
className="text-bunny-light hover:text-bunny-blue transition-colors text-sm font-medium"
onClick={() => setIsMobileMenuOpen(false)}
>
FOLX STADL
</Link>
</nav> </nav>
<div className="relative"> <div className="relative">
<Input <Input
type="search" type="search"
placeholder="Search..." placeholder="Suchen..."
value={searchQuery} value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)} onChange={(e) => setSearchQuery(e.target.value)}
className="bg-white border border-gray-300 rounded-lg px-3 py-2 pl-9 text-sm text-gray-900 placeholder-gray-500 focus:outline-none focus:border-bunny-blue transition-colors w-full" className="bg-white/10 border-white/20 text-white placeholder-white/50 w-full"
/> />
<Search className="absolute left-2.5 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" /> <Search className="absolute right-3 top-1/2 transform -translate-y-1/2 text-white/50 w-4 h-4" />
</div> </div>
</div> </div>
)}
</div>
</header>
{/* Main Content */}
<main className="container py-8">
{isLoading ? (
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4">
{Array.from({ length: 18 }).map((_, index) => (
<div key={index} className="animate-pulse">
<div className="bg-white/10 aspect-video rounded-lg mb-3"></div>
<div className="space-y-2">
<div className="h-4 bg-white/10 rounded w-3/4"></div>
<div className="h-3 bg-white/10 rounded w-1/2"></div>
</div>
</div>
))}
</div>
) : (
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4">
{allVideos.map((video) => (
<VideoCard
key={video.id}
video={video}
onClick={handleVideoClick}
className="hover:scale-105 transition-transform duration-200"
/>
))}
</div> </div>
)} )}
</div>
<main className="w-full pt-0 pb-8 relative"> {allVideos.length === 0 && !isLoading && (
<div className="container"> <div className="text-center py-12">
<NetflixGrid <div className="text-white/60 text-lg">Keine Videos gefunden</div>
videos={allVideos} </div>
isLoading={isLoading} )}
/>
</div>
</main> </main>
</div> </div>
); );