From 530eb0d5a9e980f4c6823dcc9071b3182fe47c3c Mon Sep 17 00:00:00 2001 From: Tejas Panchal Date: Sun, 15 Feb 2026 06:01:51 +0530 Subject: [PATCH] fixed, made it working --- index.html | 69 ++++++---- src/App.jsx | 2 + src/components/DiscordPopup.jsx | 105 +++++++++++++++ src/components/banner/Banner.jsx | 9 +- src/components/categorycard/CategoryCard.jsx | 66 +++++----- src/components/continue/ContinueWatching.jsx | 9 +- src/components/footer/Footer.jsx | 33 ++++- src/components/player/Player.jsx | 43 ++++--- src/components/qtip/Qtip.jsx | 5 +- src/components/servers/Servers.jsx | 40 +++--- src/components/sidecard/Sidecard.jsx | 17 ++- src/components/suggestion/Suggestion.jsx | 21 ++- src/components/topten/Topten.jsx | 37 +++--- src/components/trending/Trending.jsx | 5 +- src/hooks/useWatch.js | 9 +- src/pages/animeInfo/AnimeInfo.jsx | 42 +++--- src/pages/watch/Watch.jsx | 128 +++++++++---------- src/utils/getSafetitle.js | 18 +++ 18 files changed, 406 insertions(+), 252 deletions(-) create mode 100644 src/components/DiscordPopup.jsx create mode 100644 src/utils/getSafetitle.js diff --git a/index.html b/index.html index 193f7e6..440f88b 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,22 @@ + + + + + + + + + + + + { "@context": "https://schema.org", - "@type": "VideoObject", - "name": "JustAnime - Watch Anime Free", + "@type": "WebSite", + "name": "JustAnime", + "alternateName": ["JustAnime.to", "Just Anime"], + "url": "https://justanime.to", "description": "JustAnime offers free streaming of English-subbed and dubbed anime series and movies. No account needed and no ads!", - "thumbnailUrl": "https://github.com/tejaspanchall/JustAnime/blob/main/public/home.PNG", - "uploadDate": "2024-11-08", - "contentUrl": "https://justanime.to", - "duration": "PT30M", - "interactionStatistic": { - "@type": "InteractionCounter", - "interactionType": { "@type": "WatchAction" }, - "userInteractionCount": 50000 - }, - "author": { - "@type": "Individual", - "name": "itzzzme", - "url": "https://justanime.to" + "potentialAction": { + "@type": "SearchAction", + "target": { + "@type": "EntryPoint", + "urlTemplate": "https://justanime.to/search?keyword={search_term_string}" + }, + "query-input": "required name=search_term_string" }, "publisher": { - "@type": "Individual", - "name": "itzzzme", + "@type": "Organization", + "name": "JustAnime", + "url": "https://justanime.to", "logo": { "@type": "ImageObject", - "url": "https://github.com/tejaspanchall/JustAnime/blob/main/public/logo.png" + "url": "https://justanime.to/logo.png", + "width": 512, + "height": 512 + }, + "contactPoint": { + "@type": "ContactPoint", + "email": "justanimexyz@gmail.com", + "contactType": "customer service" } - }, - "potentialAction": { - "@type": "WatchAction", - "target": "https://justanime.to" } } + + + + + + + -
- + \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 072492c..53d4d6b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -20,6 +20,7 @@ import SplashScreen from "./components/splashscreen/SplashScreen"; import Terms from "./pages/terms/Terms"; import DMCA from "./pages/dmca/DMCA"; import Contact from "./pages/contact/Contact"; +import DiscordPopup from "./components/DiscordPopup"; function App() { const location = useLocation(); @@ -75,6 +76,7 @@ function App() { + ); diff --git a/src/components/DiscordPopup.jsx b/src/components/DiscordPopup.jsx new file mode 100644 index 0000000..1ac97f0 --- /dev/null +++ b/src/components/DiscordPopup.jsx @@ -0,0 +1,105 @@ +import React, { useState, useEffect } from "react"; +import { X } from "lucide-react"; +import { FaDiscord, FaTelegram } from "react-icons/fa"; + +const DiscordPopup = () => { + const [isVisible, setIsVisible] = useState(false); + const [shouldRender, setShouldRender] = useState(false); + + useEffect(() => { + // Check if the user has opted out of seeing the popup + const isHidden = localStorage.getItem("hideDiscordPopup"); + if (isHidden) return; + + // Set a timer for 2 minutes (120,000 ms) + const timer = setTimeout(() => { + setShouldRender(true); + // Brief delay to trigger entrance animation + setTimeout(() => setIsVisible(true), 10); + }, 60000); + + return () => clearTimeout(timer); + }, []); + + const handleClose = () => { + setIsVisible(false); + // Wait for animation to finish before removing from DOM + setTimeout(() => setShouldRender(false), 300); + }; + + const handleNeverShowAgain = () => { + localStorage.setItem("hideDiscordPopup", "true"); + handleClose(); + }; + + if (!shouldRender) return null; + + return ( +
+
+ {/* Header */} +
+
+
+ +
+
+ Join Our Community + Discord & Telegram +
+
+ +
+ + {/* Content */} +
+

+ Join our official channels for early updates, announcements, and to connect with other fans! +

+ + + + +
+
+
+ ); +}; + +export default DiscordPopup; diff --git a/src/components/banner/Banner.jsx b/src/components/banner/Banner.jsx index 86182e3..d67ac3b 100644 --- a/src/components/banner/Banner.jsx +++ b/src/components/banner/Banner.jsx @@ -8,6 +8,7 @@ import { } from "@fortawesome/free-solid-svg-icons"; import { Link } from "react-router-dom"; import { useLanguage } from "@/src/context/LanguageContext"; +import getSafeTitle from "@/src/utils/getSafetitle"; import "./Banner.css"; function Banner({ item, index }) { @@ -16,19 +17,19 @@ function Banner({ item, index }) {
{item.title}
- +

#{index + 1} Spotlight

- {language === "EN" ? item.title : item.japanese_title} + {getSafeTitle(item.title, language, item.japanese_title)}

- + {/* Mobile Buttons */}
{ const { language } = useLanguage(); const navigate = useNavigate(); - + if (limit) { data = data.slice(0, limit); } @@ -55,7 +56,7 @@ const CategoryCard = React.memo( if ( JSON.stringify(prev.firstRow) !== JSON.stringify(newItems.firstRow) || JSON.stringify(prev.remainingItems) !== - JSON.stringify(newItems.remainingItems) + JSON.stringify(newItems.remainingItems) ) { return newItems; } @@ -90,11 +91,10 @@ const CategoryCard = React.memo( <> {categoryPage && (
0 - ? "mt-8 max-[758px]:hidden" - : "" - }`} + className={`grid grid-cols-4 gap-x-3 gap-y-8 transition-all duration-300 ease-in-out ${categoryPage && itemsToRender.firstRow.length > 0 + ? "mt-8 max-[758px]:hidden" + : "" + }`} > {itemsToRender.firstRow.map((item, index) => (
navigate( - `${ - path === "top-upcoming" - ? `/${item.id}` - : `/watch/${item.id}` + `${path === "top-upcoming" + ? `/${item.id}` + : `/watch/${item.id}` }` ) } > {item.title}
@@ -131,10 +130,10 @@ const CategoryCard = React.memo(
{(item.tvInfo?.rating === "18+" || item?.adultContent === true) && ( -
- 18+ -
- )} +
+ 18+ +
+ )}
{item.tvInfo?.sub && ( @@ -177,9 +176,9 @@ const CategoryCard = React.memo( {(item.tvInfo?.duration || item.duration) && (
{item.tvInfo?.duration === "m" || - item.tvInfo?.duration === "?" || - item.duration === "m" || - item.duration === "?" + item.tvInfo?.duration === "?" || + item.duration === "m" || + item.duration === "?" ? "N/A" : item.tvInfo?.duration || item.duration || "N/A"}
@@ -191,7 +190,7 @@ const CategoryCard = React.memo( to={`/${item.id}`} className="text-white font-semibold mt-3 item-title hover:text-white hover:cursor-pointer line-clamp-1" > - {language === "EN" ? item.title : item.japanese_title} + {getSafeTitle(item.title, language, item.japanese_title)} {item.description && (
@@ -214,17 +213,16 @@ const CategoryCard = React.memo( className="inline-block bg-gray-900 absolute left-0 top-0 w-full h-full group hover:cursor-pointer" onClick={() => navigate( - `${ - path === "top-upcoming" - ? `/${item.id}` - : `/watch/${item.id}` + `${path === "top-upcoming" + ? `/${item.id}` + : `/watch/${item.id}` }` ) } > {item.title}
@@ -238,10 +236,10 @@ const CategoryCard = React.memo(
{(item.tvInfo?.rating === "18+" || item?.adultContent === true) && ( -
- 18+ -
- )} +
+ 18+ +
+ )}
{item.tvInfo?.sub && ( @@ -284,9 +282,9 @@ const CategoryCard = React.memo( {(item.tvInfo?.duration || item.duration) && (
{item.tvInfo?.duration === "m" || - item.tvInfo?.duration === "?" || - item.duration === "m" || - item.duration === "?" + item.tvInfo?.duration === "?" || + item.duration === "m" || + item.duration === "?" ? "N/A" : item.tvInfo?.duration || item.duration || "N/A"}
@@ -298,7 +296,7 @@ const CategoryCard = React.memo( to={`/${item.id}`} className="text-white font-semibold mt-3 item-title hover:text-white hover:cursor-pointer line-clamp-1" > - {language === "EN" ? item.title : item.japanese_title} + {getSafeTitle(item.title, language, item.japanese_title)}
))} diff --git a/src/components/continue/ContinueWatching.jsx b/src/components/continue/ContinueWatching.jsx index ff5ef86..53fbe3e 100644 --- a/src/components/continue/ContinueWatching.jsx +++ b/src/components/continue/ContinueWatching.jsx @@ -9,6 +9,7 @@ import { FaHistory, FaChevronLeft, FaChevronRight } from "react-icons/fa"; import { useLanguage } from "@/src/context/LanguageContext"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPlay } from "@fortawesome/free-solid-svg-icons"; +import getSafeTitle from "@/src/utils/getSafetitle"; const ContinueWatching = () => { const [watchList, setWatchList] = useState([]); @@ -92,9 +93,9 @@ const ContinueWatching = () => { > {item?.title}
@@ -113,9 +114,7 @@ const ContinueWatching = () => { )}

- {language === "EN" - ? item?.title - : item?.japanese_title} + {getSafeTitle(item?.title, language, item?.japanese_title)}

Episode {item.episodeNum} diff --git a/src/components/footer/Footer.jsx b/src/components/footer/Footer.jsx index 2c6076c..151c5dc 100644 --- a/src/components/footer/Footer.jsx +++ b/src/components/footer/Footer.jsx @@ -1,18 +1,39 @@ import logoTitle from "@/src/config/logoTitle.js"; import website_name from "@/src/config/website.js"; import { Link } from "react-router-dom"; +import { FaDiscord, FaTelegram } from "react-icons/fa"; function Footer() { return (