const response = await fetch(url); const data = await response.json();
Goal: Help users discover trending and highly-rated anime & manga based on popularity, genre, and user taste. g.e.hentai
<div className="flex gap-4 my-4"> <select value=type onChange=(e) => setType(e.target.value)> <option value="anime">Anime</option> <option value="manga">Manga</option> <option value="both">Both</option> </select> <select value=genre onChange=(e) => setGenre(e.target.value)> <option value="all">All Genres</option> <option value="action">Action</option> <option value="romance">Romance</option> <option value="fantasy">Fantasy</option> </select> </div> const response = await fetch(url); const data =
if (sort === 'score') results.sort((a,b) => b.score - a.score); else if (sort === 'popularity') results.sort((a,b) => a.popularityRank - b.popularityRank); const response = await fetch(url)
return ( <div className="p-6"> <h1 className="text-3xl font-bold">🔥 Popular Anime & Manga</h1>
<div className="grid grid-cols-2 md:grid-cols-5 gap-4"> mediaList.map(item => ( <div key=item.id className="rounded-lg shadow hover:scale-105 transition"> <img src=item.imageUrl alt=item.title className="rounded-t-lg" /> <div className="p-2"> <h3 className="font-semibold truncate">item.title</h3> <div className="flex justify-between text-sm"> <span>⭐ item.score</span> <span className="capitalize">item.type</span> </div> </div> </div> )) </div> </div> );
useEffect(() => fetch( /api/popular?type=$type&genre=$genre ) .then(res => res.json()) .then(setMediaList); , [type, genre]);