Skip to content

Commit 849acbc

Browse files
committed
created a dot that follows the cursor
todo add it to every page
1 parent 720a223 commit 849acbc

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

components/mouseDot.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div
3+
ref="circle"
4+
class="bg-accent w-3 h-3 rounded-full absolute pointer-events-none"
5+
></div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
setup() {
11+
const circle = ref(null);
12+
13+
onMounted(() => {
14+
document.addEventListener("mousemove", (event) => {
15+
if (circle.value) {
16+
circle.value.style.left = event.clientX - 6 + "px";
17+
18+
circle.value.style.top = event.clientY - 7 + "px";
19+
}
20+
});
21+
});
22+
23+
return { circle };
24+
},
25+
};
26+
</script>

pages/projects/hitboxv1.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
</p>
4646
</div>
4747
</div>
48+
<mouseDot />
4849
</template>
4950
<script setup lang="ts">
5051
useHead({

0 commit comments

Comments
 (0)