Skip to content

Commit

Permalink
fancyTitle: improve anim params
Browse files Browse the repository at this point in the history
Just a notch
  • Loading branch information
vdawg-git committed Dec 13, 2024
1 parent 7b12e14 commit d00fb98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/FancyTitle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const [top, middle, bottom] = colors
/* Max distance the mouse can be away for the title to react
Some squared thing, so the number has to be very high */
const maxDistance = 255550
const offsetMultiplier = 17
const offsetMultiplier = 14

const mouseX = event.clientX
const mouseY = event.clientY
Expand All @@ -88,7 +88,7 @@ const [top, middle, bottom] = colors

top.style.transform = `translate(${(Math.sin(mouseX / 60) * offset) / 2}px, ${(Math.sin(mouseY / 60) * offset) / 2}px)`
middle.style.transform = `translate(${Math.sin(mouseX / 50) * offset + 8}px, ${Math.sin(mouseY / 50) * offset + 8}px)`
bottom.style.transform = `translate(${Math.sin(mouseX / 40) * offset + 16}px, ${Math.sin(mouseY / 40) * offset + 16}px)`
bottom.style.transform = `translate(${Math.sin(mouseX / 46) * offset + 16}px, ${Math.sin(mouseY / 46) * offset + 16}px)`
}
}

Expand Down

0 comments on commit d00fb98

Please sign in to comment.