npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mouse-wheel-zoom

v1.1.5

Published

Zoom html elements with mouse wheel

Downloads

1,461

Readme

Mouse wheel zoom

Zoom html elements with mouse wheel.

Live demo

Installation

npm i mouse-wheel-zoom

Usage

import { mouseWheelZoom } from 'mouse-wheel-zoom';

const wz = mouseWheelZoom({
  element: document.querySelector('[data-wheel-zoom]'),
  zoomStep: .25  
});

// reset zoom
wz.reset();

Description

Ispired by Jack Moore wheelzoom This package allow to view image and copy image url after right-click on image.

For given html element mouse-wheel-zoom will replace it with inline-block div wrapper. Wrapper will have two elements - original element with absolute positioning and cloned element with zero opacity. Wrapper size will be determined by zero opacity element, original element with absolute positioning can be moved\resized with mouse.

For element

<img class="image" data-wheel-zoom src="./cat.jpeg">

Mouse-wheel-zoom will replace it with

<div style="display: inline-block; position: relative; overflow: hidden;">
  <img class="image" data-wheel-zoom="" src="./cat.jpeg" style="opacity: 0;">
  <img class="image" data-wheel-zoom="" src="./cat.jpeg" style="position: absolute; top: 0; left: 0;">
</div>

Warning! Do not use for zooming html elements with id. After cloning page will have 2 elements with same id.

Documentation

Config object

Property | Description | Default ---|---|--- element | DOM element to zoom | none zoomStep | Size change for each step, relative to 1 = initial size | .1

Returned object

Method | Description ---|--- reset | Rest current zoom level and position setSrc | Change image src setSrcAndReset | Change image src and reset dispose | Remove zooming element from page

Development

Project require globally installed parcel. Run npm run start and see demo page with live reload on http://localhost:1234