Skip to content

Commit e86a97d

Browse files
committed
fix: correctly import CSSProperties as type
1 parent c357109 commit e86a97d

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

app.vue

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,62 @@
11
<script setup lang="ts">
22
useHead({
3-
titleTemplate: '%s ← Cedrouseroll Omondi',
3+
titleTemplate: "%s ← Cedrouseroll Omondi",
44
bodyAttrs: {
5-
class: 'relative font-space text-slate-400 leading-relaxed bg-[#002937] selection:text-teal-900 selection:bg-teal-300'
6-
}
7-
})
5+
class:
6+
"relative font-space text-slate-400 leading-relaxed bg-[#002937] selection:text-teal-900 selection:bg-teal-300",
7+
},
8+
});
89
9-
import { gsap } from 'gsap';
10-
import { CSSProperties } from 'nuxt/dist/app/compat/capi';
10+
import { gsap } from "gsap";
11+
// import { CSSProperties } from 'nuxt/dist/app/compat/capi';
12+
import type { CSSProperties } from "vue";
1113
12-
const cursorInnerRef = ref()
13-
const cursorOuterRef = ref()
14+
const cursorInnerRef = ref();
15+
const cursorOuterRef = ref();
1416
15-
const { x, y } = usePointer()
16-
const isLeft = usePageLeave()
17+
const { x, y } = usePointer();
18+
const isLeft = usePageLeave();
1719
1820
// hide custom cursor when mouse leaves page
1921
const cursorStyle = computed((): CSSProperties => {
2022
return {
21-
'opacity': isLeft.value ? 0 : 1
22-
}
23-
})
23+
opacity: isLeft.value ? 0 : 1,
24+
};
25+
});
2426
2527
function updateCursor() {
26-
console.log('animating mouse')
28+
console.log("animating mouse");
2729
gsap.set(cursorInnerRef.value, {
2830
left: x.value,
2931
top: y.value,
30-
})
32+
});
3133
3234
gsap.to(cursorOuterRef.value, {
3335
duration: 0.2,
3436
x: x.value,
3537
y: y.value,
3638
});
37-
3839
}
3940
40-
4141
onMounted(() => {
4242
// requestAnimationFrame(updateCursor)
43-
useEventListener('mousemove', updateCursor, document)
44-
})
43+
useEventListener("mousemove", updateCursor, document);
44+
});
4545
</script>
4646

4747
<template>
4848
<NuxtLayout>
4949
<div class="cursor hidden md:flex">
50-
<div ref="cursorInnerRef"
50+
<div
51+
ref="cursorInnerRef"
5152
class="cursor--small pointer-events-none select-none fixed z-50 top-0 left-0 w-2 h-2 rounded-full bg-[#36E4DA]"
52-
:style="cursorStyle">
53-
</div>
54-
<div ref="cursorOuterRef"
53+
:style="cursorStyle"
54+
></div>
55+
<div
56+
ref="cursorOuterRef"
5557
class="cursor--large pointer-events-none select-none fixed z-50 top-0 left-0 w-8 h-8 rounded-full border border-solid border-[#36E4DA]"
56-
:style="cursorStyle">
57-
</div>
58+
:style="cursorStyle"
59+
></div>
5860
</div>
5961
<NuxtPage />
6062
<!-- <UNotifications /> -->

0 commit comments

Comments
 (0)