++ Animation fixed in Home pic.
++"Dark Mode"
This commit is contained in:
@@ -15,6 +15,7 @@ import notifPopover from '../../layouts/toolbar/notifPopover/notifPopover.vue'
|
||||
import coinsPopover from '../../layouts/toolbar/coinsPopover/coinsPopover.vue'
|
||||
import drawer from '../../layouts/drawer/drawer.vue'
|
||||
import { CMyAvatar } from '@/components/CMyAvatar'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useTestStore } from '@store/testStore'
|
||||
@@ -22,11 +23,13 @@ import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import MixinUsers from '../../mixins/mixin-users'
|
||||
import { CMyCart, CSigninNoreg } from '@/components'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MyHeader',
|
||||
components: {
|
||||
drawer, messagePopover, CMyAvatar, CSigninNoreg, CMyCart, notifPopover, coinsPopover
|
||||
drawer, messagePopover,
|
||||
CMyFieldDb, CMyAvatar, CSigninNoreg, CMyCart, notifPopover, coinsPopover
|
||||
},
|
||||
props: {
|
||||
extraContent: {
|
||||
@@ -64,6 +67,8 @@ export default defineComponent({
|
||||
const site = computed(() => globalStore.site)
|
||||
const isfinishLoading = computed(() => globalStore.finishLoading)
|
||||
|
||||
const dark = ref(false)
|
||||
|
||||
const getClassColorHeader = computed(() => {
|
||||
// if (tools.isTest()) return 'bg-light-blue'
|
||||
// if (tools.isDebug()) return 'bg-info'
|
||||
@@ -80,6 +85,23 @@ export default defineComponent({
|
||||
return 'white'
|
||||
})
|
||||
|
||||
watch(() => dark.value, (value: any, oldval: any) => {
|
||||
$q.dark.set(value)
|
||||
tools.setCookie('darkmode', value ? '-1' : '0')
|
||||
})
|
||||
|
||||
function uploadStart() {
|
||||
dark.value = tools.getCookie('darkmode', false, false, false) === '-1'
|
||||
|
||||
$q.dark.set(dark.value)
|
||||
}
|
||||
|
||||
watch(() => globalStore.finishLoading, (value: any, oldval: any) => {
|
||||
if (value) {
|
||||
uploadStart()
|
||||
}
|
||||
})
|
||||
|
||||
const data = ref({
|
||||
registration: null,
|
||||
updateExists: false,
|
||||
@@ -97,6 +119,10 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function created() {
|
||||
|
||||
if (isfinishLoading.value) {
|
||||
uploadStart()
|
||||
}
|
||||
document.addEventListener('swUpdated', updateAvailable, { once: true })
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
// We'll also need to add 'refreshing' to our data originally set to false.
|
||||
@@ -544,6 +570,8 @@ export default defineComponent({
|
||||
site,
|
||||
isfinishLoading,
|
||||
getColorText,
|
||||
costanti,
|
||||
dark,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user