fixed cookie banner
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Cookie Banner -->
|
<!-- 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">
|
<div id="cookie-text">
|
||||||
<p>
|
<p>
|
||||||
Questo sito utilizza esclusivamente cookie tecnici per garantire funzionalità essenziali (come login e sicurezza).
|
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>
|
<a href="cookie-policy-en.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Learn more</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button onclick="closeBanner()" style="background: #28a745; color: #fff; border: none; padding: 8px 16px; margin: 5px; cursor: pointer;">OK</button>
|
<button onclick="closeBanner()" style="background: #28a745; color: #fff; border: none; padding: 8px 16px; margin: 5px; cursor: pointer;">OK</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,10 +47,10 @@
|
|||||||
localStorage.setItem('cookiesAcknowledged', 'true');
|
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() {
|
window.onload = function() {
|
||||||
if (localStorage.getItem('cookiesAcknowledged')) {
|
if (!localStorage.getItem('cookiesAcknowledged')) {
|
||||||
document.getElementById('cookie-banner').style.display = 'none';
|
document.getElementById('cookie-banner').style.display = 'block';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user