New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@9am/img-tissue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@9am/img-tissue

A web component animates an image with a minimization effect.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source
img-tissue

<img-tissue>

A web component animates an image with a minimization effect.

Demo

https://user-images.githubusercontent.com/1435457/169442632-62b8e967-6a4f-4c9f-a00f-c17cb436ad8f.mp4

Usage

  • Installation

    npm install @9am/img-tissue
    
  • ESM

    // HTML
    <img-tissue src="/url.png"></img-tissue>
    
    import { register } from '@9am/img-tissue'
    register({})
    

    or try it with skypack without installation

    import { register } from 'https://cdn.skypack.dev/@9am/img-tissue'
    register({})
    
  • Zoom

    // js
    const tissue = document.querySelector('img-tissue')
    tissue.zoomIn({ clientX: 0, clientY: 0, duration: 300 })
    tissue.zoomOut({ clientX: 0, clientY: 0, duration: 300 })
    

API

  • < img-tissue > attributes

    NameTypeDefaultDescription
    src{String}RequiredThe image URL
    title{String}''For screen readers
    column{Number}4Split area into {column} vertically
    row{Number}4Split area into {row} horizontally
  • < img-tissue > methods

    NameParamsTypeDefaultDescription
    zoomIn({ clientX, clientY, duration }){Function}ZoomIn the image to target position
    zoomOut({ clientX, clientY, duration }){Function}ZoomOut the image to
    clientX{Number}RequiredX position on the client viewport
    clientY{Number}RequiredY position on the client viewport
    duration{Number}RequiredDuration of the animation(ms)
  • register options

    NameTypeDefaultDescription
    tagName{String}img-tissueChange tag name of the web component

Development

  • Install dependencies

    npm install

  • Start dev server

    npm run dev

  • Put images under ./demo/img, replace image URL in index.html

  • Open localhost:3000 in the browser

Testing

TBD

License

MIT

Keywords

web component

FAQs

Package last updated on 20 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts