feat: vibrate

This commit is contained in:
Nebel 2020-12-29 18:49:31 +09:00
parent 57e9adf317
commit 33bc465182

View file

@ -35,11 +35,16 @@ function render() {
renderer.render(scene, camera); renderer.render(scene, camera);
} }
function vibrate() {
if ("vibrate" in navigator) navigator.vibrate(100);
}
function drawRect() { function drawRect() {
raycaster.setFromCamera(mouse, camera); raycaster.setFromCamera(mouse, camera);
const [intersect] = raycaster.intersectObjects(panels); const [intersect] = raycaster.intersectObjects(panels);
if (!intersect) return; if (!intersect) return;
vibrate();
try { try {
// FIXME: Error: Start time must be strictly greater than previous start time. // FIXME: Error: Start time must be strictly greater than previous start time.
synth.triggerAttackRelease("C4", "16n"); synth.triggerAttackRelease("C4", "16n");