-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
19 lines (17 loc) · 848 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.addEventListener('DOMContentLoaded', function() {
// Check if the user has already given consent
if (!localStorage.getItem('cookieConsent')) {
var offcanvas = new bootstrap.Offcanvas(document.getElementById('offcanvasBottom'));
offcanvas.show();
}
document.getElementById('essentialCookies').addEventListener('click', function() {
localStorage.setItem('cookieConsent', 'essential');
var offcanvas = bootstrap.Offcanvas.getInstance(document.getElementById('offcanvasBottom'));
offcanvas.hide();
});
document.getElementById('allowAllCookies').addEventListener('click', function() {
localStorage.setItem('cookieConsent', 'all');
var offcanvas = bootstrap.Offcanvas.getInstance(document.getElementById('offcanvasBottom'));
offcanvas.hide();
});
});