diff options
Diffstat (limited to 'src/app/anime/recent')
| -rw-r--r-- | src/app/anime/recent/page.jsx | 45 | ||||
| -rw-r--r-- | src/app/anime/recent/recent.css | 66 |
2 files changed, 111 insertions, 0 deletions
diff --git a/src/app/anime/recent/page.jsx b/src/app/anime/recent/page.jsx new file mode 100644 index 0000000..779f0d4 --- /dev/null +++ b/src/app/anime/recent/page.jsx @@ -0,0 +1,45 @@ +import "./recent.css"; +import Image from "next/image"; +import Link from "next/link"; + +export default async function Releases() { + const data = await test(); + + return ( + <div className="trendingContainer"> + <p className="trendingText">Recent Releases</p> + + <div className="trending"> + {data && + data.results.map((item, index) => ( + <Link + key={index} + href={`/anime/${item.id}`} + style={{ textDecoration: "none" }} + > + <div className="trendingEntries"> + <Image + src={item.image} + className="{trendingImage}" + width={160} + height={220} + alt="Drama" + priority + /> + <p>{item.title}</p> + </div> + </Link> + ))} + </div> + </div> + ); +} + +async function test() { + const res = await fetch( + "https://consumet-api-di2e.onrender.com/anime/gogoanime/recent-episodes", + { cache: "force-cache" } + ); + const data = res.json(); + return data; +} diff --git a/src/app/anime/recent/recent.css b/src/app/anime/recent/recent.css new file mode 100644 index 0000000..7d17143 --- /dev/null +++ b/src/app/anime/recent/recent.css @@ -0,0 +1,66 @@ +.trendingContainer { + display: flex; + flex-direction: column; +} + +.trendingText { + color: #FEFFAC; + font-family: "Open Sans"; + font-size: 26px; + margin: 10px; +} + +.trending { + width: 98%; + display: flex; + flex-direction: row; + overflow-x: auto; + margin: 0px auto; +} + +/* Customize scrollbar here */ +.trending::-webkit-scrollbar { + height: 5px; +} + +.trendingEntries { + margin: 10px 10px 5px 5px; + text-align: center; + cursor: pointer; + transition: transform 0.2s ease; + +} + +.trendingEntries:hover { + transform: scale(1.03); +} + +.trendingEntries img { + border-radius: 10px; + width: 150px; + height: 210px; +} + +.trendingEntries p { + color: white; + max-height: 60px; + max-width: 150px; + overflow-y: auto; + font-family: "Lato"; + margin: 10px auto; + font-size: 16px; +} + +.trendingEntries p::-webkit-scrollbar { + width: 5px; +} + +@media (prefers-color-scheme: light) { + .trendingText { + color: black; + } + + .trendingEntries p { + color: black; + } +}
\ No newline at end of file |