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-3-fullscreen-image-directive-plugin

v1.0.4

Published

Vue 3 plugin to open an image in a modal on click

Downloads

137

Readme

Vue 3 Fullscreen Image Directive Plugin

A lightweight Vue.js plugin for creating a fullscreen image modal with customizable options, that support panorama display.

Features

  • Lightweight: Our package is designed to be minimalistic and efficient, ensuring a small footprint without compromising functionality.

  • Panorama Support: Now supports panorama images! Pass an array of imageUrl to create a panorama view.

  • Accessible: We prioritize accessibility to ensure that our package can be easily used by everyone, including users with disabilities.

  • Abundant Options: With a plethora of customizable options, you have the flexibility to tailor the package to suit your specific needs. Explore the extensive set of features to enhance your development experience.

  • Responsive: Our package is built to be responsive, adapting seamlessly to various screen sizes and devices.

Installation

Install the package using npm:

npm install vue-3-fullscreen-image-directive-plugin
yarn add vue-3-fullscreen-image-directive-plugin

Usage

Register the Plugin

import { createApp } from 'vue'
import App from './App.vue'
import { fullscreenImagePlugin } from './fullscreen-image-plugin'
import 'vue-3-fullscreen-image-directive-plugin/style.css' // Don't forget to import the style

createApp(App).use(fullscreenImagePlugin).mount('#app')

Use the Directive

Add the v-fullscreen-image directive to any element you want to trigger the fullscreen image modal on click.

Single Image

Demo single

<template>
  <img v-fullscreen-image="{
    imageUrl: 'https://placehold.co/2000x4000',
    withDownload: false,
    animation: 'blur'
  }"
    src="https://placehold.co/200x400"
  />
</template>

Panorama Images

Demo panorama

<template>
  <img v-fullscreen-image="{
    imageUrl: ['https://placehold.co/2000x4000', 'https://placehold.co/1100x1100'],
    withDownload: true,
    animation: 'blur',
  }"
    src="https://placehold.co/200x400"
  />
</template>

Directive Options

|Name |Type | Description | |---|---|---| |imageUrl | (string, required) | The URL of the image to display | |anchor | (string, optional, default: 'body') | Selector for the element to which the modal will be mounted. | |animation | (string, optional, default: 'fade') | Animation type ('fade', 'blur', 'none'). | |imageAlt | (string, optional) | Alt text for the image. | |withDownload | (boolean, optional, default: true) | Show the download button. | |withClose | (boolean, optional, default: true) | Show the close button. | |withFocusOnClose | (boolean, optional, default: true) | Automatically focus on the close button when the modal opens. | |withCloseOnEscape | (boolean, optional, default: true) | Close the modal when the 'Escape' key is pressed. | |closeOnClickOutside | (boolean, optional, default: true) | Close the modal when clicking outside the image. | |maxHeight | (string, optional, default: '80vh') | Maximum height of the image container. | |maxWidth | (string, optional, default: '80vw') | Maximum width of the image container. | |backdropColor | (string, optional, default: 'rgba(0, 0, 0, 0.7)') | Color of the modal backdrop. |

Author

This npm package is developed and maintained by Anatole Acqueberge, feel free to contibute.

License

This project is licensed under the MIT License