Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
66 changes: 65 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
},
"dependencies": {
"axios": "^1.11.0",
"lucide-react": "^0.542.0",
"react": "^19.1.1",
"react-dom": "^19.1.1"
"react-dom": "^19.1.1",
"react-router-dom": "^7.8.2"
},
"devDependencies": {
"@eslint/js": "^9.33.0",
Expand Down
92 changes: 90 additions & 2 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,91 @@
import { useState } from 'react'
import { tvShows, movies, mustSeeHits } from "./data";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import SectionHeader from "./components/SectionHeader";
import ContentCard from "./components/ContentCard";
import FullListPage from "./components/FullListPage";

const App = () => {


return (
<Router>
<div className="bg-black min-h-screen p-8">
<div className="max-w-7xl mx-auto">
<Routes>

{/* TV Shows Section */}
<Route path="/"
element={
<>
<section className="mb-12">
<SectionHeader title="Top 10 TV Shows" to="/tvshows" />
<div className="flex gap-6 overflow-x-auto pb-4 scrollbar-hide">
{tvShows.map((show, index) => (
<ContentCard
key={show.id}
item={show}
index={index + 1}
isMovie={false}
/>
))}
</div>
</section>

{/* Movies Section */}
<section>
<SectionHeader title="Top 10 Movies" to="/movies"/>
<div className="flex gap-6 overflow-x-auto pb-4 scrollbar-hide">
{movies.map((movie, index) => (
<ContentCard
key={movie.id}
item={movie}
index={index + 1}
isMovie={true}
/>
))}
</div>
</section>

{/* Must-See Hits */}
<section>
<SectionHeader title="Must-See Hits" to="/must-see"/>
<div className="flex gap-6 overflow-x-auto pb-4 scrollbar-hide">
{mustSeeHits.map((item, index) => (
<ContentCard
key={item.id + "-mustsee"}
item={item}
index={index + 1}
/>
))}
</div>
</section>
</>
}
/>
{/* Full lists */}
<Route path="/tvshows" element={<FullListPage title="All TV Shows" items={tvShows} />} />
<Route path="/movies" element={<FullListPage title="All Movies" items={movies} />} />
<Route path="/mustsee" element={<FullListPage title="Must-See Hits" items={mustSeeHits} />} />
</Routes>
</div>
<style jsx>{`
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
`}</style>
</div>
</Router>
);
};

export default App;

{
/**
function App() {
const [count, setCount] = useState(0)

Expand Down Expand Up @@ -39,4 +125,6 @@ function App() {
)
}

export default App
export default App
*/
}
30 changes: 30 additions & 0 deletions frontend/src/components/ContentCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const ContentCard = ({ item, index, isMovie = false }) => (
<div className="flex-shrink-0 group cursor-pointer">
<div className="relative overflow-hidden rounded-lg bg-gray-800 transition-transform duration-300 group-hover:scale-105">
<img
src={item.image}
alt={item.title}
className="w-64 h-36 object-cover"
/>

<div className="absolute bottom-4 left-4 right-4">
<div className="flex items-center gap-2">
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent"></div>
</div>
</div>
</div>
<div className="mt-3 flex items-center">
<div className="bg-gray-700 rounded-full w-11 h-11 flex items-center justify-center text-white font-bold text-3xl mr-3">
{index}
</div>
<div>
<h4 className="text-white font-medium">{item.title}</h4>
<p className="text-gray-400 text-sm">
{isMovie ? `${item.year} · ${item.genre}` : item.genre}
</p>
</div>
</div>
</div>
);

export default ContentCard;
21 changes: 21 additions & 0 deletions frontend/src/components/FullListPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import ContentCard from "../components/ContentCard";

const FullListPage = ({ title, items }) => {
return (
<div>
<h1 className="text-white text-3xl font-bold mb-8">{title}</h1>
<div className="grid grid-cols-1 sm:grid-cols- md:grid-cols-4 lg:grid-cols-5 gap-4">
{items.map((item, index) => (
<ContentCard
key={item.id}
item={item}
index={index + 1}
isMovie={!!item.year} // detect if it's a movie
/>
))}
</div>
</div>
);
};

export default FullListPage;
15 changes: 15 additions & 0 deletions frontend/src/components/SectionHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ChevronRight } from "lucide-react";
import { Link } from "react-router-dom";

const SectionHeader = ({ title, to }) => (
<div className="flex items-center gap-1 mb-6">
<h2 className="text-white text-2xl font-bold">{title}</h2>
{to && (
<Link to={to}>
<ChevronRight className="text-gray-400 w-6 h-6 cursor-pointer hover:text-white transition" />
</Link>
)}
</div>
);

export default SectionHeader;
Loading