From 33bc465182a14ddf7b01b8bf4227dbba0938c398 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 29 Dec 2020 18:49:31 +0900 Subject: [PATCH] feat: vibrate --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 620cb30..3f9d975 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,11 +35,16 @@ function render() { renderer.render(scene, camera); } +function vibrate() { + if ("vibrate" in navigator) navigator.vibrate(100); +} + function drawRect() { raycaster.setFromCamera(mouse, camera); const [intersect] = raycaster.intersectObjects(panels); if (!intersect) return; + vibrate(); try { // FIXME: Error: Start time must be strictly greater than previous start time. synth.triggerAttackRelease("C4", "16n");