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

v-image-magnifier

v1.2.0

Published

A Vue 3 plugin that provides interactive image zoom functionality. Allow users to zoom in on an image by hovering over it, providing an enlarged view of the corresponding part of the image.

Downloads

195

Readme

License: MIT build

v-image-magnifier

A Vue 3 plugin that provides interactive image zoom functionality. Allow users to zoom in on an image by hovering over it, providing an enlarged view of the corresponding part of the image.

Installation

To install v-image-magnifier, run the following command:

npm install --save v-image-magnifier

Options

| Option | Type | Default | Description | Required | | ------- | -------- | -------- | -------- | -------- | | altImage | string | | Value for the alt attribute of the image. | | | backgroundColor | string | "#ffff" | Image background color (Visible when zooming in on an image border). | | | boxShadow | string | "0 5px 10px -2px rgba(0, 0, 0, 0.5)" | Magnifying glass shadow style. | | | cursorNone | boolean | true | Hides the cursor in the middle of the magnifying glass. | | | deactivate | boolean | false | Disables the magnifying glass system (Allows the image to be displayed normally). | | | fitContent | boolean | true | Allows you to specify whether the size of the box containing the image should automatically adapt to the size of the image. When this option is enabled (true), the box will have a width and height equal to the size of the image. When disabled (false), the box will have a width of 100% and a height of 100% of its container, and the image will be resized to fit this size. | | | imgClass | string | | A CSS class that will be placed on the image. | | | magnifiedBorderRadius | number | 50 | The radius of the magnifying glass. | | | magnifiedBorderSize | number | 4 | The border size of the magnifying glass. | | | magnifiedBorderColor | string | "#ffff" | The amount of blur to apply to the element. | | | magnifiedBorderStyle | string | "solid" | The border style of the magnifying glass (Solid, dotted, double...) | | | magnifiedTransition | string | "opacity 0.2s" | Transition effect to be applied when the magnifying glass enters the image. | | | src | string | | source of the image to display. | ✓ | | zIndex | number | 99 | z-index of the magnifying glass. | | | zoomSize | number | 100 | Size of the magnifying glass. | | | zoomFactor | number | 1.8 | Zoom factor (Allows you to manage the power of the zoom). | |

Events

| Name | Description | | ------- | -------- | | loaded | Event sent when the image is fully loaded by the browser |

Usage

Global Usage

To use VImageMagnifier globally in your Vue.js application, you can install it using app.use in the entry point of your main application file.

import { createApp } from "vue";
import VImageMagnifier from "v-image-magnifier";

const app = createApp(App);
app.use(VImageMagnifierPlugin, {
         // Change options here
         zoomSize: 150,
         zoomFactor: 2,
         // ...
    });
app.mount("#app");

By passing an options object to app.use, you can customize the behavior of VImageMagnifier. In the example above, the zoomFactor option is set to 2, which increases the zoom level, and the zoomSize option is set to 150 for a bigger magnifying glass.

These options will be applied globally to all instances of the VImageMagnifier component in your application.

Example Usage

<template>
  <VImageMagnifier 
      src="path/to/my/file.png"
      :zoomSize="200
      :zoomFactore="2"
      :magnifiedBorderRadius="5"
   />
</template>

Example

Demo GIF of Magnifier

Demo GIF of Magnifier

Demo GIF of Magnifier

Contributing

Contributions, issues and feature requests are welcome! Feel free to check the issues page or create a pull request.

License

v-image-magnifier is licensed under the MIT License. See the LICENSE file for more information.