From c526d560a3e8ed9b2dc9a23825b8979c00a152ba Mon Sep 17 00:00:00 2001 From: Factiven Date: Mon, 1 May 2023 01:09:33 +0700 Subject: Update v3.5 > Bug Fixes > Editor List Update v0.8 > Display adjustment on search page --- components/footer.js | 35 ++++++++++++++++++++++++++++++++++- components/hero/content.js | 4 ++-- components/listEditor.js | 6 +++++- components/videoPlayer.js | 10 +++++++--- 4 files changed, 48 insertions(+), 7 deletions(-) (limited to 'components') 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 (
@@ -39,7 +42,11 @@ function Footer() {
  • - This Season + + This Season +
  • Popular Anime @@ -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 }) { > {/*
    {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" />
    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 {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); -- cgit v1.2.3