click-popup
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

click-popup

Build status NPM version NPM Downloads Prettier Conventional Commits

The interaction about funny popup animation

Installation

npm install click-popup
# or use yarn 
yarn add click-popup

Usage

import clickPopup from 'click-popup'
 
const span = document.createElement('span')
span.textContent = '民主'
const dispose = clickPopup(
  ['富强', span, '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善'],
  document.body,
  {
    index: 0,
    styleMapper: style => ({ ...style, color: 'rgb(255,102,81)', fontSize: 12, fontWeight: 'bold' })
  }
)
 
// Call `dispose()` for removing

API

clickPopup(nodeList: Array<Node|string>, Node, options?)

options

  • index: start index (Type: number, Default: 0)
  • styleMapper: style mapper (Type: (style, currentNode) => style, Default: sty => sty)
  • The rest of options see popmotion - tween

Related

  • popmotion - Simple animation libraries for delightful user interfaces

Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i click-popup

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

11.3 kB

Total Files

6

Last publish

Collaborators

  • moyuyc