(function () { window.setTimeout(function () { const iframeUrl = "https://sportifhayat.poweredbyai.info"; // İframe içinde görünecek URL const pluginStyles = ` #plugin-container { position: fixed; bottom: 75px; right: 20px; z-index: 10000; background: white; border-radius: 8px; box-shadow: 0px 8px 8px rgba(0, 0, 0, 0.1); height: 85vh; width: 600px; display: flex; flex-direction: column; } #plugin-button.mobile{ display: none !important; } #plugin-container.hidden { display: none; } #plugin-container.mobile { width: 100vw; height: 100vh; bottom: 0; right: 0; left: 0; top: 0; border-radius: 0; } #plugin-button { position: fixed; bottom: 20px; right: 20px; z-index: 10001; background-color: transparent; color: white; border: none; cursor: pointer; border-radius: 5px; font-size: 14px; user-select: none; } #plugin-close { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.7); /* Daha koyu bir arka plan */ color: white; border: none; font-size: 18px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.3s ease, transform 0.2s ease; /* Hover geçişleri için */ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Hafif gölge */ } #plugin-close:hover { background: rgba(68, 0, 255, 0.8); /* Hover sırasında kırmızıya dönüşüm */ transform: scale(1.1); /* Hafif büyüme efekti */ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Gölgede derinleşme */ } #plugin-close:active { transform: scale(0.95); /* Tıklama sırasında küçülme */ background: rgba(87, 0, 200, 0.9); /* Daha koyu kırmızı */ } #plugin-button:hover { transform: scale(1.1); /* Hafif büyüme efekti */ } #plugin-button:active { transform: scale(0.95); /* Tıklama sırasında küçülme */ } #plugin-iframe { flex: 1; border: none; } .message-container { font-family: 'Poppins', sans-serif; position: fixed; bottom: 80px; right: 20px; z-index: 10001; display: flex; flex-direction: column; /* Son eklenen en alta gelir */ gap: 10px; /* Mesajlar arasında boşluk */ max-width: 320px; /* Daha geniş uyum için */ } #message-container.hidden { display: none; } .intro-message { background-color: rgba(255, 255, 255, 0.95); color: #333; border: 1px solid rgba(200, 200, 200, 0.8); padding: 15px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); animation: fadeInAnimation 0.5s ease-out; word-wrap: break-word; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; } .intro-message:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); } @keyframes fadeInAnimation { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } } } `; const messageContainer = document.createElement("div"); // Add Styles to const styleTag = document.createElement("style"); styleTag.textContent = pluginStyles; document.head.appendChild(styleTag); // Create Toggle Button const button = document.createElement("button"); button.id = "plugin-button"; document.body.appendChild(button); // Create Image const image = document.createElement("img"); image.src = "https://sportifhayat.poweredbyai.info/static/bot.png"; image.width = 40; button.appendChild(image); // Create Container const container = document.createElement("div"); container.id = "plugin-container"; container.classList.add("hidden"); document.body.appendChild(container); // Create Close Button const closeButton = document.createElement("button"); closeButton.id = "plugin-close"; closeButton.innerHTML = "×"; // Unicode "×" işareti için container.appendChild(closeButton); // Create Iframe const iframe = document.createElement("iframe"); iframe.id = "plugin-iframe"; iframe.src = iframeUrl; container.appendChild(iframe); // Add Event Listeners let isOpen = window.sessionStorage.getItem("pluginstate") == "true" ?? false; if (isOpen) { container.classList.remove("hidden"); button.classList.add("mobile"); } else { container.classList.add("hidden"); button.classList.remove("mobile"); createMessageContainer(); } adjustSize(); button.addEventListener("click", () => { openPlugin(); }); closeButton.addEventListener("click", () => { isOpen = false; container.classList.add("hidden"); button.classList.remove("mobile"); window.sessionStorage.setItem("pluginstate", isOpen); }); function adjustSize() { if (window.outerWidth < 768 || window.innerWidth < 768) { container.classList.add("mobile"); } else { container.classList.remove("mobile"); button.classList.remove("mobile"); } } function openPlugin() { isOpen = !isOpen; container.classList.toggle("hidden", !isOpen); button.classList.toggle("mobile", isOpen); window.sessionStorage.setItem("pluginstate", isOpen); window.localStorage.setItem("user-noticed-chat-intro", true); messageContainer.classList.add("hidden"); adjustSize(); } function createMessageContainer() { // Create Message Container messageContainer.classList.add("message-container"); messageContainer.id = "message-container"; document.body.appendChild(messageContainer); if (!window.localStorage.getItem("user-noticed-chat-intro")) { // Intro Messages Array const messages = ["👋Merhaba! Sana nasıl yardımcı olabilirim?"]; // Add Messages to the Container messages.forEach((msg) => { const introMessage = document.createElement("div"); introMessage.classList.add("intro-message"); introMessage.textContent = msg; introMessage.addEventListener("click", () => { openPlugin(); }); messageContainer.appendChild(introMessage); }); // Dynamically Add New Message (Optional) function addNewMessage(newMessage) { const introMessage = document.createElement("div"); introMessage.classList.add("intro-message"); introMessage.textContent = newMessage; introMessage.addEventListener("click", () => { openPlugin(); }); messageContainer.appendChild(introMessage); } // Example: Add a new message after 2 seconds setTimeout(() => { addNewMessage( "🤖Desteğe mi ihtiyacın var? Birkaç saniyede çözümler sunmak için buradayım! ✨" ); }, 5000); } } }, 100); })();