From b69507f771d09ac07f679c8eabf420e7558f9b7c Mon Sep 17 00:00:00 2001 From: real-zephex Date: Sat, 11 May 2024 09:15:12 +0530 Subject: some minor fixes --- src/app/anime/[id]/page.jsx | 1 + src/app/anime/components/episode_buttons.jsx | 72 ++++++++++++++++++++++++---- src/app/anime/components/search.jsx | 6 +++ src/app/anime/styles/info.module.css | 28 +++++++++-- src/app/anime/styles/search.module.css | 15 +++++- src/app/globals.css | 16 ++++++- 6 files changed, 123 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/app/anime/[id]/page.jsx b/src/app/anime/[id]/page.jsx index edd100a..f107313 100644 --- a/src/app/anime/[id]/page.jsx +++ b/src/app/anime/[id]/page.jsx @@ -24,6 +24,7 @@ const AnimeInfoHomepage = async ({ params }) => { width={200} height={300} alt="Anime Poster" + priority />

diff --git a/src/app/anime/components/episode_buttons.jsx b/src/app/anime/components/episode_buttons.jsx index 30a8086..013dee1 100644 --- a/src/app/anime/components/episode_buttons.jsx +++ b/src/app/anime/components/episode_buttons.jsx @@ -11,6 +11,7 @@ import { import styles from "../styles/buttons.module.css"; import { video_url } from "../data-fetch/request"; import { preFetchVideoLinks } from "./cacher"; +import { storeLocal } from "./storeHistory"; const EpisodesButtons = ({ data: data }) => { const [videoLink, setVideoLink] = useState(null); @@ -23,6 +24,11 @@ const EpisodesButtons = ({ data: data }) => { const groups = createGroups(data.episodes, 50); + /** + * Retrieves the video URL for a given episode ID. + * This function handles the initializing, changing URL, and hiding the video player. + * @param {string} epID - The episode ID. + */ async function getVideoURL(epID) { setVideoLoading(true); const data = await video_url(epID); @@ -30,9 +36,14 @@ const EpisodesButtons = ({ data: data }) => { setVideoLoading(false); } + /** + * Creates button groups for a range of episodes. + * @param {number} start - The starting index of episodes. + * @param {number} end - The ending index of episodes. + * @returns {JSX.Element} - Button groups JSX element. + */ function createButtonGroups(start, end) { try { - // Reset background color of all buttons with the class "episode-button" const buttons = document.getElementsByClassName("episode-button"); for (let i = 0; i < buttons.length; i++) { buttons[i].style.backgroundColor = "#1f1f1fd2"; @@ -49,18 +60,18 @@ const EpisodesButtons = ({ data: data }) => { {data.episodes && data.episodes.slice(start, end).map((item, index) => (

+ + + {searchResults} diff --git a/src/app/anime/styles/info.module.css b/src/app/anime/styles/info.module.css index 4e65bdd..4216b37 100644 --- a/src/app/anime/styles/info.module.css +++ b/src/app/anime/styles/info.module.css @@ -9,21 +9,29 @@ align-items: center; } +.AnimeHeroSection strong { + color: var(--neon-yellow); +} + .AnimeHeroSection img { - padding: 0.5rem 0.7rem 0rem 0; + width: auto; + height: auto; + padding: 0.5rem 0.7rem 0.5rem 0.7rem; + border-radius: 1rem; } .animeDescription { max-height: 100px; overflow: auto; + color: var(--light-sky); } .animeDescription::-webkit-scrollbar { - width: 4px; + width: 3px; } .animeDescription::-webkit-scrollbar-thumb { - background-color: gray; + background-color: var(--nord-yellow); border-radius: 1rem; } @@ -50,6 +58,18 @@ } .AnimeHeroSection img { - padding: 0.4rem 0.4rem 0 0; + padding: 0.4rem 0.4rem 0.4rem 0.4rem; + } +} + +@media screen and (max-width: 425px) { + .AnimeHeroSection { + display: flex; + align-items: center; + flex-direction: column; + } + + .animeTitle { + text-align: center; } } \ No newline at end of file diff --git a/src/app/anime/styles/search.module.css b/src/app/anime/styles/search.module.css index 7c7957f..d3564f7 100644 --- a/src/app/anime/styles/search.module.css +++ b/src/app/anime/styles/search.module.css @@ -1,6 +1,7 @@ .SearchBarContainer { padding: 1rem 0 0.8rem 0; - width: 40%; + display: flex; + align-items: center; } .SearchInputContainer { @@ -9,6 +10,18 @@ background-color: #121212; padding: 0.5rem; border-radius: 0.5rem; + width: 40%; +} + +.animeHistoryButton { + font-family: "Lexend Deca", serif; + outline: none; + border: none; + background-color: #121212; + color: white; + margin: 0 0 0 0.4rem; + padding: 0.5rem; + cursor: pointer; } .SearchInputContainer input { diff --git a/src/app/globals.css b/src/app/globals.css index db28734..233d7d1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -7,6 +7,20 @@ --pastel-red: #ff6868; --soft-purple: #beadfa; --softer-purple: #d0bfff; + + + --nord-red: #BF616A; + --nord-green: #A3BE8C; + --nord-yellow: #EBCB8B; + --nord-orange: #D08770; + --nord-pink: #B48EAD; + + --nord-bg-darkest: #2E3440; + --nord-bg-darker: #3B4252; + --nord-bg-dark: #434C5E; + --nord-bg-darklight: #4C566A; + + --light-sky: #CAF4FF; } body { @@ -17,4 +31,4 @@ body { body::-webkit-scrollbar { width: 0; -} +} \ No newline at end of file -- cgit v1.2.3