Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
revoxhere authored Oct 20, 2023
1 parent 12f06bd commit 1d061ab
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions 2023/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -1568,6 +1572,7 @@ function logout() {
localStorage.removeItem("username");
localStorage.removeItem("authToken");
localStorage.removeItem("balance_history");
localStorage.removeItem("halloween");
location.reload()
}

Expand Down Expand Up @@ -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');
}
});
Expand All @@ -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');
}
});
Expand Down

0 comments on commit 1d061ab

Please sign in to comment.