From 22a8fb2d7536df232702e986d4ad42232f96adca Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Mon, 12 Aug 2024 12:48:20 -0500 Subject: [PATCH] Add cookie support --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index f6e56c5..44f8943 100644 --- a/index.html +++ b/index.html @@ -92,6 +92,12 @@ } function easterEgg(easterEggState) { console.log("Easter egg state is: " + easterEggState); + // Check existing site state before updating it (prevents the site from hanging when you use the drawDesign function) + if ((/true/).test(getCookie("easterEggState") == easterEggState) { + console("Easter egg state already set! Ignoring request..."); + return; + } + if (easterEggState) { document.cookie = "easterEggState=true"; document.body.style.backgroundImage = "url(https://files.calebfontenot.com/blahaj-bl%C3%A5haj.gif)";