resolves #29
This commit is contained in:
@@ -11,9 +11,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { useTheme } from 'vuetify'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async created() {
|
async created() {
|
||||||
|
const theme = useTheme()
|
||||||
this.loadUser();
|
this.loadUser();
|
||||||
|
this.lang = this.store.prefs.ui.lang;
|
||||||
|
theme.change(this.store.prefs.ui.theme);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,28 +10,9 @@
|
|||||||
<router-link to="/">{{ l.playground }}</router-link>
|
<router-link to="/">{{ l.playground }}</router-link>
|
||||||
</v-app-bar-title>
|
</v-app-bar-title>
|
||||||
<v-btn to="/manage" icon="mdi-wrench-cog-outline" v-if="roles.editor" v-tooltip="l.workshop"></v-btn>
|
<v-btn to="/manage" icon="mdi-wrench-cog-outline" v-if="roles.editor" v-tooltip="l.workshop"></v-btn>
|
||||||
<v-dialog max-width="480">
|
<CommonHeader></CommonHeader>
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn icon="mdi-account" variant="text" v-bind="props"></v-btn>
|
|
||||||
</template>
|
|
||||||
<template v-slot:default="{ isActive }">
|
|
||||||
<v-card class="pa-3" :title="user? l.profile : l.signin ">
|
|
||||||
<v-card-text>
|
|
||||||
<Profile v-if="user"></Profile>
|
|
||||||
<Auth v-show="!user" @login-success="isActive.value = false"></Auth>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
</template>
|
|
||||||
</v-dialog >
|
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script>
|
||||||
import { useTheme } from 'vuetify'
|
|
||||||
import Profile from './User/Profile.vue';
|
|
||||||
const theme = useTheme()
|
|
||||||
|
|
||||||
function toggleTheme () {
|
|
||||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<template>
|
||||||
|
<v-btn icon="mdi-theme-light-dark" @click="toggleTheme" v-tooltip="l.darkMode"></v-btn>
|
||||||
|
<v-btn-toggle @update:model-value="changeLang" density="compact" v-model="lang" mandatory rounded="xl" color="white" variant="flat" v-show="langOpts">
|
||||||
|
<v-btn size="small" value="bg">BG</v-btn>
|
||||||
|
<v-btn size="small" value="en">EN</v-btn>
|
||||||
|
</v-btn-toggle>
|
||||||
|
<v-btn icon="mdi-translate" @click="langOpts = !langOpts"></v-btn>
|
||||||
|
<v-dialog max-width="480">
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<v-btn icon="mdi-account" variant="text" v-bind="props"></v-btn>
|
||||||
|
</template>
|
||||||
|
<template v-slot:default="{ isActive }">
|
||||||
|
<v-card class="pa-3" :title="user ? l.profile : l.signin">
|
||||||
|
<v-card-text>
|
||||||
|
<Profile v-if="user"></Profile>
|
||||||
|
<Auth v-show="!user" @login-success="isActive.value = false"></Auth>
|
||||||
|
</v-card-text>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { useTheme } from 'vuetify'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
langOpts:false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.theme = useTheme()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleTheme() {
|
||||||
|
this.store.prefs.ui.theme = this.store.prefs.ui.theme == 'dark' ? 'light' : 'dark';
|
||||||
|
this.theme.change(this.store.prefs.ui.theme);
|
||||||
|
},
|
||||||
|
changeLang(v) {
|
||||||
|
this.store.prefs.ui.lang = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -38,23 +38,8 @@
|
|||||||
|
|
||||||
</v-list>
|
</v-list>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-list nav>
|
|
||||||
<v-list-item @click="toggleTheme" prepend-icon="mdi-theme-light-dark" :title="l.darkMode"></v-list-item>
|
|
||||||
<v-list-item prepend-icon="mdi-translate">
|
|
||||||
<v-btn-toggle density="compact" v-model="lang" rounded="xl" color="white" variant="outlined">
|
|
||||||
<v-btn size="small" value="bg">BG</v-btn>
|
|
||||||
<v-btn size="small" value="en">EN</v-btn>
|
|
||||||
</v-btn-toggle>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script>
|
||||||
import { useTheme } from 'vuetify'
|
|
||||||
const theme = useTheme()
|
|
||||||
|
|
||||||
function toggleTheme() {
|
|
||||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
@@ -6,6 +6,10 @@ let prefs = localStorage.getItem('prefs')
|
|||||||
prefs = reactive(prefs ? JSON.parse(prefs) : {
|
prefs = reactive(prefs ? JSON.parse(prefs) : {
|
||||||
xr: {
|
xr: {
|
||||||
depthSense: true
|
depthSense: true
|
||||||
|
},
|
||||||
|
ui:{
|
||||||
|
lang: 'bg',
|
||||||
|
theme: 'light'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user