diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-18 10:49:27 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-18 10:49:27 +0900 |
| commit | fcde6789ff4d896e2170b36faa9e9fba7b4a0e57 (patch) | |
| tree | ab2cebb72af4f45639272cde36d2d21a94c37f8c /packages/frontend/src/components | |
| parent | Bump version to 2025.8.0-alpha.13 (diff) | |
| download | misskey-fcde6789ff4d896e2170b36faa9e9fba7b4a0e57.tar.gz misskey-fcde6789ff4d896e2170b36faa9e9fba7b4a0e57.tar.bz2 misskey-fcde6789ff4d896e2170b36faa9e9fba7b4a0e57.zip | |
feat(frontend): introduce haptic feedback as experimental feature
#16410
Diffstat (limited to 'packages/frontend/src/components')
4 files changed, 12 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 0248d75f75..df05bcc94c 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -141,6 +141,7 @@ import { $i } from '@/i.js'; import { checkReactionPermissions } from '@/utility/check-reaction-permissions.js'; import { prefer } from '@/preferences.js'; import { useRouter } from '@/router.js'; +import { haptic } from '@/utility/haptic.js'; const router = useRouter(); @@ -431,6 +432,8 @@ function chosen(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef, const key = getKey(emoji); emit('chosen', key); + haptic(); + // 最近使った絵文字更新 if (!pinned.value?.includes(key)) { let recents = store.s.recentlyUsedEmojis; diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index b65f610986..c7361a19c6 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -46,6 +46,7 @@ import { claimAchievement } from '@/utility/achievements.js'; import { pleaseLogin } from '@/utility/please-login.js'; import { $i } from '@/i.js'; import { prefer } from '@/preferences.js'; +import { haptic } from '@/utility/haptic.js'; const props = withDefaults(defineProps<{ user: Misskey.entities.UserDetailed, @@ -84,6 +85,8 @@ async function onClick() { wait.value = true; + haptic(); + try { if (isFollowing.value) { const { canceled } = await os.confirm({ diff --git a/packages/frontend/src/components/MkPullToRefresh.vue b/packages/frontend/src/components/MkPullToRefresh.vue index c792ff3488..89aca5d29b 100644 --- a/packages/frontend/src/components/MkPullToRefresh.vue +++ b/packages/frontend/src/components/MkPullToRefresh.vue @@ -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(); } /** diff --git a/packages/frontend/src/components/MkSwitch.vue b/packages/frontend/src/components/MkSwitch.vue index 92359b773a..9a2bea3616 100644 --- a/packages/frontend/src/components/MkSwitch.vue +++ b/packages/frontend/src/components/MkSwitch.vue @@ -30,6 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only import { toRefs } from 'vue'; import type { Ref } from 'vue'; import XButton from '@/components/MkSwitch.button.vue'; +import { haptic } from '@/utility/haptic.js'; const props = defineProps<{ modelValue: boolean | Ref<boolean>; @@ -48,6 +49,8 @@ const toggle = () => { if (props.disabled) return; emit('update:modelValue', !checked.value); emit('change', !checked.value); + + haptic(); }; </script> |