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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user