diff options
| author | real-zephex <[email protected]> | 2024-04-07 13:50:17 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-07 13:50:17 +0000 |
| commit | 1eee8b5196828128a189d6e9bf889500aadb2308 (patch) | |
| tree | 2c569fcd87048af5d3b2fd23a89b28c50565a109 /src/app | |
| parent | idk what I am doing (diff) | |
| download | dramalama-1eee8b5196828128a189d6e9bf889500aadb2308.tar.xz dramalama-1eee8b5196828128a189d6e9bf889500aadb2308.zip | |
idek
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/kdrama/[id]/page.jsx | 4 | ||||
| -rw-r--r-- | src/app/kdrama/components/popular.jsx | 2 | ||||
| -rw-r--r-- | src/app/kdrama/components/recent.jsx | 2 | ||||
| -rw-r--r-- | src/app/kdrama/components/search.jsx | 15 | ||||
| -rw-r--r-- | src/app/kdrama/page.jsx | 2 | ||||
| -rw-r--r-- | src/app/kdrama/styles/search.module.css | 6 |
6 files changed, 21 insertions, 10 deletions
diff --git a/src/app/kdrama/[id]/page.jsx b/src/app/kdrama/[id]/page.jsx index 6a165d2..8f0fa9c 100644 --- a/src/app/kdrama/[id]/page.jsx +++ b/src/app/kdrama/[id]/page.jsx @@ -3,7 +3,7 @@ import Image from "next/image"; import EpisodesButtons from "./buttons"; import PreFetchVideoLinks from "../components/cacher"; -export const runtime = 'edge'; +export const runtime = "edge"; export default async function DramaInfo({ params }) { const id = decodeURIComponent(params.id); @@ -18,7 +18,7 @@ export default async function DramaInfo({ params }) { <div className={styles.TitleContainer}> <p>{info.title}</p> <Image - src={info.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${info.image}`} width={160} height={240} alt="Drama Poster" diff --git a/src/app/kdrama/components/popular.jsx b/src/app/kdrama/components/popular.jsx index d9126ec..4b8b293 100644 --- a/src/app/kdrama/components/popular.jsx +++ b/src/app/kdrama/components/popular.jsx @@ -19,7 +19,7 @@ export default async function PopularDramas() { > <div className={styles.AnimeEntry}> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={160} height={240} alt="Drama Poster" diff --git a/src/app/kdrama/components/recent.jsx b/src/app/kdrama/components/recent.jsx index 759e179..0b6b7f6 100644 --- a/src/app/kdrama/components/recent.jsx +++ b/src/app/kdrama/components/recent.jsx @@ -19,7 +19,7 @@ export default async function RecentDramas() { > <div className={styles.AnimeEntry}> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={160} height={240} alt="Drama Poster" diff --git a/src/app/kdrama/components/search.jsx b/src/app/kdrama/components/search.jsx index 4c9d00c..f9ba174 100644 --- a/src/app/kdrama/components/search.jsx +++ b/src/app/kdrama/components/search.jsx @@ -10,11 +10,14 @@ import Link from "next/link"; export default function DramaSearch() { const [title, setTitle] = useState(""); const [infoTitle, setInfoTitle] = useState(null); + const [loadingText, setLoadingText] = useState(null); - async function getSearchResults(title) { + const handleSearch = async (title) => { + setLoadingText(true); const data = await FetchSearchTitle(title); + setLoadingText(false); setInfoTitle(data); - } + }; return ( <div className={styles.SearchContainer}> @@ -25,12 +28,16 @@ export default function DramaSearch() { onChange={(event) => setTitle(event.target.value)} onKeyDown={async (e) => { if ((e.key === "Enter" || e.code === 13) && title) { - await getSearchResults(e.target.value); + await handleSearch(e.target.value); } }} ></input> </div> + {loadingText && ( + <p className={styles.LoadingText}>Wait a moment...</p> + )} + <div className={styles.SearchResults}> {infoTitle && infoTitle.results.map((item, index) => ( @@ -42,7 +49,7 @@ export default function DramaSearch() { <div className={styles.SearchEntry}> <p>{item.title}</p> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={110} height={180} alt="Drama Poster" diff --git a/src/app/kdrama/page.jsx b/src/app/kdrama/page.jsx index e831346..44f8eb9 100644 --- a/src/app/kdrama/page.jsx +++ b/src/app/kdrama/page.jsx @@ -1,5 +1,3 @@ -"use client"; - import styles from "./styles/kdrama.module.css"; import PopularDramas from "./components/popular"; import RecentDramas from "./components/recent"; diff --git a/src/app/kdrama/styles/search.module.css b/src/app/kdrama/styles/search.module.css index 5f61c23..fcf75b0 100644 --- a/src/app/kdrama/styles/search.module.css +++ b/src/app/kdrama/styles/search.module.css @@ -2,6 +2,12 @@ margin: 20px 0px -20px 0px; } +.LoadingText { + color: white; + font-family: "Atkinson Hyperlegible"; + text-align: center; +} + .Search { padding: 5px; background-color: #121212; |