From 4cded68dc45ba59cb5fbe878494e24549b05bff6 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Mon, 22 Jan 2024 00:09:48 +0000 Subject: CSS updates and a whole theme selector thing --- public/js/themeSwap.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 public/js/themeSwap.js (limited to 'public/js/themeSwap.js') diff --git a/public/js/themeSwap.js b/public/js/themeSwap.js new file mode 100644 index 0000000..18faaee --- /dev/null +++ b/public/js/themeSwap.js @@ -0,0 +1,72 @@ +/** + * Retrieves a cookie's value + * @param {string} cname Cookie name + * @returns {string} Cookie value + */ +function getCookie(cname) { + let name = cname + "="; + let decodedCookie = decodeURIComponent(document.cookie); + let ca = decodedCookie.split(';'); + for(let i = 0; i