diff options
| author | Factiven <[email protected]> | 2023-05-01 01:09:33 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-05-01 01:09:33 +0700 |
| commit | c526d560a3e8ed9b2dc9a23825b8979c00a152ba (patch) | |
| tree | 7fa872b8d6dd3cc3c93c7a53f4475ad7b9db7a0a /components | |
| parent | Editor List v0.7 (diff) | |
| download | moopa-c526d560a3e8ed9b2dc9a23825b8979c00a152ba.tar.xz moopa-c526d560a3e8ed9b2dc9a23825b8979c00a152ba.zip | |
Update v3.5
> Bug Fixes
> Editor List Update v0.8
> Display adjustment on search page
Diffstat (limited to 'components')
| -rw-r--r-- | components/footer.js | 35 | ||||
| -rw-r--r-- | components/hero/content.js | 4 | ||||
| -rw-r--r-- | components/listEditor.js | 6 | ||||
| -rw-r--r-- | components/videoPlayer.js | 10 |
4 files changed, 48 insertions, 7 deletions
diff --git a/components/footer.js b/components/footer.js index 90ae982..3494810 100644 --- a/components/footer.js +++ b/components/footer.js @@ -3,9 +3,12 @@ import Instagram from "./media/instagram"; import Link from "next/link"; import Image from "next/image"; import { signIn, useSession } from "next-auth/react"; +import { useState } from "react"; function Footer() { const { data: session, status } = useSession(); + const [year, setYear] = useState(new Date().getFullYear()); + const [season, setSeason] = useState(getCurrentSeason()); return ( <section className="text-[#dbdcdd] z-40 bg-[#0c0d10] md:flex md:h-[12rem] md:items-center md:justify-between"> @@ -39,7 +42,11 @@ function Footer() { <div className="flex flex-col gap-10 font-karla font-bold md:flex-row md:gap-[5.94rem]"> <ul className="flex flex-col gap-y-[0.7rem] "> <li className="cursor-pointer hover:text-action"> - <Link href="/">This Season</Link> + <Link + href={`/search/anime?season=${season}&seasonYear=${year}`} + > + This Season + </Link> </li> <li className="cursor-pointer hover:text-action"> <Link href="/search/anime">Popular Anime</Link> @@ -83,3 +90,29 @@ function Footer() { } export default Footer; + +function getCurrentSeason() { + const now = new Date(); + const month = now.getMonth() + 1; // getMonth() returns 0-based index + + switch (month) { + case 12: + case 1: + case 2: + return "WINTER"; + case 3: + case 4: + case 5: + return "SPRING"; + case 6: + case 7: + case 8: + return "SUMMER"; + case 9: + case 10: + case 11: + return "FALL"; + default: + return "UNKNOWN SEASON"; + } +} diff --git a/components/hero/content.js b/components/hero/content.js index 98ec4a8..25e1431 100644 --- a/components/hero/content.js +++ b/components/hero/content.js @@ -52,7 +52,7 @@ export default function Content({ ids, section, data }) { > <Link href={`/anime/${anime.id}`} - className="hover:scale-105 group relative duration-300 ease-in-out" + className="hover:scale-105 group relative duration-300 ease-in-out hover-parent" > {/* <div className="fixed top-0 z-40 bg-black invisible group-hover:visible"> {anime.title.romaji || anime.title.english} @@ -75,7 +75,7 @@ export default function Content({ ids, section, data }) { anime.coverImage?.large || "https://cdn.discordapp.com/attachments/986579286397964290/1058415946945003611/gray_pfp.png" } - className="z-20 h-[192px] w-[135px] object-cover lg:h-[265px] lg:w-[185px] rounded-md" + className="z-20 h-[192px] w-[135px] lg:h-[265px] lg:w-[185px] object-cover rounded-md" /> </Link> </div> diff --git a/components/listEditor.js b/components/listEditor.js index 50a62c5..58177d3 100644 --- a/components/listEditor.js +++ b/components/listEditor.js @@ -81,7 +81,11 @@ const ListEditor = ({ animeId, session, stats, prg, max, image = null }) => { className="object-cover w-[120px] h-[180px] rounded-l-sm hidden md:block" /> <Image - src={image.bannerImage} + src={ + image.bannerImage || + image.coverImage.extraLarge || + image.coverImage.large + } alt="image" height={500} width={500} diff --git a/components/videoPlayer.js b/components/videoPlayer.js index e47e798..b007d95 100644 --- a/components/videoPlayer.js +++ b/components/videoPlayer.js @@ -12,6 +12,7 @@ export default function VideoPlayer({ op, ed, title, + poster, }) { const [url, setUrl] = useState(); const [source, setSource] = useState([]); @@ -61,8 +62,6 @@ export default function VideoPlayer({ compiler(); }, [data]); - // console.log(source); - return ( <> {url ? ( @@ -74,8 +73,13 @@ export default function VideoPlayer({ title: `${title}`, autoplay: true, screenshot: true, + poster: poster ? poster : "", + }} + style={{ + width: "100%", + height: "100%", + margin: "0 auto 0", }} - style={{ width: "100%", height: "100%", margin: "0 auto 0" }} getInstance={(art) => { art.on("ready", () => { const seek = art.storage.get(id); |