mirror of
https://github.com/artiemis/artie.moe.git
synced 2026-02-14 09:01:55 +00:00
handle touch events
This commit is contained in:
parent
29a70525da
commit
333e226ba4
@ -76,7 +76,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseDown() {
|
function handlePressDown() {
|
||||||
|
console.log("handlePressDown");
|
||||||
model.motion("Tap");
|
model.motion("Tap");
|
||||||
|
|
||||||
holdTimeout = window.setTimeout(() => {
|
holdTimeout = window.setTimeout(() => {
|
||||||
@ -86,7 +87,8 @@
|
|||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseUp() {
|
function handlePressUp() {
|
||||||
|
console.log("handlePressUp");
|
||||||
clearTimeout(holdTimeout);
|
clearTimeout(holdTimeout);
|
||||||
holdTimeout = undefined;
|
holdTimeout = undefined;
|
||||||
}
|
}
|
||||||
@ -187,8 +189,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<canvas
|
<canvas
|
||||||
bind:this={canvas}
|
bind:this={canvas}
|
||||||
onmousedown={handleMouseDown}
|
onmousedown={handlePressDown}
|
||||||
onmouseup={handleMouseUp}
|
onmouseup={handlePressUp}
|
||||||
|
ontouchstart={handlePressDown}
|
||||||
|
ontouchend={handlePressUp}
|
||||||
id="live2d"
|
id="live2d"
|
||||||
class="lg:w-96 w-44 transition-opacity {isLoaded
|
class="lg:w-96 w-44 transition-opacity {isLoaded
|
||||||
? 'opacity-1'
|
? 'opacity-1'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user