(function() { // Create elements const background = document.createElement('div'); background.className = 'zdalny_load_tlo'; background.id = 'zdalny_load_tlo'; const center = document.createElement('div'); center.className = 'zdalny_load_srodek'; const adLink = document.createElement('a'); adLink.href = 'https://play.google.com/store/apps/details?id=com.goodwallpapers.phone_wallpapers'; // Use your ad's URL here const adImage = document.createElement('img'); adImage.className = 'zdalny_load_img'; adImage.src = 'https://reklama.panelek.com/fullscreen/pliki/wallpapers4k.png'; // Use your ad's image URL here adLink.appendChild(adImage); const closeButton = document.createElement('div'); closeButton.className = 'zdalny_load_closeBtn'; closeButton.id = 'zdalny_load_closeBtn'; closeButton.innerHTML = '✕'; // Append children center.appendChild(adLink); center.appendChild(closeButton); background.appendChild(center); document.body.appendChild(background); // Close background functionality function zdalny_load_closeTlo() { document.getElementById('zdalny_load_tlo').style.display = 'none'; } background.addEventListener('click', function(event) { if (event.target === this) { zdalny_load_closeTlo(); } }); closeButton.addEventListener('click', function(event) { event.stopPropagation(); zdalny_load_closeTlo(); }); // Styles - Consider adding these styles to a CSS file linked to your HTML instead const styles = ` .zdalny_load_tlo { background-color: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); height: 100%; display: flex; justify-content: center; align-items: center; padding: 20px; position: fixed; /* Changed to fixed to cover the whole page */ top: 0; /* Ensure it covers the full page */ left: 0; /* Ensure it covers the full page */ width: 100%; /* Ensure it covers the full page */ box-sizing: border-box; z-index: 999; } .zdalny_load_closeBtn { position: absolute; top: -22px; right: 0px; width: 40px; height: 40px; border-radius: 50%; background-color: red; color: white; font-size: 20px; line-height: 40px; text-align: center; cursor: pointer; z-index: 10; } .zdalny_load_closeBtn:hover { background-color: #000; } .zdalny_load_srodek { position: relative; display: inline-block; max-width: 800px; } .zdalny_load_img { display: block; width: 100%; max-width: 100%; height: auto; } .zdalny_load_img:hover { transition: filter 1s ease; filter: saturate(1.5); } `; const styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheet.innerText = styles; document.head.appendChild(styleSheet); })();