1.0.5 • Published 6 years ago

click-popup v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

click-popup

Build status NPM version NPM Downloads Prettier Conventional Commits

The interaction about funny popup animation

npm.io

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

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago