From a10f1a9074e0b3837c751f6d9ab82e27cb1f5950 Mon Sep 17 00:00:00 2001 From: Linuxiness Date: Sat, 20 Jan 2024 16:36:37 +0100 Subject: [PATCH 1/4] it shows/hides according to window as well --- .../components/Home/BrowseHome/BrowseHome.jsx | 16 ++++++++- frontend/src/pages/Anime.jsx | 15 +++++++- frontend/src/pages/Explore.jsx | 34 +++++++++++-------- frontend/src/pages/Manga.jsx | 18 +++++++++- 4 files changed, 66 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/Home/BrowseHome/BrowseHome.jsx b/frontend/src/components/Home/BrowseHome/BrowseHome.jsx index dcb13bb..a87289c 100644 --- a/frontend/src/components/Home/BrowseHome/BrowseHome.jsx +++ b/frontend/src/components/Home/BrowseHome/BrowseHome.jsx @@ -4,7 +4,7 @@ import React, { useContext } from "react"; import AuthContext from "../../../context/AuthContext"; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { Filter } from "./Filter"; @@ -24,6 +24,20 @@ const BrowseHome = () => { setShowFilter(value); }; + +useEffect(() => { + const handleResize = () => { + setShowFilter(window.innerWidth >= 768); + }; + + handleResize(); + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); diff --git a/frontend/src/pages/Anime.jsx b/frontend/src/pages/Anime.jsx index 9e1cd20..4c42cad 100644 --- a/frontend/src/pages/Anime.jsx +++ b/frontend/src/pages/Anime.jsx @@ -4,7 +4,7 @@ import "../styles/FilterSearch.scoped.scss"; -import { useState } from 'react'; +import { useState,useEffect } from 'react'; import { FilterSearchAnime } from "../components/Anime/FilterSearchAnime"; import { BrowseAniMan } from "../components/Browse/BrowseAniMan"; @@ -19,6 +19,19 @@ const Anime = () => { setShowFilter(value); }; +useEffect(() => { + const handleResize = () => { + setShowFilter(window.innerWidth >= 768); + }; + + handleResize(); + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); diff --git a/frontend/src/pages/Explore.jsx b/frontend/src/pages/Explore.jsx index 3a05955..efc20ee 100644 --- a/frontend/src/pages/Explore.jsx +++ b/frontend/src/pages/Explore.jsx @@ -1,5 +1,5 @@ import { Link } from "react-router-dom"; -import { useState } from 'react'; +import { useState, useEffect } from "react"; import "../styles/FilterSearch.scoped.scss"; import "../styles/Explore.scoped.scss"; @@ -9,28 +9,34 @@ import { FilterSearchExplore } from "../components/Explore/FilterSearchExplore"; import { Search } from "../components/Search"; const Explore = () => { - const [showFilter, setShowFilter] = useState(false); const handleShowFilterChange = (value) => { setShowFilter(value); }; - - return ( - <> -
- - + useEffect(() => { + const handleResize = () => { + setShowFilter(window.innerWidth >= 768); + }; -
- -
+ handleResize(); + + window.addEventListener("resize", handleResize); - {showFilter ? ( - + return () => { + window.removeEventListener("resize", handleResize); + }; + }, []); + + return ( + <> +
+
+ +
- ) : null} + {showFilter ? : null}

Trending Anime:

diff --git a/frontend/src/pages/Manga.jsx b/frontend/src/pages/Manga.jsx index 0ef3458..3c88de6 100644 --- a/frontend/src/pages/Manga.jsx +++ b/frontend/src/pages/Manga.jsx @@ -1,7 +1,7 @@ import "../styles/FilterSearch.scoped.scss"; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { FilterSearchManga } from "../components/Manga/FilterSearchManga"; import { BrowseAniMan } from "../components/Browse/BrowseAniMan"; @@ -16,6 +16,22 @@ const Manga = () => { setShowFilter(value); }; + +useEffect(() => { + const handleResize = () => { + setShowFilter(window.innerWidth >= 768); + }; + + handleResize(); + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); + + return ( <>
From a4f3cc75804d8e76a2deb8f2e403174a26d6cc83 Mon Sep 17 00:00:00 2001 From: Linuxiness Date: Sat, 20 Jan 2024 17:10:50 +0100 Subject: [PATCH 2/4] fixed upcomingcarousel images better --- .../src/styles/UpcomingCarousel.scoped.scss | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/src/styles/UpcomingCarousel.scoped.scss b/frontend/src/styles/UpcomingCarousel.scoped.scss index 6bfc9cf..ee80d17 100644 --- a/frontend/src/styles/UpcomingCarousel.scoped.scss +++ b/frontend/src/styles/UpcomingCarousel.scoped.scss @@ -127,7 +127,24 @@ text-wrap: wrap; .item > div > img { border: 0; - object-fit: contain; + // object-fit: contain; + + + + @media screen and (max-width: 768px) { + object-fit: cover; + width:100%; + height:14em; + } + + + @media screen and (min-width: 768px) { + object-fit: cover; + width:100%; + height:30em; + + + } From 72f44af0edf2164f9cab687152de2ac6b23b4ccd Mon Sep 17 00:00:00 2001 From: Linuxiness Date: Sat, 20 Jan 2024 20:46:12 +0100 Subject: [PATCH 3/4] detailspage mostly done --- .../src/components/DetailsPage/Header.jsx | 28 ++++++- .../components/DetailsPage/MainContent.jsx | 6 +- .../components/DetailsPage/YoutubeFrame.jsx | 3 +- frontend/src/styles/DetailsPage.scoped.scss | 84 +++++++++++++++++++ 4 files changed, 116 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/DetailsPage/Header.jsx b/frontend/src/components/DetailsPage/Header.jsx index f43649b..ecc2151 100644 --- a/frontend/src/components/DetailsPage/Header.jsx +++ b/frontend/src/components/DetailsPage/Header.jsx @@ -3,17 +3,41 @@ import "../../styles/DetailsPage.scoped.scss"; const Header = ({ data }) => { return ( <> + + +
+ +
-
+ +

{data.title}

{data.num_of_fav} favorites

+
+ + +
+ + + +
+ +
+

{data.title}

+

{data.num_of_fav} favorites

+
+ +
+ + + ); }; diff --git a/frontend/src/components/DetailsPage/MainContent.jsx b/frontend/src/components/DetailsPage/MainContent.jsx index fe85859..9197818 100644 --- a/frontend/src/components/DetailsPage/MainContent.jsx +++ b/frontend/src/components/DetailsPage/MainContent.jsx @@ -5,11 +5,13 @@ const MainContent = ({ data }) => { return ( <>
-

+ + +

About {data.title}:

-

{data.desc}

+

{data.desc}

diff --git a/frontend/src/components/DetailsPage/YoutubeFrame.jsx b/frontend/src/components/DetailsPage/YoutubeFrame.jsx index ed1af02..7a13eba 100644 --- a/frontend/src/components/DetailsPage/YoutubeFrame.jsx +++ b/frontend/src/components/DetailsPage/YoutubeFrame.jsx @@ -11,9 +11,10 @@ const YoutubeFrame = ({yt_trailer}) => { -
+
{/* show trailer, only if it is not null ! whether it is anime or manga (some mangas have trailer... ) */}