-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.vue
49 lines (42 loc) · 1.2 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
<div class='overflow-hidden'>
<div :class='getBackgroundClasses()' class='relative text-violet-700' >
<HeaderBar class='absolute top-0' />
<NuxtPage id="NuxtPage" class='h-screen w-screen ' />
</div>
</div>
</template>
<script>
import { useCameraStore } from './store'
import { onMounted } from 'vue'
import icon from './static/icon.png'
export default {
name: 'App',
setup () {
const camStore = useCameraStore()
const getBackgroundClasses = () => {
if (camStore.darkMode === true) {
return 'bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#4c1d95] to-[#FFFFFF]'
} else if (camStore.darkMode === false) {
return 'bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#4c1d95] to-[#000000]'
}
}
function setViewHeight () {
const vh = window.innerHeight
document.getElementById('NuxtPage').style.height = `${vh}px`
}
onMounted(() => {
if (window.innerWidth < 768) {
setViewHeight()
window.addEventListener('resize', () => {
setViewHeight()
})
}
})
return {
camStore,
getBackgroundClasses
}
}
}
</script>