-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.vue
More file actions
92 lines (75 loc) · 1.66 KB
/
Copy pathapp.vue
File metadata and controls
92 lines (75 loc) · 1.66 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<canvas id="three" ref="threeCanvas"></canvas>
<div class="three overlay" :class="{ loading: isThreeLoading, loaded: !isThreeLoading }"></div>
<ThreeJs :canvas="threeCanvas" @loaded="onThreeLoaded"></ThreeJs>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<script lang="ts" setup>
const threeCanvas = ref<HTMLCanvasElement | null>(null);
const isThreeLoading = ref(true);
const onThreeLoaded = () => {
isThreeLoading.value = false;
};
</script>
<style lang="scss" scoped>
#three {
position: fixed;
inset: 0;
outline: none;
z-index: -2;
}
.overlay {
position: absolute;
inset: 0;
z-index: -1;
transition: background-color 600ms ease-in-out;
pointer-events: none;
&.loading {
background-color: black;
}
&.loaded {
background-color: transparent;
}
}
</style>
<style lang="scss">
html {
&,
* {
scrollbar-width: thin;
scrollbar-color: var(--color-primary);
/* scrollbar-color: color.change($primary, $saturation: 50%, $lightness: 35%) color.change($bg-black, $lightness: 30%); */
}
}
body {
background-color: black;
}
.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
transition: all var(--page-transition-duration);
}
.slide-left-enter-from {
opacity: 0;
transform: translateX(70%) scale(90%);
overflow-x: hidden;
}
.slide-left-leave-to {
opacity: 0;
transform: translateX(-70%) scale(90%);
overflow-x: hidden;
}
.slide-right-enter-from {
opacity: 0;
transform: translateX(-70%) scale(90%);
overflow-x: hidden;
}
.slide-right-leave-to {
opacity: 0;
transform: translateX(70%) scale(90%);
overflow-x: hidden;
}
</style>