Skip to content

Commit

Permalink
fixed scrolling bug on buttons galore
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed Sep 7, 2024
1 parent dff479b commit a7b0240
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pages/buttons-galore.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ my personal collection of 88x31 buttons (that you can contribute to), all in one
const tooltip = document.querySelector('.tooltip')

window.addEventListener('mousemove', (e) => {
const mouseX = e.clientX;
const mouseY = e.clientY;
const mouseX = e.clientX + window.scrollX;
const mouseY = e.clientY + window.scrollY;

tooltip.style.left = `${mouseX + 10}px`; // Offset to prevent cursor overlap
tooltip.style.top = `${mouseY + 10}px`;
Expand Down
2 changes: 1 addition & 1 deletion src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ button {

.tooltip {
opacity: 0;
position: absolute;
position: fixed;
width: max-content;
user-select: none;
pointer-events: none;
Expand Down

0 comments on commit a7b0240

Please sign in to comment.