diff --git a/docs/configuration.md b/docs/configuration.md index 43e9ba1..d57ec83 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -22,10 +22,12 @@ header: true # Set to false to hide the header footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) +vlayout: true # default to the vertical layout connectivityCheck: true # whether you want to display a message when the apps are not accessible anymore (VPN disconnected for example) # Optional theming theme: default # 'default' or one of the theme available in 'src/assets/themes'. +theme_use_dark: false # true or false, useful for overriding browser default in new sessions # Optional custom stylesheet # Will load custom CSS files. Especially useful for custom icon sets. @@ -97,6 +99,8 @@ services: tag: "app" url: "https://www.reddit.com/r/selfhosted/" target: "_blank" # optional html tag target attribute + info: "https://github.com/bastienwirtz/homer/tree/main/docs" # optional link to documentation + infotarget: "_blank" # same as target, but for icon link - name: "Another one" logo: "assets/tools/sample2.png" subtitle: "Another application" diff --git a/src/App.vue b/src/App.vue index d97df0c..1397e73 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,9 +28,10 @@ :links="config.links" @navbar-toggle="showMenu = !showMenu" > - + - export default { name: "Darkmode", - data: function () { - return { - isDark: null, - }; + props: { + isDark: Boolean, }, created: function () { - this.isDark = + let isDark = "overrideDark" in localStorage ? JSON.parse(localStorage.overrideDark) - : matchMedia("(prefers-color-scheme: dark)").matches; - this.$emit("updated", this.isDark); + : this.isDark === null + ? matchMedia("(prefers-color-scheme: dark)").matches + : this.isDark; + this.$emit("updated", isDark); }, methods: { toggleTheme: function () { - this.isDark = !this.isDark; - localStorage.overrideDark = this.isDark; - this.$emit("updated", this.isDark); + let isDark = !this.isDark; + localStorage.overrideDark = isDark; + this.$emit("updated", isDark); }, }, }; diff --git a/src/components/LayoutToggle.vue b/src/components/LayoutToggle.vue new file mode 100644 index 0000000..1ce26c6 --- /dev/null +++ b/src/components/LayoutToggle.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index dea7049..705077c 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -21,8 +21,8 @@ diff --git a/src/components/SettingToggle.vue b/src/components/SettingToggle.vue deleted file mode 100644 index 985ca84..0000000 --- a/src/components/SettingToggle.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/components/services/Generic.vue b/src/components/services/Generic.vue index f19ee18..4720de0 100644 --- a/src/components/services/Generic.vue +++ b/src/components/services/Generic.vue @@ -2,7 +2,8 @@ export default {}; - */ + +*/