Skip to content

Commit

Permalink
Fixed mobile functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelBostelaar committed Mar 1, 2024
1 parent 13ad1e2 commit 3e23dde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ canvas.addEventListener('mousedown', (event) => {
handleDragStart(event.clientX, event.clientY);
});
canvas.addEventListener('touchstart', (event) => {
console.log("Drag with touch!");
//assume single touches
touch = event.changedTouches[0];
handleDragStart(touch.clientX, touch.clientY);
Expand Down
9 changes: 9 additions & 0 deletions style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
max-width: 80vw;
max-height: 80vh;
object-fit: contain;
touch-action: none;
}

main{
Expand All @@ -28,12 +29,20 @@ main{
#controls{
margin-left: 10vw;
}

#imageInput{
max-width: 15vw;
}
}

@media (max-width: 768px) {
main {
flex-direction: column; /* Change to column layout for mobile */
}

#imageInput{
max-width: 40vw;
}
}


Expand Down

0 comments on commit 3e23dde

Please sign in to comment.