- Edit
- components/HelloWorld.vue
to test HMR
-
- Check out - create-vue, the official Vue + Vite starter -
-- Install - Volar - in your IDE for a better DX -
-Click on the Vite and Vue logos to learn more
- - - diff --git a/gui_vue/src/components/main.vue b/gui_vue/src/components/main.vue index 4f99c749..d4168c54 100644 --- a/gui_vue/src/components/main.vue +++ b/gui_vue/src/components/main.vue @@ -30,68 +30,7 @@ import chat from "./chat.vue"; import { stopTransmission } from "../js/sock.js"; -function changeGuiDesign(design) { - if ( - design != "default" && - design != "default_light" && - design != "default_dark" && - design != "default_auto" - ) { - var theme_path = - "../node_modules/bootswatch/dist/" + design + "/bootstrap.min.css"; - document.getElementById("theme_selector").value = design; - document.getElementById("bootstrap_theme").href = escape(theme_path); - } else if (design == "default" || design == "default_light") { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - document.getElementById("theme_selector").value = "default_light"; - document.getElementById("bootstrap_theme").href = escape(theme_path); - document.documentElement.setAttribute("data-bs-theme", "light"); - } else if (design == "default_dark") { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - document.getElementById("theme_selector").value = "default_dark"; - document.getElementById("bootstrap_theme").href = escape(theme_path); - - document.querySelector("html").setAttribute("data-bs-theme", "dark"); - } else if (design == "default_auto") { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - document.getElementById("theme_selector").value = "default_auto"; - document.getElementById("bootstrap_theme").href = escape(theme_path); - - // https://stackoverflow.com/a/57795495 - // check if dark mode or light mode used in OS - if ( - window.matchMedia && - window.matchMedia("(prefers-color-scheme: dark)").matches - ) { - // dark mode - document.documentElement.setAttribute("data-bs-theme", "dark"); - } else { - document.documentElement.setAttribute("data-bs-theme", "light"); - } - - // also register event listener for automatic change - window - .matchMedia("(prefers-color-scheme: dark)") - .addEventListener("change", (event) => { - let newColorScheme = event.matches ? "dark" : "light"; - if (newColorScheme == "dark") { - document.documentElement.setAttribute("data-bs-theme", "dark"); - } else { - document.documentElement.setAttribute("data-bs-theme", "light"); - } - }); - } else { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - document.getElementById("theme_selector").value = "default_light"; - document.getElementById("bootstrap_theme").href = escape(theme_path); - - document.documentElement.setAttribute("data-bs-theme", "light"); - } - - //update path to css file - document.getElementById("bootstrap_theme").href = escape(theme_path); -} function stopAllTransmissions() { console.log("stopping transmissions"); diff --git a/gui_vue/src/components/settings_web.vue b/gui_vue/src/components/settings_web.vue index fc0b68d8..aaa0aa43 100644 --- a/gui_vue/src/components/settings_web.vue +++ b/gui_vue/src/components/settings_web.vue @@ -1,4 +1,6 @@