Skip to content

Commit

Permalink
fix: Adjust mag-cursor tweening, fix tooltip focus
Browse files Browse the repository at this point in the history
  • Loading branch information
kiosion committed Mar 14, 2024
1 parent c556bb7 commit 60afd8f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
});
// offset should be exponential - i.e., the further the x,y from the center of the target, the more the offset
closestTarget.offset?.set([(x - rectCenter[0]) * 0.08, (y - rectCenter[1]) * 0.08]);
closestTarget.offset?.set([(x - rectCenter[0]) * 0.08, (y - rectCenter[1]) * 0.14]);
innerCursor.set({
x,
Expand Down
6 changes: 4 additions & 2 deletions svelte-app/src/components/nav/header-logo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@

<span class="relative h-fit w-fit">
<a
class="focus-outline-sm w-fit select-none rounded-sm font-code text-lg font-extrabold transition-[color]"
class="focus-outline-sm w-fit select-none rounded-sm font-code text-xl font-extrabold transition-[color]"
href={$linkTo(clicks < 3 ? '/' : '/experiments')}
aria-label={$t('Home')}
on:click={handleClick}>kio.dev</a
on:click={handleClick}
>
kio.dev
</a>

{#if showConfetti}
<Confetti on:done={() => (showConfetti = false)} />
Expand Down
13 changes: 8 additions & 5 deletions svelte-app/src/components/tooltips/tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
clearTimeout(timeoutId);
timeoutId = setTimeout(
() => {
() =>
createTooltip({
id: tooltipId,
content: text,
Expand All @@ -38,13 +38,16 @@
followCursor: !fixed,
offset,
target: target as HTMLElement
});
},
Math.max(0, delay - 50)
}),
delay
);
};
const hideTooltip = () => {
const hideTooltip = (e?: Event) => {
if (e?.type === 'mouseleave' && target?.matches(':focus-visible')) {
return;
}
clearTimeout(timeoutId);
destroyTooltip(tooltipId);
};
Expand Down

0 comments on commit 60afd8f

Please sign in to comment.