You've already forked AstralRinth
forked from didirus/AstralRinth
Standing up global settings page. (#63)
* Adds markup to Settings page. * Fixes card styling. Makes theme a dropdown. Fleshes out theme store and helpers. * Settings wired up to backend. Omorphia package bumped. * settings not syncing * Further polishes Global Settings. * Post-merge cleanup. * Cleans up code. Ensures Java versions are present. * Wires up auto-detect modal. Wires up Java version browse. Styling updates. * Styling inputs. Adjusts modals. * Removes theme helpers. Removes unnecessary classes. * Always displays settings save btn. Watch code removed. New Card added. * Cleans up merge from master. Adds AnimatedLogo to settings. * Installs updated Omorphia. Removes unnecessary styles. Fixes loading logo position. * Starts wiring up theming to settings. Adds Tauri command to get just theme. * Settings page polish. allowList updated. * Condenses modals into one. Implements JRE checking. * Updates Omorphia package. Removes unnecessary styles. * Removes get_theme. Styling changes. * Changes appbar background for light-mode. * Fixes * fix color with var --------- Co-authored-by: thesuzerain <wverchere@gmail.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useTheming = defineStore('themeStore', {
|
||||
state: () => ({ darkTheme: true }),
|
||||
state: () => ({ themeOptions: ['light', 'dark'], selectedTheme: 'dark', darkTheme: true }),
|
||||
actions: {
|
||||
toggleTheme() {
|
||||
this.darkTheme = !this.darkTheme
|
||||
setThemeState(newTheme) {
|
||||
if (this.themeOptions.includes(newTheme)) this.selectedTheme = newTheme
|
||||
else console.warn('Selected theme is not present. Check themeOptions.')
|
||||
|
||||
this.setThemeClass()
|
||||
},
|
||||
setThemeClass() {
|
||||
document.getElementsByTagName('html')[0].classList.remove('dark-mode')
|
||||
document.getElementsByTagName('html')[0].classList.remove('light-mode')
|
||||
document.getElementsByTagName('html')[0].classList.add(`${this.selectedTheme}-mode`)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user