fixed cookie banner

This commit is contained in:
Claudio 2025-07-10 10:42:35 +02:00
parent 9d6f9ce284
commit d106d42c03

View File

@ -25,7 +25,7 @@
</script>
<!-- Cookie Banner -->
<div id="cookie-banner" style="position: fixed; bottom: 0; width: 100%; background: #333; color: #fff; padding: 15px; text-align: center; z-index: 1000; font-family: Arial, sans-serif;">
<div id="cookie-banner" style="position: fixed; bottom: 0; width: 100%; background: #333; color: #fff; padding: 15px; text-align: center; z-index: 1000; font-family: Arial, sans-serif; display: none;">
<div id="cookie-text">
<p>
Questo sito utilizza esclusivamente cookie tecnici per garantire funzionalità essenziali (come login e sicurezza).
@ -36,7 +36,6 @@
<a href="cookie-policy-en.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Learn more</a>
</p>
</div>
<div>
<button onclick="closeBanner()" style="background: #28a745; color: #fff; border: none; padding: 8px 16px; margin: 5px; cursor: pointer;">OK</button>
</div>
@ -48,10 +47,10 @@
localStorage.setItem('cookiesAcknowledged', 'true');
}
// Nasconde il banner se l'utente ha già chiuso
// Mostra il banner solo se l'utente non ha ancora accettato i cookie
window.onload = function() {
if (localStorage.getItem('cookiesAcknowledged')) {
document.getElementById('cookie-banner').style.display = 'none';
if (!localStorage.getItem('cookiesAcknowledged')) {
document.getElementById('cookie-banner').style.display = 'block';
}
};
</script>