feat: mobile click vibrations

fix: seadex audio term
This commit is contained in:
ThaUnknown 2024-01-07 00:40:32 +01:00
parent df7a82e9c3
commit ec21cf5bef
5 changed files with 4 additions and 2 deletions

View file

@ -7,7 +7,7 @@
"build:web": "webpack build",
"build:android": "cap build android",
"build:ios": "cap build ios",
"build:assets": "capacitor-assets generate --iconBackgroundColor #17191c --iconBackgroundColorDark #17191c --splashBackgroundColor #17191c --splashBackgroundColorDark #17191c --android",
"build:assets": "capacitor-assets generate --iconBackgroundColor #17191c00 --iconBackgroundColorDark #17191c00 --splashBackgroundColor #17191c --splashBackgroundColorDark #17191c --android",
"dev:adb-port": "adb reverse tcp:5001 tcp:5001",
"dev:ios": "run-p dev:start cap-run:ios",
"dev:android": "cap run android",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -17,6 +17,7 @@ export function click (node, cb = noop) {
node.role = 'button'
node.addEventListener('click', e => {
e.stopPropagation()
navigator.vibrate(15)
cb(e)
})
node.addEventListener('pointerup', e => {
@ -50,6 +51,7 @@ export function hoverClick (node, [cb = noop, hoverUpdate = noop]) {
lastTapElement?.(false)
if (lastTapElement === hoverUpdate) {
lastTapElement = null
navigator.vibrate(15)
cb(e)
} else {
lastTapElement = hoverUpdate

View file

@ -17,7 +17,7 @@ export default async function (media) {
type: torrent.isBest ? 'best' : 'alt',
date: new Date(torrent.created),
parseObject: {
audio_term: [torrent.dualAudio && 'DUALAUDIO']
audio_term: [torrent.dualAudio ? 'DUALAUDIO' : '']
}
}
})