finds.dev← search

// the find

hakimel/zoom.js

★ 1,611 · HTML · MIT · updated May 2021

zoom in on any element in the DOM

A tiny library (~150 lines) that zooms into a specific DOM element or coordinate using CSS transforms. It was extracted from reveal.js and works well enough in that narrow context — presentation slides, demos, focused walkthroughs.

Uses CSS transform scale() with translate correction, so it works without reflow or layout recalculation. Zero dependencies and the whole thing is one file you can just drop in. The point-based API (x/y/width or scale) is useful when you need to zoom into a region rather than an element.

The author explicitly calls it a proof of concept and says not to use it for anything important — that's an unusual README. Last touched in 2021, no npm package, no TypeScript types, and the README still warns about IE compatibility as if that's a current concern. No handling for zooming nested elements, scrollable containers, or anything with position:fixed, which makes it fragile outside of full-page slideshow contexts. At 1600 stars it's almost entirely coattails from reveal.js.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →