From 2d360696f9f71d6f39dd593630b0fc1ce50d2b5b Mon Sep 17 00:00:00 2001 From: dewanakl Date: Tue, 15 Oct 2024 17:06:06 +0700 Subject: [PATCH] feat: add vibrate tap tap --- js/like.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/like.js b/js/like.js index 18d2299f..521b1786 100644 --- a/js/like.js +++ b/js/like.js @@ -105,6 +105,9 @@ export const like = (() => { const uuid = div.id.replace('body-content-', ''); if (tapLength < 300 && tapLength > 0 && !likes.has(uuid) && div.getAttribute('data-liked') !== 'true') { + if (navigator.vibrate) { + navigator.vibrate(100); + } animation(div); div.setAttribute('data-liked', 'true'); await like(document.querySelector(`[onclick="like.like(this)"][data-uuid="${uuid}"]`));