Skip to content

Commit

Permalink
fix panning for alex/mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Jan 14, 2024
1 parent 81ed236 commit 3c1421e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resen/down/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ document.addEventListener('pointerup', () => {
down = false
})

document.addEventListener('pointercancel', () => {
down = false
})

document.addEventListener('pointermove', e => {
if (!down)
return
Expand All @@ -27,4 +31,5 @@ document.addEventListener('pointermove', e => {
dy *= 100 / (bg_size_factor*innerWidth/aspect_ratio-innerHeight)
document.body.style.backgroundPositionX = Math.max(0, Math.min(bg_pos_pct_x + dx, 100)) + '%'
document.body.style.backgroundPositionY = Math.max(0, Math.min(bg_pos_pct_y + dy, 100)) + '%'
// Note: not doing this in CSS due to bug in Firefox. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1874606
})
1 change: 1 addition & 0 deletions resen/down/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ body {
background-position: 43% 40%;
background-size: 500%;
--fg_dim: var(--fg);
touch-action: none;
user-select: none;
-webkit-user-select: none;
}
Expand Down

0 comments on commit 3c1421e

Please sign in to comment.