1document.addEventListener('DOMContentLoaded', function() { 2 // EllenÅrizzük a localStorage-t az engedély állapotáért 3 const consentStatus = localStorage.getItem('cookie-consent'); 4 5 if (!consentStatus) { 6 // Ha nincs engedély, akkor megjelenÃtjük a bannert 7 insertCookieConsentBanner(); 8 } else { 9 // Ha van engedély, akkor frissÃtjük a consent módot 10 updateConsentStatus(consentStatus); 11 } 12 13 function insertCookieConsentBanner() { 14 // Dinamikusan létrehozzuk a stÃlusokat 15 const style = document.createElement('style'); 16 style.textContent = ` 17 #cookie-consent-banner { 18 min-height: 40%; 19 display: flex; 20 align-items: center; 21 color: #fff; 22 background-color: #242323fa; 23 right: 0; 24 top: auto; 25 bottom: 0; 26 left: auto; 27 /*max-width: 50%;*/ 28 position: fixed; 29 overflow: auto; 30 z-index: 99999999999; 31 font-size: 16px; 32 -webkit-text-size-adjust: 100%; 33 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 34 margin: 0; 35 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 36 font-weight: 400; 37 line-height: 1.5; 38 text-align: left; 39 width: 100%; 40 max-width: 100%; 41 } 42 43 #cookie-consent-banner .cookie-consent-content { 44 padding: 1rem 2rem !important; 45 display: flex; 46 box-sizing: border-box; 47 font-size: 16px; 48 -webkit-text-size-adjust: 100%; 49 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 50 font-weight: 400; 51 line-height: 1.5; 52 text-align: left; 53 } 54 55 .cookie-consent-text { 56 display: block; 57 box-sizing: border-box; 58 margin: 15px 50px 0px 0px; 59 color: #fff; 60 overflow: auto; 61 z-index: 99999999999; 62 font-size: 16px; 63 -webkit-text-size-adjust: 100%; 64 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 65 font-weight: 400; 66 line-height: 1.5; 67 text-align: left; 68 } 69 70 .cookie-consent-text-title { 71 font-weight: 600; 72 font-size: 18px; 73 margin-top: 0; 74 margin-bottom: 1rem; 75 } 76 77 .cookie-consent-text-text { 78 margin: 0 0 1.25rem 0; 79 font-size: 13px; 80 } 81 82 .cookie-consent-buttons { 83 display: block; 84 box-sizing: border-box; 85 min-width: 150px; 86 color: #fff; 87 overflow: auto; 88 z-index: 99999999999; 89 font-size: 16px; 90 -webkit-text-size-adjust: 100%; 91 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 92 font-weight: 400; 93 line-height: 1.5; 94 text-align: left; 95 } 96 97 #cookie-consent-banner button { 98 width: 100%; 99 height: auto; 100 -webkit-appearance: button; 101 text-transform: none; 102 overflow: visible; 103 font-family: inherit; 104 line-height: inherit; 105 outline: none; 106 background: #dcdae5; 107 cursor: pointer; 108 border: none; 109 box-shadow: none; 110 vertical-align: baseline; 111 } 112 113 #accept-cookies { 114 color: #fff !important; 115 background-color: #c7ae75 !important; 116 font-weight: normal !important; 117 padding: 10px 0px !important; 118 border-radius: 8px !important; 119 margin-bottom: .5rem; 120 margin-top: 1.5rem; 121 font-size: 14px; 122 } 123 124 #reject-cookies { 125 color: #777777 !important; 126 background-color: inherit !important; 127 font-weight: normal !important; 128 margin-bottom: 0; 129 margin-top: 1rem; 130 font-size: 12px; 131 } 132 133 #cookie-consent-banner button:hover { 134 background-color: #0056b3; 135 } 136 137 @media all and (max-width: 970px) { 138 #cookie-consent-banner .cookie-consent-content { 139 display: block; 140 } 141 #accept-cookies { 142 margin-top: 0;
143 } 144 } 145 `; 146 document.head.appendChild(style); 147 148 // HTML kód a bannerhez 149 const bannerHTML = ` 150 <div id="cookie-consent-banner" class="cookie-consent-banner"> 151 <div class="cookie-consent-content"> 152 <div class="cookie-consent-text"> 153 <p class="cookie-consent-text-title">Az Ãn adatainak védelme fontos számunkra</p> 154 <p class="cookie-consent-text-text">Sütiket használunk a weboldal működÅképességének biztosÃtásához, és a beleegyezéseddel weboldalunk tartalmának személyre szabásához is. Az Ãrtem gombra kattintva elfogadod a sütik használatát és a weboldal viselkedésével kapcsolatos adatok átadását a célzott hirdetések megjelenÃtésére a közösségi hálózatokon és más weboldalakon található hirdetési felületeken.</p> 155 </div> 156 <div class="cookie-consent-buttons"> 157 <button id="accept-cookies">Ãrtem</button> 158 <button id="reject-cookies">ElutasÃt mindent</button> 159 </div> 160 </div> 161 </div> 162 `; 163 164 document.body.insertAdjacentHTML('beforeend', bannerHTML); 165 166 document.getElementById('accept-cookies').addEventListener('click', function() { 167 localStorage.setItem('cookie-consent', 'granted'); 168 updateConsentStatus('granted'); 169 document.getElementById('cookie-consent-banner').remove(); 170 }); 171 172 document.getElementById('reject-cookies').addEventListener('click', function() { 173 localStorage.setItem('cookie-consent', 'denied'); 174 updateConsentStatus('denied'); 175 document.getElementById('cookie-consent-banner').remove(); 176 }); 177 } 178 179 function updateConsentStatus(status) { 180 if (window.dataLayer) { 181 gtag('consent', 'update', { 182 'ad_storage': status === 'granted' ? 'granted' : 'denied', 183 'analytics_storage': status === 'granted' ? 'granted' : 'denied', 184 'ad_user_data': status === 'granted' ? 'granted' : 'denied', 185 'ad_personalization': status === 'granted' ? 'granted' : 'denied' 186 }); 187 188 if (status === 'granted') { 189 var gtagScript = document.getElementById('gtag-js'); 190 if (gtagScript) { 191 gtagScript.style.display = 'block'; 192 } 193 194 var gtmScript = document.getElementById('gtm-js'); 195 if (gtmScript) { 196 gtmScript.style.display = 'block'; 197 } 198 } 199 } 200 } 201});
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.