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

vue-h-zoom

v0.1.2

Published

Native Vue Zoom images

Downloads

37

Readme

vue-h-zoom

codecov npm vue2

Vue Native Zoom images

Installation

npm i --save-dev vue-h-zoom

About

This plugin is intended to provide native implementation of zooming library. It support thumbnail image and full size image as parameter. Location of zooming preview is configurable through absolute location.

Browser

Include the script file, then install the component with Vue.use(VueHZoom); e.g.:

<script type="text/javascript" src="node_modules/vuejs/dist/vue.min.js"></script>
<script type="text/javascript" src="node_modules/vue-h-zoom/dist/vue-h-zoom.min.js"></script>
<script type="text/javascript">
  Vue.use(VueHZoom);
</script>

Module

import VueHZoom from 'vue-h-zoom';

Usage

Use in template for example as:

<vue-h-zoom image="/assets/bugatti-chiron-white_01_thumb.jpg"
  image-full="/assets/bugatti-chiron-white_01.jpg"
  :zoom-level="4"></vue-h-zoom>

Important notes

To be able to import image locally, you need to register the vue-h-zoom tag to the vue loader, add this to your webpack config:

{
  test: /\.vue$/,
  loader: 'vue-loader',
  options: {
    loaders: {
    },
    // other vue-loader options go here
    transformToRequire: {
      'vue-h-zoom': ['image', 'image-full']
    }
  }
},

Parameters

| Attribute | Type | Default | Value | Description | | :--- | :---: | :---: | :--- | :--- | | image | String | - | - | Image to be displayed in thumbnail. Used also in the zoom if imageFull param is not given (required) | | image-full | String | '' | - | Large version of image| | width | Number | 200 | - | Width of thumbnail in px| | height | Number | 200 | - | Height of thumbnail in px| | zoom-level | Number | 4 | - | Zoom level | | zoom-window-size | Number | 2 | - | Zoom window size multiplier, relative with thumbnail size | | zoom-window-x | Number | 300 | - | Location absolute on x-axis for zoom window | | zoom-window-y | Number | 300 | - | Location absolute on y-axis for zoom window | | background-options | Object | null | BACKGROUND_OPTIONS object or {} or true | Options to create custom background. Please refer to next section for available properties |

BACKGROUND_OPTIONS

| Properties | Type | Default | Description | | :--- | :--- | :--- | :--- | | image | String | 'none' | Image url to be used as background | | color | String | '#fff' | Color to be used in background, use any value compatible with background-color css property | | repeat | Boolean | false | Option to repeat the background image | | size | String | '100%' | Set the size of background image, use any value compatible with background-size css property | | position | String | 'top left' | Set the position of background image, use any value compatible with background-position css property |

Additional notes:

  • You can specify truthy value to use default background options, such as <vue-h-zoom background-options="true" /> or <vue-h-zoom background-options="{}" />
  • You only need to specify property (s) that you need, such as <vue-h-zoom background-options="{ color: 'blue' }" />
  • Using background-options automatically update the image size property to background-size: contain;, instead of the default background-size: cover;. This is done so that the background is also included in zoomed preview.

Preview

:copyright: License

MIT