Files
profile/inc/cookie-consent.php
2025-07-19 00:51:25 +03:00

60 lines
1.8 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="cookie-consent-banner" class="cookie-consent" style="display: none;">
<div class="cookie-consent-content">
<div class="cookie-consent-text">Мы используем файлы cookie для улучшения работы сайта. Продолжая использование сайта, вы соглашаетесь с <a style="color: white; text-decoration: underline;" href="https://profile.ru/zashita-personalnyh-dannyh/" target="_blank">условиями</a></div>
<button id="cookie-consent-accept" class="cookie-consent-button">Принять</button>
</div>
</div>
<style>
.cookie-consent {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(51, 51, 51, 0.95);
color: #fff;
padding: 15px;
z-index: 9999;
box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
text-align: center;
}
.cookie-consent-content {
max-width: 100%;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 15px;
font-size: .9rem;
}
.cookie-consent-button {
background: black;
color: white;
border: none;
padding: 6px 20px;
cursor: pointer;
border-radius: 4px;
font-weight: bold;
}
.cookie-consent-button:hover {
background: #72757c;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (!localStorage.getItem('cookie_consent_accepted')) {
const banner = document.getElementById('cookie-consent-banner');
banner.style.display = 'block';
document.getElementById('cookie-consent-accept').addEventListener('click', function() {
localStorage.setItem('cookie_consent_accepted', 'true');
banner.style.display = 'none';
});
}
});
</script>