-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
27 lines (24 loc) · 844 Bytes
/
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
<script setup lang="ts">
import "~/assets/main.css"
import {useCustomCursorComposable} from "~/composables/customCursorComposable";
import {onMounted} from "@vue/runtime-core";
import {ref} from "vue";
const {initCustomCursor, setXandY} = useCustomCursorComposable()
const pageContainer = ref()
const customCursorElement = ref()
const customCursorHoverShadow = ref()
onMounted(() => {
initCustomCursor(pageContainer.value, customCursorElement.value, customCursorHoverShadow.value)
})
const setCursorCoordinates = (e: MouseEvent) => {
setXandY(e.x, e.y)
}
</script>
<template>
<div ref="pageContainer" @mousemove="setCursorCoordinates" class="relative">
<div ref="customCursorElement" class="custom-main-cursor">
<div ref="customCursorHoverShadow" class="cursor-hover-shadow"/>
</div>
<NuxtPage/>
</div>
</template>