Skip to content

Commit

Permalink
feat: add vibrate tap tap
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 15, 2024
1 parent bc3beb5 commit 2d36069
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/like.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]`));
Expand Down

0 comments on commit 2d36069

Please sign in to comment.