finkenhammer-theme/js/cookies-consent.js

17 lines
875 B
JavaScript
Raw Normal View History

2022-11-23 15:55:29 +00:00
$(window).on('load', function () {
if (Cookies.get('cookies-consent') == undefined) {
$("#cookie-settings").animate({ bottom: '0%' }, 1000);
$('.btn-cookies-consent').click(function (event) {
event.preventDefault();
let cookiesConsent = $(this).attr('data-cookies');
if (cookiesConsent != undefined) Cookies.set('cookies-consent', cookiesConsent, { expires: 365 });
else {
if ($('#functional-cookies').prop('checked') && $('#analytics-cookies').prop('checked') && $('#profile-cookies').prop('checked')) Cookies.set('cookies-consent', 1, { expires: 365 });
else Cookies.set('cookies-consent', 0, { expires: 365 });
}
$('#modal-cookie-settings').modal('hide');
$("#cookie-settings").animate({ bottom: '-100%' }, 1000);
});
}
});