add cookies
This commit is contained in:
@@ -18,6 +18,7 @@ import './styles/components/partner-item.css';
|
||||
import './styles/components/single-partner-item.css';
|
||||
import './styles/components/suggestion-item.css';
|
||||
import './styles/components/agro-informer.css';
|
||||
import './styles/components/cookie-consent.css';
|
||||
|
||||
import './scripts/calendar.js';
|
||||
import './scripts/menu-vertical.js';
|
||||
@@ -27,6 +28,7 @@ import './scripts/search-form.js';
|
||||
import './scripts/select.js';
|
||||
import './scripts/subscription-form.js';
|
||||
import './scripts/agroserver.js';
|
||||
import './scripts/cookie-consent.js';
|
||||
import './styles/components/about.css';
|
||||
import './styles/components/banner.css';
|
||||
import './styles/components/breadcrumbs.css';
|
||||
|
||||
13
frontend/src/scripts/cookie-consent.js
Normal file
13
frontend/src/scripts/cookie-consent.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
localStorage.setItem('cookie_consent_accepted', 'true');
|
||||
banner.style.display = 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
36
frontend/src/styles/components/cookie-consent.css
Normal file
36
frontend/src/styles/components/cookie-consent.css
Normal file
@@ -0,0 +1,36 @@
|
||||
.cookie-consent {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #333;
|
||||
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: 1200px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.cookie-consent-button {
|
||||
background: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 20px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cookie-consent-button:hover {
|
||||
background: #45a049;
|
||||
}
|
||||
@@ -49,6 +49,5 @@ h3,
|
||||
|
||||
.text-11 {
|
||||
font-weight: 400;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.6rem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user