1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-18 20:05:26 +02:00

feat(frontend): introduce haptic feedback as experimental feature

#16410
This commit is contained in:
syuilo
2025-08-18 10:49:27 +09:00
parent 14cc42e305
commit fcde6789ff
9 changed files with 41 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import { onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
import { getScrollContainer } from '@@/js/scroll.js';
import { i18n } from '@/i18n.js';
import { isHorizontalSwipeSwiping } from '@/utility/touch.js';
import { haptic } from '@/utility/haptic.js';
const SCROLL_STOP = 10;
const MAX_PULL_DISTANCE = Infinity;
@@ -203,6 +204,8 @@ function moving(event: MouseEvent | TouchEvent) {
pullDistance.value = Math.min(Math.max(moveHeight, 0), MAX_PULL_DISTANCE);
isPulledEnough.value = pullDistance.value >= FIRE_THRESHOLD;
if (isPulledEnough.value) haptic();
}
/**