diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 542a732..0000000 --- a/src/App.css +++ /dev/null @@ -1,213 +0,0 @@ -:root { - - --poster-width: 15rem; - --posters-wide: 10; - --posters-gap: 1rem; -} - -#root { - height: 100%; - width: 100%; -} - -@font-face { - font-family: "Jura"; - src: url("fonts/Jura-VariableFont_wght.ttf"); -} - -@font-face { - font-family: "RobotoBold"; - src: url("fonts/Roboto-Bold.ttf") -} - -body { - - font-family: Jura; - color: white; -} - - -main { - height: 100%; - display: flex; - gap: 1em; - justify-content: center; - align-items: center; -} - - - -#movie-wall-container { - display: inline-flex; - flex-wrap: wrap; - flex-basis: 60%; - align-items: center; - gap: 1em; - height: fit-content; -} - - -#sidebar { - flex-basis: 20%; - max-height: 100%; - min-height: 100%; - font-size: 1.6rem; - text-align: center; - background-color: rgba(0, 0, 0, 0.5); - - display: grid; - grid-template-rows: 1fr 1fr 2fr 1fr; - align-items: center; - justify-content: center; - - h1 { - font-size: 1.2em; - font-family: RobotoBold; - grid-row: 1/ span 1; - height: fit-content; - overflow: hidden; - - } - - a { - display: contents; - } - - - .chosen-movie-poster { - grid-row: 2/ span 1; - object-fit: cover; - display: flex; - justify-content: center; - } - - - #summary { - overflow: scroll; - max-height: 100%; - grid-row: 3/ span 1; - } - - p { - font-family: Jura; - padding: 0.2em; - margin: 0.1em 0.2em 0.1em 0.2em; - } - - footer { - font-size: 1.2rem; - grid-row: 4/ span 1; - overflow: hidden; - } - -} - -.poster { - width: var(--poster-width); - display: grid; - box-shadow: 1em 1em 1em rgba(0, 0, 0, 0.5); - border-radius: 1em; - overflow: hidden; - - img { - height: 100%; - animation: fadeImage 0.5s; - animation-fill-mode: forwards; - aspect-ratio: 2/3; - } -} - -.poster>* { - grid-area: 1/1; -} - -.highlighted { - border: 0.1em solid gold; -} - - -.overlay { - margin: 0; - height: 100%; - width: 100%; - background-color: rgba(255, 255, 255, 0.5); - cursor: pointer; - z-index: 2; - opacity: 0; -} - -.highlighted>.overlay { - background-color: rgba(255, 222, 123, 0.5); -} - -.overlay:hover { - opacity: 1; -} - -@keyframes fadeImage { - from { - filter: blur(5rem); - } - - to { - filter: blur(0); - } -} - - -#background { - background-color: black; - position: fixed; - width: 100%; - height: 100%; - z-index: -1; - -} - -.CrossfadeImage { - width: 100%; - height: 100%; - filter: blur(1rem) brightness(0.4); -} - -#watch-providers-container { - max-width: 100%; - display: flex; - gap: 0.2rem; - justify-content: space-around; - - .watch-providers { - text-align: center; - border: 1rem white; - - h1 { - font-size: 1.4rem; - } - - } - - .watch-logos-container { - display: flex; - flex-wrap: nowrap; - gap: 0.4rem; - justify-content: center; - - - .watch-logo { - aspect-ratio: 1/1; - max-height: 2rem; - - img { - width: 100%; - } - } - - } -} - -#hamburger { - position: absolute; - top: 0px; - left: 0px; - z-index: 10; -} diff --git a/src/App.tsx b/src/App.tsx index b267ac6..b68c756 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,3 @@ -import './defaults.css' -import './App.css' import './spinner.css' import { MovieWall } from './objects/movie-wall' import { HamburgerMenu } from './objects/HamburgerMenu' @@ -68,20 +66,20 @@ function App() { } return ( <> -
+
-
- - -
- -
+ +
+ +
) diff --git a/src/defaults.css b/src/defaults.css deleted file mode 100644 index 3e60f16..0000000 --- a/src/defaults.css +++ /dev/null @@ -1,69 +0,0 @@ -*, -*::before, -*::after { - box-sizing: border-box; -} - -img { - display: block; - max-width: 100%; -} - -menu:not(article menu), -ol:not(article ol), -ul:not(article ul) { - list-style: none; -} - -menu, -ol, -ul { - padding-left: 0; -} - -article ol, -article ul { - list-style-position: inside; -} - -a { - /* Places underlines below the descenders */ - text-underline-position: under; - - - /* Sets the thickness as a percentage of the font size */ - text-decoration-thickness: 8; -} - -/* = the root */ -html { - font-size: 62.5%; - /* (62.5/100) * 16px = 10px */ - -webkit-text-size-adjust: none; - /* for iOS Safari */ - text-size-adjust: none; - /* for other mobile browsers */ - height: 100vh; -} - -body { - margin: 0; - height: 100%; - -} - -@media (prefers-reduced-motion: no-preference) { - html { - scroll-behavior: smooth; - } -} - -label, -button, -select, -summary, -[type=radio], -[type=submit], -[type=checkbox] { - cursor: pointer; -} diff --git a/src/objects/movie-wall.tsx b/src/objects/movie-wall.tsx index 2972b8c..951beda 100644 --- a/src/objects/movie-wall.tsx +++ b/src/objects/movie-wall.tsx @@ -35,16 +35,17 @@ interface MovieWallProps extends React.ComponentPropsWithRef<"div"> { setChosenMovie: React.Dispatch>; setSimilarMoviesAvailable: React.Dispatch>; config: Config; + className: string } -export function MovieWall({ movies, setMovies, config, setChosenMovie, setSimilarMoviesAvailable }: MovieWallProps) { +export function MovieWall({ movies, setMovies, config, setChosenMovie, setSimilarMoviesAvailable, className }: MovieWallProps) { const posters: React.ReactElement[] = [] for (let i = 0; i < movies.length; i++) { const movie = movies[i] const isHighlighted = movie.vote_average ? movie.vote_average > 6 : false posters.push( - ) } - return <> + return
{posters} - +
} interface PosterProps extends React.ComponentPropsWithRef<"div"> { @@ -66,34 +67,32 @@ interface PosterProps extends React.ComponentPropsWithRef<"div"> { setChosenMovie: React.Dispatch>; setSimilarMoviesAvailable: React.Dispatch>; isHighlighted: boolean; + className: string } -function Poster({ movie, config, listSimilar, setMovies, setChosenMovie, setSimilarMoviesAvailable, isHighlighted }: PosterProps) { +function Poster({ className, movie, config, listSimilar, setMovies, setChosenMovie, setSimilarMoviesAvailable, isHighlighted }: PosterProps) { function clickHandler() { setChosenMovie(movie) listSimilar(config, movie, setMovies, setSimilarMoviesAvailable) } const [isLoading, setIsLoading] = useState(true) const [hasError, setHasError] = useState(false) - const classes = [ - "poster", - isHighlighted ? "highlighted" : "" - ].join(" ") - return <>
+ return <>
{isLoading ? -
+
- :
clickHandler()}> + :
clickHandler()}> + hello
} - {hasError ??
⚠️
} + {hasError ??
⚠️
} setIsLoading(false)} onError={() => setHasError(true)} /> -
+
} diff --git a/src/objects/sidebar.tsx b/src/objects/sidebar.tsx index dd7bafe..1c90894 100644 --- a/src/objects/sidebar.tsx +++ b/src/objects/sidebar.tsx @@ -10,14 +10,15 @@ export interface SidebarProps extends React.ComponentPropsWithRef<"div"> { similarMoviesAvailable: boolean; watchProviders: WatchProviders; config: Config; + className: string } -export function Sidebar({ movie, similarMoviesAvailable, watchProviders, config }: SidebarProps) { +export function Sidebar({ movie, similarMoviesAvailable, watchProviders, config, className }: SidebarProps) { const apology = config.language == "es" ? "Resumen no disponible" : config.language == "en" ? "Summary unavailable." : "" - return