Short-video apps all share one interaction: a full-screen vertical feed where each swipe snaps to the next video and only the visible one plays. You can build that feel on the web with CSS scroll snapping and an IntersectionObserver , no framework needed. This post walks through a version that also works with the keyboard and respects reduced-motion settings.
The markup
<main class = "feed" tabindex = "0" aria-label = "Video feed" > <section class = "item" ><video src = "clip1.mp4" muted loop playsinline preload = "metadata" ></video></section> <section class = "item" ><video src = "clip2.mp4" muted loop playsinline preload = "metadata" ></video></section> <section class = "item" ><video src = "clip3.mp4" muted loop playsinline preload = "metadata" ></video></section> </main>
Enter fullscreen mode
Exit fullscreen mode
muted and playsinline matter: mobile browsers only allow autoplay for muted, inline video.…