diff --git a/js/main.js b/js/main.js index 72b5cf7..fb58499 100644 --- a/js/main.js +++ b/js/main.js @@ -39,17 +39,21 @@ function reorganize_html() { function create_theme_switcher() { // set the correct CSS depending on the cookie, dark is default var light = isThemeLight(); + // Set the correct symbol in the theme switcher button $('body').append('
')); + // set the correct css file in the HTML head $('head').append('')); // switch CSS files and button icon, set new cookie on theme switcher click $('.themeBtn').click(function() { var light = !isThemeLight(); - $("#theme").first().attr('href', './css/' + // Switch the CSS between light and dark + $("#theme").first().attr('href', 'https://langue.phundrak.fr/css/' .concat(light ? 'light' : 'dark') .concat('.css')); + // Switch the icon in the theme switcher button $('.themeBtn').html(''));