';
+ notif += "This site uses cookies to store information about your browsing activity.";
+ notif += "
For more information, check out the privacy policy."; + notif += "
Have a nice day!"; + notif += '
';
+ document.write(notif);
+
+ $("#notif-close").on("click", function () {
+ setCookie("notification", "true", 365);
+ });
+}
\ No newline at end of file
diff --git a/scripts/cookies.js b/scripts/cookies.js
index 56359cf..de73e51 100644
--- a/scripts/cookies.js
+++ b/scripts/cookies.js
@@ -1,15 +1,14 @@
-if (cookieNotification) {
- let notif = "";
- notif += 'For more information, check out the privacy policy."; + notif += "
Have a nice day!"; + notif += '
';
- notif += "This site uses cookies to store information about your browsing activity.";
- notif += "
For more information, check out the privacy policy."; - notif += "
Have a nice day!"; - notif += '
';
- document.write(notif);
+function getCookie(key) {
+ let c = document.cookie;
+ if (!c)
+ return undefined;
+ let start = c.indexOf(key + "=") + key.length + 1;
+ let end = c.indexOf(";", start);
+ return c.substring(start, end < 0 ? c.length : end);
+}
- $("#notif-close").on("click", function () {
- setCookie("notification", "true", 365);
- });
+function setCookie(key, value, days) {
+ var date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ document.cookie = key + "=" + value + "; expires=" + date.toUTCString();
}
\ No newline at end of file
diff --git a/scripts/main.js b/scripts/main.js
index 1c950df..0efdd3a 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -1,5 +1,4 @@
let dark = getCookie("dark") === "true";
-let cookieNotification = getCookie("notification") !== "true";
let pride = new Date().getMonth() == 5;
if (dark) {
@@ -39,19 +38,4 @@ $(function () {
});
PR.prettyPrint();
-});
-
-function getCookie(key) {
- let c = document.cookie;
- if (!c)
- return undefined;
- let start = c.indexOf(key + "=") + key.length + 1;
- let end = c.indexOf(";", start);
- return c.substring(start, end < 0 ? c.length : end);
-}
-
-function setCookie(key, value, days) {
- var date = new Date();
- date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
- document.cookie = key + "=" + value + "; expires=" + date.toUTCString();
-}
\ No newline at end of file
+});
\ No newline at end of file
For more information, check out the privacy policy."; - notif += "
Have a nice day!"; - notif += '