1(function() { 2 const CONSENT_KEY = 'cookie-consent'; 3 const GA_ID = 'G-DPQTFNGLBT'; 4 5 function loadAnalytics() { 6 if (window.ga_initialized) return; 7 window.ga_initialized = true; 8 9 // Google Analytics (gtag.js) 10 const script = document.createElement('script'); 11 script.src = `https://www.googletagmanager.com/gtag/js?id=${GA_ID}`; 12 script.async = true; 13 document.head.appendChild(script); 14 15 window.dataLayer = window.dataLayer || []; 16 function gtag(){dataLayer.push(arguments);} 17 gtag('js', new Date()); 18 gtag('config', GA_ID); 19 20 console.log('â Analytics Loaded (Consent Granted)'); 21 } 22 23 // Check if already consented 24 if (localStorage.getItem(CONSENT_KEY) === 'true') { 25 loadAnalytics(); 26 return; 27 } 28 29 // Create styles if needed (using Tailwind classes so mostly covered, but animations might need help if not loaded yet) 30 // Assuming Tailwind CSS is loaded via the main app or index.css 31 32 // Create container 33 const container = document.createElement('div'); 34 container.className = 'fixed bottom-6 left-6 right-6 md:left-auto md:right-6 md:w-[400px] z-50 animate-slide-up'; 35 container.style.opacity = '0'; 36 container.style.transition = 'opacity 0.5s ease'; 37 38 // Create inner content (Glassmorphism panel) 39 container.innerHTML = ` 40 <div class="glass-panel p-6 rounded-xl border-l-4 border-l-primary relative overflow-hidden group bg-black/80 backdrop-blur-md border border-white/10 shadow-lg text-left"> 41 <div class="absolute top-0 left-0 w-full h-full bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"></div> 42 43 <button id="cookie-close" class="absolute top-4 right-4 text-muted hover:text-white transition-colors"> 44 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg> 45 </button> 46 47 <div class="mb-4"> 48 <h4 class="text-primary font-mono font-bold text-sm mb-2 flex items-center gap-2"> 49 <span class="w-2 h-2 rounded-full bg-primary animate-pulse"></span> 50 SYSTEM COMPLIANCE 51 </h4> 52 <p class="text-xs text-gray-400 leading-relaxed font-sans"> 53 Utilizamos cookies essenciais para segurança e anonimato da conexão, conforme a <span class="text-white">LGPD</span>. 54 </p> 55 </div> 56 57 <button id="cookie-accept" class="w-full bg-primary/10 hover:bg-primary/20 text-primary border border-primary/30 py-2 rounded text-xs font-mono font-bold tracking-wider transition-all hover:shadow-[0_0_15px_rgba(0,255,65,0.2)] cursor-pointer"> 58 ACEITAR PROTOCOLO 59 </button> 60 </div> 61 `; 62 63 // Append to body after a delay 64 setTimeout(() => { 65 document.body.appendChild(container); 66 // Trigger reflow 67 container.offsetHeight; 68 container.style.opacity = '1'; 69 }, 1000); 70 71 // Add event listeners 72 setTimeout(() => { 73 const closeBtn = document.getElementById('cookie-close'); 74 const acceptBtn = document.getElementById('cookie-accept'); 75 76 if (closeBtn) { 77 closeBtn.addEventListener('click', () => { 78 container.style.opacity = '0'; 79 setTimeout(() => container.remove(), 500); 80 }); 81 } 82 83 if (acceptBtn) { 84 acceptBtn.addEventListener('click', () => { 85 localStorage.setItem(CONSENT_KEY, 'true'); 86 loadAnalytics(); // Load GA immediately 87 container.style.opacity = '0'; 88 setTimeout(() => container.remove(), 500); 89 }); 90 } 91 }, 1100); 92 93})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.