-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
100 lines (76 loc) · 1.75 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
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
93
94
95
96
97
98
99
100
<template>
<div class=" w-screen bg-[#1A1A1A] text-white">
<NuxtPage />
<A-Menu v-if="menuState" />
<A-Cities v-if="citiesState"> </A-Cities>
</div>
</template>
<script setup lang="ts">
import gsap from "gsap";
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import Lenis from "@studio-freight/lenis";
import axios from "axios";
import 'vue3-lottie/dist/style.css'
const menuState = useState('menu', () => false)
const citiesState = useState("citiesState", () => false);
const quizState = useState("quizState", () => 1);
if (typeof window !== 'undefined') {
gsap.registerPlugin(ScrollTrigger);
}
const route = useRoute()
onMounted(async () => {
const lenis = new Lenis()
function raf(time: any) {
lenis.raf(time)
requestAnimationFrame(raf)
}
lenis.on('scroll', ScrollTrigger.update)
gsap.ticker.add((time) => {
lenis.raf(time * 1000)
})
function getClientId(): string {
const existingClientId = localStorage.getItem('clientId');
if (existingClientId) {
return existingClientId;
} else {
const newClientId = crypto.randomUUID();
localStorage.setItem('clientId', newClientId);
return newClientId;
}
}
console.log(getClientId())
requestAnimationFrame(raf)
//data collection starts here
});
</script>
<style>
* {
box-sizing: border-box;
padding: 0px;
margin: 0px;
}
.no-scroll {
overflow: hidden;
}
html,
body {
width: 100%;
overflow-x: clip;
font-family: 'Biennale', 'Biennale Book';
}
html.lenis {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
.lenis.lenis-scrolling iframe {
pointer-events: none;
}
</style>