RSS FeedTwitterMastodonBlueskyShare IconHeart IconGithub IconArrow IconClock IconGUI Challenges IconHome IconNote IconBlog IconCSS IconJS IconHTML IconShows IconGit IconSpeaking IconTools IconShuffle IconNext IconPrevious IconCalendar IconCalendar Edit Icon
A series of images of an avatar doing a bunch of skateboard tricks.
atom@argyleink
notejs

Play a 🫰(snap) when CSS snaps!

const snap = new Audio('snap.mp3')

scroller.onscrollsnapchange = () =>
  snap.play()

Demo · JS Snap API

Note: you may need to click/tap before scrolling, for the browser to deem playing the audio as user activated.

const snap = new Audio('snap.mp3') scroller.onscrollsnapchange = () => snap.play()

Join the conversation on

31 likes
4 reposts
  • Egor Kloos
  • GENKI
  • Sanat Gersappa
  • Brett Peary
Play a snap sound when #CSS snaps ???? snap on snap! meta snap! ⤷ nerdy.dev/snap-on-snap
Adam ArgyleAdam Argyle

@argyleink At some point you're going to be called Adam Snap Argyle. ????

Egor KloosEgor Kloos

@argyleink Would it be possible to make it also snap when it moves over a snap point?

Jak2kJak2k

Crawl the CSS Webring