From 1e7d7891d0ea34679d48af30fd0482a92fc48b3c Mon Sep 17 00:00:00 2001 From: Norbert Maciaszek Date: Sat, 16 Aug 2025 15:55:03 +0200 Subject: [PATCH] Enhance MovieCard component with new "aurora" layout: introduce a visually stunning design with gradient backgrounds, improved card interactions, and additional status indicators. Update MovieList to utilize the new layout for a more engaging user experience. --- src/app/search/page.tsx | 2 +- src/components/atoms/MovieCard/index.tsx | 199 ++++++++++++++++++- src/components/molecules/MovieList/index.tsx | 2 +- 3 files changed, 198 insertions(+), 5 deletions(-) diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 23af2d9..16c172d 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -10,7 +10,7 @@ export default async function SearchPage({ return ( <>
-

+

Wyszukiwanie: {s}

diff --git a/src/components/atoms/MovieCard/index.tsx b/src/components/atoms/MovieCard/index.tsx index 8da3010..6bbac81 100644 --- a/src/components/atoms/MovieCard/index.tsx +++ b/src/components/atoms/MovieCard/index.tsx @@ -1,5 +1,5 @@ "use client"; -import { FC } from "react"; +import { FC, useState } from "react"; import { ReadMore } from "../ReadMore"; import { addMovie, deleteMovie, updateMovie } from "@/lib/db"; import { useGlobalStore } from "@/app/store/globalStore"; @@ -7,11 +7,11 @@ import { MdFavorite, MdFavoriteBorder, MdOutlinePostAdd } from "react-icons/md"; import { RxEyeClosed, RxEyeOpen } from "react-icons/rx"; import { IoMdRemoveCircleOutline } from "react-icons/io"; import { Movie } from "@/types/global"; -import { FaFire } from "react-icons/fa"; +import { FaAngleUp, FaArrowUp, FaFire, FaTrash } from "react-icons/fa"; import { RiCalendarCheckLine, RiCalendarScheduleLine } from "react-icons/ri"; type Props = Movie & { - layout?: "default" | "zeus" | "minimal"; + layout?: "default" | "zeus" | "minimal" | "aurora"; showDayCounter?: boolean; simpleToggle?: boolean; }; @@ -25,6 +25,7 @@ export const MovieCard: FC = ({ simpleToggle = false, ...movie }) => { + const [isExpanded, setIsExpanded] = useState(false); const { movies, addMovie: addMovieToStore, @@ -75,6 +76,198 @@ export const MovieCard: FC = ({ ) ); + // Aurora theme - creative and visually stunning. + if (layout === "aurora") { + const scoreColor = + vote_average >= 8 + ? "from-emerald-400 to-teal-400" + : vote_average >= 6 + ? "from-yellow-400 to-orange-400" + : "from-red-400 to-pink-400"; + + return ( +
setIsExpanded(false)} + > + {/* Aurora background effect */} +
+
+ + {/* Main card container */} +
+ {/* Image section with sophisticated overlay */} +
+ {title} + + {/* Gradient overlays for depth */} +
+
+ + {/* Floating rating badge */} + {!!vote_average && ( +
+
+
+ + {vote_average.toFixed(1)} +
+
+
+ )} + + {/* Popularity indicator */} +
+
+ + + {Math.round(popularity)} + +
+
+ + {/* x Days left to release */} + {(!isReleased || daysSinceRelease < 35) && ( +
+
+ + {isReleased && + daysSinceRelease < 35 && + `od ${daysSinceRelease} dni`} + {!isReleased && `za ${daysSinceRelease} dni`} + +
+
+ )} + + {/* Status indicators */} + {alreadyInStore && ( +
+
+ +
+
+ +
+
+ +
+
+ )} + + {/* Magical action overlay */} + {!alreadyInStore && ( +
+ +
+ )} +
+ + {/* Content section with glowing effects */} +
+ {/* Subtle glow effect */} +
+ +
+

+ {title} +

+

setIsExpanded(!isExpanded)} + > + {overview} +

+
+ + {/* Bottom section with enhanced styling */} +
+
+
+ {isReleased ? ( + + ) : ( + + )} + + {releaseDate.toLocaleDateString("pl-PL", { + day: "numeric", + month: "short", + year: "numeric", + })} + +
+
+ + {alreadyInStore && ( +
+ {seen && ( +
+ )} + {favorite && ( +
+ )} +
+ )} +
+
+ + {/* Decorative border glow */} +
+
+ + {isExpanded && ( +
setIsExpanded(false)} + > +

{overview}

+
+ )} +
+ ); + } + // Minimal modern theme. if (layout === "minimal") { return ( diff --git a/src/components/molecules/MovieList/index.tsx b/src/components/molecules/MovieList/index.tsx index bc104bb..57d4998 100644 --- a/src/components/molecules/MovieList/index.tsx +++ b/src/components/molecules/MovieList/index.tsx @@ -107,7 +107,7 @@ export const MovieList: FC = ({ ref={parent} > {sortedMovies.map((movie) => ( - + ))} )}