MCPcopy Index your code
hub / github.com/bmcmahen/image-zoom

github.com/bmcmahen/image-zoom @1.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.1 ↗ · + Follow
3 symbols 4 edges 3 files 2 documented · 67% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

image-zoom

Zoom an image to full-screen, as seen on Medium.com. It uses transforms for buttery smoothness, but should still work on older browsers given polyfills for classList & bind. Demo here

Installation

Install using Duo

var Zoom = require('bmcmahen/image-zoom');

or use the standalone build in dist using the global Imagezoom.

API

You can use markup (much like Bootstrap) for initiating zoom on certain elements.

<img class='thumb' src='inst6.jpg' data-zoom-padding='20' data-zoom-url='inst6.jpg' data-zoom-overlay='true'>
<script src='imagezoom.js'></script>

Or you can use the javascript API, like in the example below.

<img class='thumb' src='inst6.jpg'>

<script>
var ImageZoom = require('image-zoom');

var img = document.querySelector('img');
var zoom = new Imagezoom(img).overlay().padding(350);

img.onclick = function(e){
  // stop propagation if we want to retain our HTML api
  // in other parts of the site.
  e.stopPropagation();
  zoom2.show();
};

// unbind our delegate listener if we aren't
// using the HTML api.
zoom.stopListening();

</script>

.show()

Zoom in.

.hide()

Zoom out.

.overlay()

Enable the overlay when zooming into the image.

.padding(num)

Set the padding of the zoomed image.

.use(plugin)

Use a plugin.

Events

showing

shown

hiding

hidden

cancel

var zoom = require('image-zoom');
var z = zoom(document.querySelector('img'));
z.on('shown', function(){
  // our element is zoomed in
});

License

MIT

Core symbols most depended-on inside this repo

translateString
called by 2
index.js
Zoom
called by 0
index.js
onImageLoad
called by 0
index.js

Shape

Function 3

Languages

TypeScript100%

Modules by API surface

index.js3 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add image-zoom \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact