diff --git a/2023/js/main.js b/2023/js/main.js index ab72f011..7f92deac 100644 --- a/2023/js/main.js +++ b/2023/js/main.js @@ -486,6 +486,10 @@ $(document).ready(function() { } } + if (!localStorage.getItem('halloween')) { + localStorage.setItem('halloween', "true"); + localStorage.setItem('theme', "Halloween"); + } saved_theme = localStorage.getItem('theme'); if (saved_theme) { $(`#theme_mobile option[value='${saved_theme}']`).prop('selected', true).change(); @@ -1568,6 +1572,7 @@ function logout() { localStorage.removeItem("username"); localStorage.removeItem("authToken"); localStorage.removeItem("balance_history"); + localStorage.removeItem("halloween"); location.reload() } @@ -3091,15 +3096,23 @@ $("#theme_desktop").on('change', function() { if (selected_theme == "Terminal") { $("#theme-terminal").attr('disabled', false); $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Terminal'); } else if (selected_theme == "Glossy") { $("#theme-terminal").attr('disabled', true); $("#theme-glossy").attr('disabled', false); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Glossy'); + } else if (selected_theme == "Halloween") { + $("#theme-terminal").attr('disabled', true); + $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', false); + localStorage.setItem('theme', 'Halloween'); } else { // default adaptive - disable all $("#theme-terminal").attr('disabled', true); $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Adaptive'); } }); @@ -3110,15 +3123,23 @@ $("#theme_mobile").on('change', function() { if (selected_theme == "Terminal") { $("#theme-terminal").attr('disabled', false); $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Terminal'); } else if (selected_theme == "Glossy") { $("#theme-terminal").attr('disabled', true); $("#theme-glossy").attr('disabled', false); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Glossy'); + } else if (selected_theme == "Halloween") { + $("#theme-terminal").attr('disabled', true); + $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', false); + localStorage.setItem('theme', 'Halloween'); } else { // default adaptive - disable all $("#theme-terminal").attr('disabled', true); $("#theme-glossy").attr('disabled', true); + $("#theme-halloween").attr('disabled', true); localStorage.setItem('theme', 'Adaptive'); } });