Skip to content

Commit 270c641

Browse files
authored
Add cinematic dark mode, movie cards, login & signup pages (#79)
1 parent 90fa69c commit 270c641

File tree

6 files changed

+189
-3
lines changed

6 files changed

+189
-3
lines changed

src/App.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import "./App.css";
2+
3+
/* Dark mode background */
4+
body.dark-mode {
5+
background: linear-gradient(180deg, #0b0c10 0%, #1f2833 50%, #0b0c10 100%);
6+
color: #e0e0e0;
7+
transition: background 0.5s ease, color 0.5s ease;
8+
}
9+
10+
/* Movie cards */
11+
.movie-card {
12+
background-color: #1a1a1a;
13+
border-radius: 8px;
14+
box-shadow: 0 0 15px rgba(255, 255, 255, 0.05), 0 4px 10px rgba(0, 0, 0, 0.5);
15+
transition: box-shadow 0.3s ease, transform 0.3s ease;
16+
padding: 20px;
17+
margin: 15px;
18+
}
19+
20+
/* Hover effect for cinematic glow */
21+
.movie-card:hover {
22+
box-shadow: 0 0 25px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.7);
23+
transform: scale(1.03);
24+
}

src/app/App.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
1+
import { useEffect, useState } from "react";
12
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
23
import Login from "./login/page";
34
import Signup from "./signup/page";
45
import Home from "../app/movies/pages/Home";
5-
6+
import "./App.css";
67

78
function App() {
9+
const [darkMode, setDarkMode] = useState(true); // default dark mode
10+
11+
useEffect(() => {
12+
if (darkMode) {
13+
document.body.classList.add("dark-mode");
14+
} else {
15+
document.body.classList.remove("dark-mode");
16+
}
17+
}, [darkMode]);
18+
819
return (
920
<Router>
21+
{/* Optional toggle button for testing */}
22+
<button
23+
onClick={() => setDarkMode(!darkMode)}
24+
style={{
25+
position: "fixed",
26+
top: 10,
27+
right: 10,
28+
zIndex: 1000,
29+
padding: "5px 10px",
30+
}}
31+
>
32+
{darkMode ? "Light Mode" : "Dark Mode"}
33+
</button>
34+
1035
<Routes>
11-
<Route path="/" element={<Home />} />
36+
<Route path="/" element={<Home />} />
1237
<Route path="/login" element={<Login />} />
1338
<Route path="/signup" element={<Signup />} />
1439
</Routes>
1540
</Router>
1641
);
1742
}
1843

19-
export default App;
44+
export default App;

src/app/home.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import "./Home.css";
2+
.home-container {
3+
padding: 20px;
4+
text-align: center;
5+
}
6+
7+
.movies-grid {
8+
display: flex;
9+
flex-wrap: wrap;
10+
justify-content: center;
11+
gap: 20px;
12+
}
13+
14+
/* Movie cards with cinematic glow */
15+
.movie-card {
16+
background-color: #1a1a1a;
17+
border-radius: 8px;
18+
box-shadow: 0 0 15px rgba(255, 255, 255, 0.05),
19+
0 4px 10px rgba(0, 0, 0, 0.5);
20+
transition: box-shadow 0.3s ease, transform 0.3s ease;
21+
width: 200px;
22+
padding: 10px;
23+
}
24+
25+
.movie-card img {
26+
width: 100%;
27+
border-radius: 8px;
28+
}
29+
30+
.movie-card:hover {
31+
box-shadow: 0 0 25px rgba(255, 255, 255, 0.1),
32+
0 8px 20px rgba(0, 0, 0, 0.7);
33+
transform: scale(1.03);
34+
}
35+
36+
/* Dark mode background is handled in App.css */

src/app/home.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from "react";
2+
import "./Home.css"; // We'll create this CSS for movie cards
3+
4+
const movies = [
5+
{
6+
id: 1,
7+
title: "Inception",
8+
poster: "https://via.placeholder.com/200x300?text=Inception",
9+
description: "Mind-bending thriller by Christopher Nolan",
10+
},
11+
{
12+
id: 2,
13+
title: "Interstellar",
14+
poster: "https://via.placeholder.com/200x300?text=Interstellar",
15+
description: "Epic space exploration movie",
16+
},
17+
{
18+
id: 3,
19+
title: "The Dark Knight",
20+
poster: "https://via.placeholder.com/200x300?text=The+Dark+Knight",
21+
description: "Batman fights crime in Gotham",
22+
},
23+
];
24+
25+
export default function Home() {
26+
return (
27+
<div className="home-container">
28+
<h1>Now Showing 🍿</h1>
29+
<div className="movies-grid">
30+
{movies.map((movie) => (
31+
<div key={movie.id} className="movie-card">
32+
<img src={movie.poster} alt={movie.title} />
33+
<h2>{movie.title}</h2>
34+
<p>{movie.description}</p>
35+
</div>
36+
))}
37+
</div>
38+
</div>
39+
);
40+
}

src/app/layout.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"use client";
2+
import { useState, useEffect } from "react";
3+
import "../App.css"; // global dark mode
4+
5+
export default function RootLayout({ children }) {
6+
const [darkMode, setDarkMode] = useState(true);
7+
8+
useEffect(() => {
9+
if (darkMode) {
10+
document.body.classList.add("dark-mode");
11+
} else {
12+
document.body.classList.remove("dark-mode");
13+
}
14+
}, [darkMode]);
15+
16+
return (
17+
<>
18+
{/* Dark mode toggle button */}
19+
<button
20+
onClick={() => setDarkMode(!darkMode)}
21+
style={{
22+
position: "fixed",
23+
top: 10,
24+
right: 10,
25+
zIndex: 1000,
26+
padding: "5px 10px",
27+
cursor: "pointer",
28+
}}
29+
>
30+
{darkMode ? "Light Mode" : "Dark Mode"}
31+
</button>
32+
33+
{children}
34+
</>
35+
);
36+
}

src/app/page.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from "react";
2+
import "./Home.css"; // adjust path if needed
3+
4+
const movies = [
5+
{ id: 1, title: "Inception", poster: "https://via.placeholder.com/200x300?text=Inception", description: "Mind-bending thriller" },
6+
{ id: 2, title: "Interstellar", poster: "https://via.placeholder.com/200x300?text=Interstellar", description: "Epic space exploration" },
7+
{ id: 3, title: "The Dark Knight", poster: "https://via.placeholder.com/200x300?text=The+Dark+Knight", description: "Batman fights crime" }
8+
];
9+
10+
export default function Home() {
11+
return (
12+
<div className="home-container">
13+
<h1>Now Showing 🍿</h1>
14+
<div className="movies-grid">
15+
{movies.map((movie) => (
16+
<div key={movie.id} className="movie-card">
17+
<img src={movie.poster} alt={movie.title} />
18+
<h2>{movie.title}</h2>
19+
<p>{movie.description}</p>
20+
</div>
21+
))}
22+
</div>
23+
</div>
24+
);
25+
}

0 commit comments

Comments
 (0)