diff --git a/.replit b/.replit index 5c48241..989e093 100644 --- a/.replit +++ b/.replit @@ -31,6 +31,10 @@ externalPort = 3000 localPort = 35987 externalPort = 3003 +[[ports]] +localPort = 39735 +externalPort = 4200 + [env] PORT = "5000" diff --git a/client/src/components/InlineAd.tsx b/client/src/components/InlineAd.tsx new file mode 100644 index 0000000..1b2ae1b --- /dev/null +++ b/client/src/components/InlineAd.tsx @@ -0,0 +1,38 @@ +import { useEffect, useRef } from 'react'; + +export default function InlineAd() { + const adRef = useRef(null); + + useEffect(() => { + const initializeAd = () => { + const insElement = adRef.current?.querySelector('ins'); + if (!insElement || insElement.dataset.adsbygoogleStatus === 'done') return; + + try { + // @ts-ignore + (window.adsbygoogle = window.adsbygoogle || []).push({}); + } catch (error) { + console.error('Inline AdSense initialization error:', error); + } + }; + + // Initialize the ad immediately + initializeAd(); + }, []); + + return ( +
+ {/* Desktop Only: 1200x90px Inline Ad */} + +
+ ); +} \ No newline at end of file diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 8315ad9..c87035e 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -4,6 +4,7 @@ import { type Video } from "@shared/schema"; import VideoCard from "./video-card"; import BunnyVideoModal from "./bunny-video-modal"; import MobileInlineAd from "./MobileInlineAd"; +import InlineAd from "./InlineAd"; import { Button } from "@/components/ui/button"; import { ChevronLeft, ChevronRight } from "lucide-react"; @@ -179,14 +180,23 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) { <>
{categories.map((category, categoryIndex) => ( -
- +
+
+ +
+ {/* Add inline ad after every second category (categoryIndex 1, 3, 5...) */} + {categoryIndex > 0 && (categoryIndex + 1) % 2 === 0 && ( + + )}
))} + + {/* Add final ad after all categories */} +