Skip to content

Commit

Permalink
feat: update cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Feb 19, 2024
1 parent 9f7006d commit d323c21
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 6 additions & 5 deletions components/Cursor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ watch(() => route.fullPath, () => {
id="dot"
ref="dotRef"
:style="style.dot"
class="bg-gray4"
bg-white
fixed
z-99999
opacity-0
w5 h5
pointer-events-none
rounded-full
fixed
trans
/>
<div
id="cursor"
Expand All @@ -49,6 +51,7 @@ watch(() => route.fullPath, () => {
rounded-full
w-16
h-16
trans duration-500
:style="style.circle"
/>
</div>
Expand All @@ -60,10 +63,8 @@ watch(() => route.fullPath, () => {
}
#dot {
mix-blend-mode: normal;
mix-blend-mode: difference;
transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
width: 9px;
height: 9px;
transform: translate(-50%, -50%);
}
Expand Down
8 changes: 7 additions & 1 deletion composables/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ export function useDot(style: ICursorStyle) {
})

const toggleDotSize = (newStatus: boolean) => {
const scale = newStatus ? '1.8' : '1'
const scale = newStatus ? '1.5' : '1'
const opacity = newStatus ? '0.5' : '1'

style.dot = {
...style.dot,
'--un-bg-opacity': opacity,
'transform': `translate(-50%, -50%) scale(${scale})`,
opacity: newStatus ? '0.5' : '1',

Check failure on line 74 in composables/cursor.ts

View workflow job for this annotation

GitHub Actions / lint

Inconsistently quoted property 'opacity' found
}

style.circle = {
...style.circle,
opacity: newStatus ? '0' : '1',
}
}
const toggleDotVisibility = (newStatus: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { data: user } = await useFetch('/api/user')
<UserAvatar />
</h1>
<p>
I'm <strong c-primary>{{ user?.name }}</strong>, front-end engineer πŸ§‘πŸ»β€πŸ’» & open source enthusiast.
I'm <strong trans hover="text-3xl" c-primary>{{ user?.name }}</strong>, front-end engineer πŸ§‘πŸ»β€πŸ’» & open source enthusiast.
</p>
<p italic>γ€Œ {{ user?.bio }} 」</p>

Check warning on line 17 in pages/index.vue

View workflow job for this annotation

GitHub Actions / lint

Expected 1 line break after opening tag (`<p>`), but no line breaks found

Check warning on line 17 in pages/index.vue

View workflow job for this annotation

GitHub Actions / lint

Expected 1 line break before closing tag (`</p>`), but no line breaks found
<p>
Expand Down

0 comments on commit d323c21

Please sign in to comment.