File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
WebApplication2/Customer/Pages Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 602
602
document .getElementById (id).style .display = ' block' ;
603
603
}
604
604
605
+ // Dark Mode Toggle
605
606
// Dark Mode Toggle
606
607
function toggleDarkMode () {
607
608
const body = document .body ;
612
613
const icon = document .getElementById (' modeIcon' );
613
614
if (body .classList .contains (' dark-mode' )) {
614
615
icon .src = " https://img.icons8.com/?size=100&id=83221&format=png&color=FAB005" ; // Sun for light mode
616
+ localStorage .setItem (' darkMode' , ' true' ); // Save dark mode state
615
617
} else {
616
618
icon .src = " https://img.icons8.com/?size=100&id=59841&format=png&color=FFFFFF" ; // Half Moon for dark mode
619
+ localStorage .removeItem (' darkMode' ); // Remove dark mode state
617
620
}
618
621
}
622
+
623
+ document .addEventListener (" DOMContentLoaded" , function () {
624
+ // Check if dark mode is enabled in localStorage
625
+ if (localStorage .getItem (" darkMode" ) === " true" ) {
626
+ document .body .classList .add (" dark-mode" );
627
+ document .body .classList .remove (" light-mode" );
628
+ document .getElementById (' modeIcon' ).src = " https://img.icons8.com/?size=100&id=83221&format=png&color=FAB005" ; // Sun for light mode
629
+ } else {
630
+ document .body .classList .add (" light-mode" );
631
+ document .body .classList .remove (" dark-mode" );
632
+ document .getElementById (' modeIcon' ).src = " https://img.icons8.com/?size=100&id=59841&format=png&color=FFFFFF" ; // Half Moon for dark mode
633
+ }
634
+ });
619
635
// Sortable Table Functionality
620
636
document .addEventListener (' DOMContentLoaded' , function () {
621
637
document .querySelectorAll (' .styled-table th' ).forEach (function (th ) {
You can’t perform that action at this time.
0 commit comments