diff options
| author | real-zephex <[email protected]> | 2024-03-21 10:08:56 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-03-21 10:08:56 +0530 |
| commit | 7932b71d55f621ad5cfa4a96d637ce90f366a10c (patch) | |
| tree | a51f8e490e09a45cb8064812c0693536692542c7 /src/app | |
| parent | Update README.md (diff) | |
| download | dramalama-7932b71d55f621ad5cfa4a96d637ce90f366a10c.tar.xz dramalama-7932b71d55f621ad5cfa4a96d637ce90f366a10c.zip | |
fixes: anime section is fully server rendered, added a loading screen for info and video page, minor css optimizations
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/page.module.css | 2 | ||||
| -rw-r--r-- | src/app/recent/recent.css | 10 | ||||
| -rw-r--r-- | src/app/search/page.jsx | 20 | ||||
| -rw-r--r-- | src/app/search/search.css | 3 |
4 files changed, 15 insertions, 20 deletions
diff --git a/src/app/page.module.css b/src/app/page.module.css index 939f480..c8bd07e 100644 --- a/src/app/page.module.css +++ b/src/app/page.module.css @@ -3,7 +3,7 @@ flex-direction: column; justify-content: center; align-items: center; - height: 75vh; + height: 90dvh; max-width: 500px; margin: 0px auto; text-align: center; diff --git a/src/app/recent/recent.css b/src/app/recent/recent.css index aaca306..7d17143 100644 --- a/src/app/recent/recent.css +++ b/src/app/recent/recent.css @@ -1,4 +1,3 @@ - .trendingContainer { display: flex; flex-direction: column; @@ -17,7 +16,7 @@ flex-direction: row; overflow-x: auto; margin: 0px auto; -} +} /* Customize scrollbar here */ .trending::-webkit-scrollbar { @@ -25,12 +24,13 @@ } .trendingEntries { - margin: 10px 10px 5px 5px; - text-align: center; + margin: 10px 10px 5px 5px; + text-align: center; cursor: pointer; transition: transform 0.2s ease; } + .trendingEntries:hover { transform: scale(1.03); } @@ -51,7 +51,7 @@ font-size: 16px; } -.trendingEntries p::-webkit-scrollbar{ +.trendingEntries p::-webkit-scrollbar { width: 5px; } diff --git a/src/app/search/page.jsx b/src/app/search/page.jsx index e6d4f08..00309f6 100644 --- a/src/app/search/page.jsx +++ b/src/app/search/page.jsx @@ -5,19 +5,24 @@ import { FaSearch } from "react-icons/fa"; // Import the search icon from react- import { useState } from "react"; import Image from "next/image"; import Link from "next/link"; +import testFunction from "./api/fetchInfo"; export default function Input() { const [searchedAnime, setSearchedAnime] = useState(null); const [loading, setLoading] = useState(null); + const [search1, setSearch] = useState(null); - const handleKeyPress = (event) => { + const handleKeyPress = async (event) => { if ( (event.code === "Enter" || event.key === "Enter" || event.code === 13) && searchedAnime != "" ) { - fetch_animes(searchedAnime); + setLoading(true); + let x = await testFunction(searchedAnime); + setSearch(x); + setLoading(false); } else if ( (event.code === "Enter" || event.key === "Enter" || @@ -28,17 +33,6 @@ export default function Input() { } }; - const [search1, setSearch] = useState(null); - const fetch_animes = (title) => { - fetch("https://dramalama-api.vercel.app/anime/gogoanime/" + title) - .then(setLoading(true)) - .then((res) => res.json()) - .then((data) => { - setSearch(data); - setLoading(false); - }); - }; - return ( <div> <div className="inputContainer"> diff --git a/src/app/search/search.css b/src/app/search/search.css index d24293e..8afb508 100644 --- a/src/app/search/search.css +++ b/src/app/search/search.css @@ -63,13 +63,14 @@ .anime p { color: white; - width: 25vh; + width: 25dvh; font-family: "Lato"; font-size: 18px; } .animeImage { border-radius: 10px; + margin-left: 20px; } @media screen and (max-width: 768px) { |