VvebOIDC/plugins/cookie-notice/public/notice.html

74 lines
2.2 KiB
HTML

<html>
<head>
<link id="landing-css" href="/themes/landing/css/style.css" rel="stylesheet">
<script src="/js/bootstrap.min.js"></script>
</head>
<body>
<!-- #cookie-notice html code will be inserted in the themes pages by plugin common.tpl -->
<div id="cookie-notice">
<div class="fixed-bottom p-4" style="left: auto;">
<div class="toast bg-opacity-50 float-end" role="alert" data-autohide="false">
<div class="toast-body p-4 d-flex flex-column">
<h4>Cookie Notice</h4>
<p class="mb-3">This website stores data such as cookies to enable site functionality including analytics and personalization.</p>
<p class="mb-3">By using this website, you automatically accept that we use cookies.</p>
<p class="mb-3">Check our <a href="/page/privacy-policy">privacy policy</a></p>
<div class="ms-auto">
<button type="button" class="btn btn-outline-secondary me-3" id="btnDeny" data-bs-dismiss="toast" onclick="setCookieConsent('deny')">
Deny
</button>
<button type="button" class="btn btn-outline-primary" id="btnAccept" data-bs-dismiss="toast" onclick="setCookieConsent('allow')">
Accept
</button>
</div>
</div>
</div>
</div>
</div>
<!-- #cookie-notice-js code will be inserted in the theme pages by plugin common.tpl -->
<script id="cookie-notice-js">
let notice = document.querySelector("#cookie-notice .toast");
if (localStorage) {
let cookie = localStorage.getItem("cookie-notice", "unset");
if (!cookie && notice) {
notice.classList.add("show");
}
}
function setCookieConsent(value) {
localStorage.setItem('cookie-notice', value);
notice.classList.remove("show");
return true;
}
</script>
<!-- this js code will not be inserted and will only load in editor -->
<script>
function isEditor () {
return document.getElementById("vvvebjs-styles") || window.location.href.includes('r=');
}
function setCookieConsent(value) {
return true;
}
if (isEditor() && notice) {
//if editor always show notice and don't hide on button click
notice.addEventListener("hide.bs.toast", function (e) {
e.preventDefault();
return false;
});
notice.classList.add("show");
}
</script>
</body>
</html>