<style>
@media only screen and (max-width: 767px) {
#cookies-popup {
max-width: 90%; /* Adjust the max-width for smaller screens */
margin-left: 1.5rem !important; /* Reset the left margin */
margin-bottom: 3rem !important; /* Reset the bottom margin */
}
}
@media only screen and (min-width: 768px) {
#cookies-popup {
max-width: 25%; margin-left: 3rem !important; margin-bottom: 9rem !important;
}
}
</style>
<div id="cookies-popup" class="fixed-bottom m-3 p-3 bg-light" style="display: none;">
<p class="mb-3">Tato webová stránka používá soubory cookie, aby vám zajistila co nejlepší zážitek na naší webové stránce.</p>
<button class="btn btn-primary mr-2" onclick="acceptCookies()">Přijmout soubory cookie</button>
<button class="btn btn-secondary" onclick="declineCookies()">Odmítnout</button>
</div>
<script>
function acceptCookies() {
document.getElementById('cookies-popup').style.display = 'none';
// Set a cookie to remember user's choice, expires in one year
var expiryDate = new Date();
expiryDate.setFullYear(expiryDate.getFullYear() + 1);
document.cookie = 'cookies_accepted=true; expires=' + expiryDate.toUTCString() + '; path=/';
}
function declineCookies() {
document.getElementById('cookies-popup').style.display = 'none';
// Set a cookie to remember user's choice, expires in one week
var expiryDate = new Date();
expiryDate.setDate(expiryDate.getDate() + 7);
document.cookie = 'cookies_accepted=false; expires=' + expiryDate.toUTCString() + '; path=/';
}
// Display the cookies popup if the user hasn't accepted or declined cookies
var cookiesAccepted = document.cookie.split('; ').find(row => row.startsWith('cookies_accepted='));
if (!cookiesAccepted || cookiesAccepted.split('=')[1] !== 'true') {
document.getElementById('cookies-popup').style.display = 'block';
}
</script>