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");
|
||||
|
||||
holdTimeout = window.setTimeout(() => {
|
||||
@ -86,7 +87,8 @@
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function handleMouseUp() {
|
||||
function handlePressUp() {
|
||||
console.log("handlePressUp");
|
||||
clearTimeout(holdTimeout);
|
||||
holdTimeout = undefined;
|
||||
}
|
||||
@ -187,8 +189,10 @@
|
||||
</div>
|
||||
<canvas
|
||||
bind:this={canvas}
|
||||
onmousedown={handleMouseDown}
|
||||
onmouseup={handleMouseUp}
|
||||
onmousedown={handlePressDown}
|
||||
onmouseup={handlePressUp}
|
||||
ontouchstart={handlePressDown}
|
||||
ontouchend={handlePressUp}
|
||||
id="live2d"
|
||||
class="lg:w-96 w-44 transition-opacity {isLoaded
|
||||
? 'opacity-1'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user