function injectCode() { // Crée un conteneur pour le shadow DOM const container = document.createElement('div'); document.body.appendChild(container); // Crée un shadow root pour isoler le style const shadow = container.attachShadow({ mode: 'open' }); // Vérifie si on est dans un iframe const isIframe = window.parent !== window; // Style commun avec !important pour priorité const style = document.createElement('style'); style.textContent = isIframe ? ` #ilovehit { width: 80px !important; height: 16px !important; text-align: center !important; z-index: 9999 !important; font-size: 12px !important; box-shadow: 2px 2px 5px rgba(0,0,0,0.2) !important; cursor: pointer !important; background-color: white !important; color: black !important; } ` : ` #ilovehit { width: 200px !important; text-align: center !important; transform: rotate(-45deg) !important; z-index: 9999 !important; position: fixed !important; bottom: 30px !important; right: -60px !important; font-size: 12px !important; box-shadow: 2px 2px 5px rgba(0,0,0,0.2) !important; cursor: pointer !important; background-color: white !important; color: black !important; } `; // Crée le div cliquable const div = document.createElement('div'); div.id = 'ilovehit'; div.textContent = 'I❤️HIT'; div.addEventListener('click', () => window.open('https://hit.maxou.fr/', '_blank')); // Animation du texte const texts = ["I\u2764\uFE0FHIT", "cliquez-ici"]; let currentIndex = 0; function scrollText() { div.textContent = texts[currentIndex]; currentIndex = (currentIndex + 1) % texts.length; setTimeout(scrollText, 2500); } scrollText(); // Injecte dans le shadow DOM shadow.appendChild(style); shadow.appendChild(div); } injectCode();