Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
formando nova melhor estrutura
Browse files Browse the repository at this point in the history
  • Loading branch information
uesleibros committed Sep 3, 2024
1 parent 6adb82e commit aec8b17
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 147 deletions.
122 changes: 3 additions & 119 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
"chart.js": "^2.9.3",
"disqus-react": "^1.1.5",
"framer-motion": "^11.3.28",
"https-proxy-agent": "^7.0.5",
"next": "14.2.5",
"nextjs-toploader": "^3.6.15",
"node-fetch": "^3.3.2",
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.3.0",
"react-slick": "^0.30.2",
"slick-carousel": "^1.8.1",
"video.js": "^8.17.3"
Expand Down
14 changes: 7 additions & 7 deletions src/app/api/recentes/animes/anroll/route.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import extractData from "@/utils/anroll/extractData";
import config from "@/config";

export async function GET() {
const res = await fetch("https://www.anroll.net", {
const res = await fetch(`https://www.anroll.net/_next/data/${config.anroll.buildId}/index.json`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"Referer": "https://www.anroll.net/"
},
next: { revalidate: 300 }
});

const data = extractData(await res.text());
const catalog = JSON.parse(data)?.props;
catalog.pageProps.data.data_releases.forEach((i) => i.episode.thumbnail = `https://static.anroll.net/images/animes/screens/${i.episode.anime.slug_serie}/${i.episode.n_episodio}.jpg`);
catalog.pageProps.data.data_releases.forEach((i) => i.episode.anime.thumbnail = `https://static.anroll.net/images/animes/capas/${i.episode.anime.slug_serie}.jpg`);
const data = await res.json();
const catalog = data?.pageProps.data.data_releases;
catalog.forEach((i) => i.episode.thumbnail = `https://static.anroll.net/images/animes/screens/${i.episode.anime.slug_serie}/${i.episode.n_episodio}.jpg`);
catalog.forEach((i) => i.episode.anime.thumbnail = `https://static.anroll.net/images/animes/capas/${i.episode.anime.slug_serie}.jpg`);

return Response.json(catalog.pageProps);
return Response.json(catalog);
}
3 changes: 0 additions & 3 deletions src/components/Anime/AnrollAnimeInfos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {useEffect, useState, useCallback} from "react";
import {Card, CardHeader, CardBody, CardFooter, Chip} from "@nextui-org/react";
import {Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Button} from "@nextui-org/react";
import {Divider, Spinner} from "@nextui-org/react";
import {FaPlay, FaCirclePlay, FaLink} from "react-icons/fa6";
import Episode from "@/components/Episode";
import AnimeSliderItems from "@/components/AniList/AnimeSliderItems";
import Image from "next/image";
Expand Down Expand Up @@ -151,7 +150,6 @@ export default function AnrollAnimeInfos({anime}) {
<div className="flex flex-col gap-2">
{anime.externalLinks.map((external, index) => (
<Link className="text-sm transition-colors text-blue-500 hover:text-white flex items-center gap-2 w-[max-content]" href={`${external.url}`} key={index}>
<FaLink />
{external.icon && (
<Image src={`${external.icon}`} width={10} height={10} alt={`${external.site}`} />
)}
Expand Down Expand Up @@ -197,7 +195,6 @@ export default function AnrollAnimeInfos({anime}) {
<Divider />
<CardFooter className="mt-auto">
<Link className="transition-colors text-blue-500 hover:text-white flex items-center gap-2 w-[max-content]" href={`${staff.node.siteUrl}`}>
<FaLink />
Saiba mais
</Link>
</CardFooter>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Episode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Link from "next/link";
import Image from "next/image";
import {FaCirclePlay} from "react-icons/fa6";

export default function Episode({ slug, episode_id, thumbnail, title, episode_number, dub }) {
return (
Expand All @@ -22,7 +21,7 @@ export default function Episode({ slug, episode_id, thumbnail, title, episode_nu
/>
<div className="absolute top-0 transition duration-300 group-hover:bg-black group-hover:bg-opacity-30 w-full h-full">
<div className="invisible transition duration-300 group-hover:visible">
<FaCirclePlay size={40} className="text-white mx-auto mt-[22%]" />
<p className="text-white text-xl mx-auto mt-[22%]">Plau</p>
</div>
</div>
<div className="absolute w-full top-0 p-2 flex justify-between items-center">
Expand Down
16 changes: 4 additions & 12 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import {useRouter} from "next/navigation";
import {Navbar, NavbarBrand, NavbarMenuToggle, NavbarMenuItem, NavbarMenu, NavbarContent, NavbarItem, Input, Spinner} from "@nextui-org/react";
import {useState, useEffect, useCallback} from "react";
import {FaSearch, FaPlay} from "react-icons/fa";
import Image from "next/image";
import Link from "next/link";
import traduzir from "@/utils/traduzir";
import {RiDiceLine} from "react-icons/ri";

export default function Header() {
const [isMenuOpen, setIsMenuOpen] = useState(false);
Expand Down Expand Up @@ -107,15 +105,15 @@ export default function Header() {
variant="underlined"
onChange={handleChangeValue}
value={value}
startContent={<FaSearch className="text-zinc-500" />}
startContent={}
/>
</NavbarItem>
</NavbarContent>

<NavbarContent className="hidden sm:flex gap-4" justify="end">
<NavbarItem>
<div>
<RiDiceLine onClick={irParaAnimeAleatorio} className="transition-colors cursor-pointer text-zinc-400 hover:text-white" size={30} />
<p onClick={irParaAnimeAleatorio} className="transition-colors text-xl cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
</div>
</NavbarItem>
</NavbarContent>
Expand All @@ -124,8 +122,7 @@ export default function Header() {
<NavbarMenuItem>
<NavbarItem className="mb-3">
<div onClick={irParaAnimeAleatorio} className="cursor-pointer group flex items-center gap-2">
<RiDiceLine className="transition-colors text-zinc-400 group-hover:text-white" size={30} />
<p className="transition-colors text-zinc-400 group-hover:text-white">Anime aleatório</p>
<p onClick={irParaAnimeAleatorio} className="transition-colors text-xl cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
</div>
</NavbarItem>
</NavbarMenuItem>
Expand All @@ -138,7 +135,7 @@ export default function Header() {
variant="underlined"
onChange={handleChangeValue}
value={value}
startContent={<FaSearch className="text-zinc-500" />}
startContent={}
/>
</NavbarMenuItem>
<NavbarMenuItem>
Expand Down Expand Up @@ -198,11 +195,6 @@ const AnimeList = ({ listaAnimes, onAnimeClick }) => {
<div className="pointer-events-none bg-opacity-80 font-bold bg-green-600 w-[max-content] rounded-lg px-2 py-1 text-xs">
{anime.aired.prop.from.year ? anime.aired.prop.from.year : "Não lançado"}
</div>
{(anime.type !== "Movie" && anime.episodes) && (
<div className="pointer-events-none bg-opacity-80 font-bold bg-black w-[max-content] rounded-lg px-2 py-1 text-xs flex items-center gap-2">
<FaPlay /> {anime.episodes}
</div>
)}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
anroll: {
buildId: "nxb43Ok4qvT2cAlD0OLS1",
buildId: "YMBRlSz-1IMFUsVIq1uR5",
cdn: "cdn-zenitsu-2-gamabunta.b-cdn.net"
}
}
Expand Down

0 comments on commit aec8b17

Please sign in to comment.