The interaction about funny popup animation
npm install click-popup
# or use yarn
yarn add click-popup
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
index
: start index (Type:number
, Default:0
)styleMapper
: style mapper (Type:(style, currentNode) => style
, Default:sty => sty
)- The rest of options see popmotion - tween
- popmotion - Simple animation libraries for delightful user interfaces
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT