-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.vue
89 lines (70 loc) · 1.66 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
<template lang="pug">
nuxt-layout( )
nuxt-page
svg-filters( v-if="!$device.isSafari" )
</template>
<script lang="ts" setup>
// @TODO: Import UI Kit
import '~/styles/main.styl'
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
import { ScrollToPlugin } from 'gsap/ScrollToPlugin'
import Lenis from '@studio-freight/lenis'
const setupSmoothScroll = () => {
const lenis = new Lenis({
normalizeWheel: true,
lerp: 0.2,
})
lenis.on('scroll', ScrollTrigger.update)
gsap.ticker.add((time)=>{
lenis.raf(time * 1000)
})
gsap.ticker.lagSmoothing(0)
}
onMounted(() => {
gsap.registerPlugin(ScrollTrigger)
gsap.registerPlugin(ScrollToPlugin)
// setupSmoothScroll()
})
</script>
<style lang="stylus">
// Scaffolding
::selection
background-color: brand(20)
body
margin: 0
font-family: "Noto Sans SC", "Inter", "Roboto", "Helvetica", "Arial", sans-serif
color: $primary100
font-size: 1rem
line-height: 1.5
letter-spacing: 0.00938em
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
-webkit-overflow-scrolling: touch
overscroll-behavior-y: contain
// Hide scrollbar
&::-webkit-scrollbar
width: 0px
&::-webkit-scrollbar *
background: transparent
&::-webkit-scrollbar-thumb
background: rgba(0,0,0,0.001) !important
&.disable-scroll
overflow: hidden
.font-chakra
font-family: 'Chakra Petch', "Noto Sans SC", sans-serif
*, :before, :after
box-sizing: border-box
html.lenis {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
</style>