/pretty-preview

A pretty image preview package

Primary LanguageTypeScriptMIT LicenseMIT

PrettyPreview

Demo

demo

Install

Install with npm:

npm i pretty-preview

Install with yarn:

yarn add pretty-preview

Install with pnpm:

pnpm add pretty-preview

Usage

import PrettyPreview from 'pretty-preview'
import 'pretty-preview/index.css'

const pp = new PrettyPreview({
  root: '.wrapper'
})

Params

param type default description
root HTMLElement | string document.body The parent element to listen on.
selector string 'img' The element to listen on.
srcAttr string 'src' The property that need to be collected from the selector
useMask boolean true -

License

MIT License © 2022-PRESENT Humandetail