diff --git a/static/js/script.js b/static/js/script.js new file mode 100644 index 0000000..d90ad11 --- /dev/null +++ b/static/js/script.js @@ -0,0 +1,29 @@ +// JS File for Blockattack + +// Cookie Banner +document.addEventListener("DOMContentLoaded", function () { + const cookieKey = "cookieConsent"; + const shouldShowBanner = !localStorage.getItem(cookieKey) || window.location.hash === "#changecookies"; + + if (shouldShowBanner) { + showCookieBanner(); + } + + function showCookieBanner() { + const banner = document.createElement("div"); + banner.id = "cookie-banner"; + banner.innerHTML = ` +