From bc534c12a572985aa13d56580f9639bf8b686758 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 28 Aug 2023 00:49:14 +0100 Subject: [PATCH 1/2] login page lang changes --- src/main/resources/static/js/darkmode.js | 2 + .../templates/fragments/langAndDarkMode.html | 75 ------ .../templates/fragments/languages.html | 56 +++++ .../resources/templates/fragments/navbar.html | 22 +- src/main/resources/templates/login.html | 215 +++++++++++++++++- 5 files changed, 283 insertions(+), 87 deletions(-) delete mode 100644 src/main/resources/templates/fragments/langAndDarkMode.html create mode 100644 src/main/resources/templates/fragments/languages.html diff --git a/src/main/resources/static/js/darkmode.js b/src/main/resources/static/js/darkmode.js index fe239583..ebf9c683 100644 --- a/src/main/resources/static/js/darkmode.js +++ b/src/main/resources/static/js/darkmode.js @@ -16,6 +16,8 @@ function getElements() { } function setMode(mode) { + var event = new CustomEvent('modeChanged', { detail: mode }); + document.dispatchEvent(event); elements.lightModeStyles.disabled = mode !== "off"; elements.darkModeStyles.disabled = mode !== "on"; elements.rainbowModeStyles.disabled = mode !== "rainbow"; diff --git a/src/main/resources/templates/fragments/langAndDarkMode.html b/src/main/resources/templates/fragments/langAndDarkMode.html deleted file mode 100644 index 8c6b0ea3..00000000 --- a/src/main/resources/templates/fragments/langAndDarkMode.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/fragments/languages.html b/src/main/resources/templates/fragments/languages.html new file mode 100644 index 00000000..17b88660 --- /dev/null +++ b/src/main/resources/templates/fragments/languages.html @@ -0,0 +1,56 @@ + + + icon العربية + + + icon Català + + + icon 简体中文 + + + icon Deutsch + + + icon English (GB) + + + icon English (US) + + + icon Euskara + + + icon Español + + + icon Français + + + icon Italiano + + + icon Nederlands + + + icon Polski + + + icon Português (BR) + + + icon Romanian + + + icon Svenska + + + icon Русский + + + icon 한국어 + + + icon 日本語 + + \ No newline at end of file diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index 009445e8..4326afcc 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -147,7 +147,27 @@ - + + + + + + + +