Skip to content

Commit 3e23dde

Browse files
Fixed mobile functionality
1 parent 13ad1e2 commit 3e23dde

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

js/shared.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ canvas.addEventListener('mousedown', (event) => {
114114
handleDragStart(event.clientX, event.clientY);
115115
});
116116
canvas.addEventListener('touchstart', (event) => {
117+
console.log("Drag with touch!");
117118
//assume single touches
118119
touch = event.changedTouches[0];
119120
handleDragStart(touch.clientX, touch.clientY);

style/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
max-width: 80vw;
77
max-height: 80vh;
88
object-fit: contain;
9+
touch-action: none;
910
}
1011

1112
main{
@@ -28,12 +29,20 @@ main{
2829
#controls{
2930
margin-left: 10vw;
3031
}
32+
33+
#imageInput{
34+
max-width: 15vw;
35+
}
3136
}
3237

3338
@media (max-width: 768px) {
3439
main {
3540
flex-direction: column; /* Change to column layout for mobile */
3641
}
42+
43+
#imageInput{
44+
max-width: 40vw;
45+
}
3746
}
3847

3948

0 commit comments

Comments
 (0)