From 8450e48375f87dba73e51e768f887bfc672dd014 Mon Sep 17 00:00:00 2001 From: Thanisha Date: Fri, 31 Jan 2025 21:18:08 +0530 Subject: [PATCH] Movie Crad --- frontend/src/components/Movies/MoviePage.css | 171 +++++++++---------- frontend/src/components/Movies/MoviePage.jsx | 26 +-- 2 files changed, 94 insertions(+), 103 deletions(-) diff --git a/frontend/src/components/Movies/MoviePage.css b/frontend/src/components/Movies/MoviePage.css index 0d0b577..cd7aa93 100644 --- a/frontend/src/components/Movies/MoviePage.css +++ b/frontend/src/components/Movies/MoviePage.css @@ -1,87 +1,86 @@ .movie-page { - padding: 20px; - color: white; - background-color: #1e272d; - } - - .movie-page h1 { - text-align: center; - margin-bottom: 20px; - font-size: 2rem; - } - - .movie-list { - display: flex; - flex-wrap: wrap; - gap: 20px; - justify-content: center; - } - - .movie-card { - background-color: #2c3e50; - padding: 20px; - border-radius: 10px; - width: 200px; - text-align: center; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); - transition: transform 0.2s; - } - - .movie-card:hover { - transform: scale(1.05); - } - - .movie-card img { - width: 100%; - border-radius: 10px; - } - - .movie-card h2 { - font-size: 18px; - margin: 10px 0; - } - - .movie-card p { - font-size: 14px; - color: #bdc3c7; - } - - .movie-buttons { - display: flex; - flex-wrap: wrap; - gap: 10px; - justify-content: center; - margin-top: 10px; - } - - .movie-buttons button { - background-color: #3498db; - color: white; - border: none; - padding: 5px 10px; - border-radius: 5px; - cursor: pointer; - transition: background-color 0.2s; - } - - .movie-buttons button:hover { - background-color: #2980b9; - } - - .movie-buttons .thumbs-up, - .movie-buttons .thumbs-down, - .movie-buttons .add-to-list, - .movie-buttons .download, - .movie-buttons .share { - background-color: transparent; - color: #bdc3c7; - font-size: 1.2rem; - } - - .movie-buttons .thumbs-up:hover, - .movie-buttons .thumbs-down:hover, - .movie-buttons .add-to-list:hover, - .movie-buttons .download:hover, - .movie-buttons .share:hover { - color: white; - } \ No newline at end of file + padding: 20px; + color: white; + background-color: #141414; +} + +.movie-page h1 { + text-align: center; + margin-bottom: 20px; + font-size: 2.5rem; + color: #ff5722; +} + +.movie-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 20px; + justify-content: center; +} + +.movie-card { + background-color: #1e272d; + border-radius: 10px; + overflow: hidden; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; +} + +.movie-card:hover { + transform: translateY(-10px); + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); +} + +.movie-card-header { + position: relative; +} + +.movie-image { + width: 100%; + height: auto; + display: block; +} + +.movie-card-body { + padding: 20px; + text-align: center; +} + +.movie-card-body h2 { + font-size: 1.5rem; + margin: 10px 0; + color: #ff5722; +} + +.movie-card-body p { + font-size: 1rem; + color: #bdc3c7; + margin-bottom: 10px; +} + +.movie-details { + display: flex; + justify-content: space-around; + margin-bottom: 10px; + color: #90A4AE; +} + +.movie-buttons { + display: flex; + flex-direction: column; + gap: 10px; +} + +.movie-buttons button { + background-color: #ff5722; + color: white; + border: none; + padding: 10px; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s ease-in-out; +} + +.movie-buttons button:hover { + background-color: #e64a19; +} \ No newline at end of file diff --git a/frontend/src/components/Movies/MoviePage.jsx b/frontend/src/components/Movies/MoviePage.jsx index c814a68..263429f 100644 --- a/frontend/src/components/Movies/MoviePage.jsx +++ b/frontend/src/components/Movies/MoviePage.jsx @@ -1,6 +1,7 @@ import { useState, useEffect } from "react"; import { getAllMovies } from "../../api/Movie_api/getAllmovie"; import "./MoviePage.css"; +import { Link } from "react-router-dom"; const MoviePage = () => { const [movies, setMovies] = useState([]); @@ -9,7 +10,7 @@ const MoviePage = () => { const fetchMovies = async () => { try { const movies = await getAllMovies(); - console.log("Fetched movies:", movies); // Add this line + console.log("Fetched movies:", movies); setMovies(movies); } catch (error) { console.error("Error fetching movies:", error); @@ -21,24 +22,15 @@ const MoviePage = () => { return (
-

Season 1

-
+
{movies.map((movie) => ( -
- {movie.title} -

{movie.title}

-

{movie.description}

-
- - - - - - - - + +
+
+ {movie.title} +
-
+ ))}