amazon.nova-pro-v1:0 LMArena Human Preference 140K
--- π― Prompt for Gemini (Frontend-Only YouTube Clone) π§© Project Overview: Build aβ¦
- User
π― Prompt for Gemini (Frontend-Only YouTube Clone)
π§© Project Overview:
Build a YouTube Clone UI using React.js + Tailwind CSS, with fully embedded playable videos. The app must not use any backend and should use static video data (JSON/JS array). The goal is to replicate the visual layout and interactivity of YouTube, based on the attached screenshots.
π§ Technologies to Use:
- React.js (with React Router DOM)
- Tailwind CSS
- HTML5 Video Element
- Dummy video data (JS array of objects)
- No backend or API calls
π App Structure
src/ βββ App.jsx βββ main.jsx βββ data/ β βββ videos.js βββ components/ β βββ Navbar.jsx β βββ Sidebar.jsx β βββ VideoCard.jsx β βββ VideoGrid.jsx β βββ VideoPlayer.jsx β βββ RelatedVideos.jsx βββ pages/ β βββ Home.jsx β βββ Watch.jsx
π‘ Key Features to Implement
1. Navbar (Top Bar)
- Show logo "YouTube Clone"
- Search bar (non-functional)
- "Create", "Bell" icons (dummy)
- Avatar on the right
2. Sidebar (Left Menu)
-
Show vertical menu with:
- Home
- Shorts
- Subscriptions
- History, Playlists, etc.
-
Responsive (collapses on mobile)
3. Home Page (****
/****)- Display video cards in 3-column grid
- Use dummy video array with fields like:
{ id: "1", title: "Learn React in 10 Minutes", channel: "DevTutor", views: "200K views", date: "3 days ago", thumbnail: "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg", videoUrl: "https://www.w3schools.com/html/mov_bbb.mp4" }-
Each card must show:
- Thumbnail (image)
- Title
- Channel name
- Views + Time
-
Clicking a card routes to
/watch/:id
4. Watch Page (****
/watch/:id****)- Display HTML5
<video>element with controls - Show title, channel, likes (dummy), date
- "Subscribe" button (non-functional)
- Description below video
- Autoplay selected video based on ID from dummy data
- Sidebar on the right with Related Videos (map from same dummy data, except current one)
5. Video Playback
- Use embedded video element:
<video controls className="w-full h-auto rounded-lg"> <source src={video.videoUrl} type="video/mp4" /> Your browser does not support the video tag. </video>- Supports local file links or public MP4 links (like W3Schools videos)
π§ Bonus Features (Optional for Gemini to Try)
- Video player layout matches YouTube (left video, right suggestions)
- Scroll behavior and sticky sidebar
- Lazy load thumbnails
- Responsive mobile-first layout
- Tailwind dark mode support
π§ͺ Testing Goals for Gemini
- Can Gemini build a Home + Watch layout UI like YouTube from images
- Can Gemini map a video ID to actual embedded playback
- Can Gemini render a list of related videos excluding the current one
- Can Gemini structure clean reusable components
β Final Output Expectation
A complete React + Tailwind project with:
- Working routing
- Embedded playable videos
- Static data-driven pages
- No backend, no API
- Fully responsive YouTube-like layout
- Mirrors the layout from the provided screenshots
- Assistant
Here's a complete implementation of the YouTube Clone UI using React.js and Tailwind CSS, following the provided structure and requirements.
Project Structure
src/ βββ App.jsx βββ main.jsx βββ data/ β βββ videos.js βββ components/ β βββ Navbar.jsx β βββ Sidebar.jsx β βββ VideoCard.jsx β βββ VideoGrid.jsx β βββ VideoPlayer.jsx β βββ RelatedVideos.jsx βββ pages/ β βββ Home.jsx β βββ Watch.jsxImplementation
src/data/videos.jsexport const videos = [ { id: "1", title: "Learn React in 10 Minutes", channel: "DevTutor", views: "200K views", date: "3 days ago", thumbnail: "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg", videoUrl: "https://www.w3schools.com/html/mov_bbb.mp4", description: "A quick tutorial on React.js basics." }, { id: "2", title: "Introduction to Tailwind CSS", channel: "StyleMaster", views: "150K views", date: "5 days ago", thumbnail: "https://i.ytimg.com/vi/XGSy3_Czz8k/hqdefault.jpg", videoUrl: "https://www.w3schools.com/html/movie.mp4", description: "Learn how to use Tailwind CSS for styling." }, // Add more videos as needed ];src/components/Navbar.jsximport React from 'react'; import { Link } from 'react-router-dom'; const Navbar = () => { return ( <nav className="bg-gray-800 p-4 flex justify-between items-center"> <div className="text-white font-bold text-xl">YouTube Clone</div> <div className="flex items-center space-x-4"> <input type="text" placeholder="Search" className="bg-gray-700 text-white p-2 rounded" /> <div className="text-white">Create</div> <div className="text-white">Bell</div> <img src="https://via.placeholder.com/30" alt="Avatar" className="w-8 h-8 rounded-full" /> </div> </nav> ); }; export default Navbar;src/components/Sidebar.jsximport React from 'react'; import { Link } from 'react-router-dom'; const Sidebar = () => { return ( <div className="bg-gray-800 text-white w-64 p-4"> <ul> <li><Link to="/" className="block p-2">Home</Link></li> <li><Link to="/" className="block p-2">Shorts</Link></li> <li><Link to="/" className="block p-2">Subscriptions</Link></li> <li><Link to="/" className="block p-2">History</Link></li> <li><Link to="/" className="block p-2">Playlists</Link></li> </ul> </div> ); }; export default Sidebar;src/components/VideoCard.jsximport React from 'react'; import { Link } from 'react-router-dom'; const VideoCard = ({ video }) => { return ( <Link to={`/watch/${video.id}`} className="block p-4 bg-gray-800 rounded-lg"> <img src={video.thumbnail} alt={video.title} className="w-full h-auto rounded-lg mb-2"/> <h3 className="text-white font-bold">{video.title}</h3> <p className="text-gray-400 text-sm">{video.channel}</p> <p className="text-gray-400 text-xs">{video.views} β’ {video.date}</p> </Link> ); }; export default VideoCard;src/components/VideoGrid.jsximport React from 'react'; import VideoCard from './VideoCard'; import { videos } from '../data/videos'; const VideoGrid = () => { return ( <div className="grid grid-cols-1 md:grid-cols-3 gap-4"> {videos.map(video => ( <VideoCard key={video.id} video={video} /> ))} </div> ); }; export default VideoGrid;src/components/VideoPlayer.jsximport React from 'react'; const VideoPlayer = ({ videoUrl }) => { return ( <video controls className="w-full h-auto rounded-lg"> <source src={videoUrl} type="video/mp4" /> Your browser does not support the video tag. </video> ); }; export default VideoPlayer;src/components/RelatedVideos.jsximport React from 'react'; import VideoCard from './VideoCard'; import { videos } from '../data/videos'; const RelatedVideos = ({ currentVideoId }) => { const relatedVideos = videos.filter(video => video.id !== currentVideoId); return ( <div className="space-y-4"> {relatedVideos.map(video => ( <VideoCard key={video.id} video={video} /> ))} </div> ); }; export default RelatedVideos;src/pages/Home.jsximport React from 'react'; import VideoGrid from '../components/VideoGrid'; import Sidebar from '../components/Sidebar'; import Navbar from '../components/Navbar'; const Home = () => { return ( <div className="flex"> <Sidebar /> <div className="flex-1"> <Navbar /> <VideoGrid /> </div> </div> ); }; export default Home;src/pages/Watch.jsximport React from 'react'; import { useParams } from 'react-router-dom'; import VideoPlayer from '../components/VideoPlayer'; import RelatedVideos from '../components/RelatedVideos'; import { videos } from '../data/videos'; const Watch = () => { const { id } = useParams(); const video = videos.find(video => video.id === id); if (!video) { return <div>Video not found</div>; } return ( <div className="flex"> <div className="flex-1 p-4"> <VideoPlayer videoUrl={video.videoUrl} /> <h2 className="text-white text-2xl font-bold mt-4">{video.title}</h2> <p className="text-gray-400">{video.channel}</p> <p className="text-gray-400">{video.views} β’ {video.date}</p> <p className="text-white mt-4">{video.description}</p> </div> <div className="w-64"> <RelatedVideos currentVideoId={id} /> </div> </div> ); }; export default Watch;src/App.jsximport React from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; import Home from './pages/Home'; import Watch from './pages/Watch'; const App = () => { return ( <Router> <Routes> <Route path="/" element={<Home />} /> <Route path="/watch/:id" element={<Watch />} /> </Routes> </Router> ); }; export default App;src/main.jsximport React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import './index.css'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <React.StrictMode> <App /> </React.StrictMode> );src/index.css@tailwind base; @tailwind components; @tailwind utilities; body { @apply bg-gray-900 text-white; }Explanation
- Navbar: Displays the logo, search bar, and dummy icons.
- Sidebar: Displays a vertical menu with links.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- o3-miniCompare side by side β
- claude-sonnet-4-20250514Compare side by side β
- command-a-03-2025Compare side by side β
- llama-4-maverick-17b-128e-instructCompare side by side β
- qwq-32bCompare side by side β
- grok-3-preview-02-24Compare side by side β
- deepseek-v3-0324Compare side by side β
- claude-3-7-sonnet-20250219Compare side by side β
- gemini-2.5-proCompare side by side β