-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathapp.vue
52 lines (46 loc) · 1.31 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
50
51
52
<template>
<NuxtLayout>
<NuxtPage/>
</NuxtLayout>
<div v-if="isShowBackground" class="eye-catch-backdrop tw-hidden md:tw-block"></div>
<div v-if="isShowEyeCatch" class="eye-catch tw-hidden md:tw-block">
<video autoplay class="object-fit-cover w-100 h-100" muted src="/videos/eyecatch.webm" type='video/webm' @abort="notShow" @canplay="imageLoaded" @error="notShow"/>
</div>
<div v-if="isShowForeground" class="eye-catch-backdrop tw-hidden md:tw-block"></div>
</template>
<script lang="ts" setup>
import "assets/global.less";
const isShowEyeCatch = toRef(true);
const isShowBackground = toRef(true);
const isShowForeground = toRef(true);
const notShow = () => {
console.log("Error Loading EyeCatch")
isShowForeground.value = false
isShowBackground.value = false
isShowEyeCatch.value = false
}
const imageLoaded = () => {
isShowForeground.value = false;
setTimeout(() => {
isShowBackground.value = false;
}, 500);
setTimeout(() => {
isShowEyeCatch.value = false;
}, 3750)
}
</script>
<style lang="less" scoped>
.eye-catch, .eye-catch-backdrop {
width: 100vw !important;
height: 100vh !important;
margin: 0 !important;
padding: 0 !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
z-index: 65535 !important;
}
.eye-catch-backdrop {
background-color: #808080 !important;
}
</style>