# click-popup

> The interaction about funny popup animation

Latest version **1.0.5** (published 2018-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install click-popup
pnpm add click-popup
yarn add click-popup
bun add click-popup
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-10-03 |
| First published | 2018-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | imcuttle, click-popup |

## Links

- npm: https://www.npmjs.com/package/click-popup
- Repository: https://github.com/imcuttle/click-popup
- Homepage: https://github.com/imcuttle/click-popup#readme
- Issues: https://github.com/imcuttle/click-popup/issues
- npm.io page: https://npm.io/package/click-popup

## Dependencies (1)

- [popmotion](https://npm.io/package/popmotion.md) ^8.4.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2018-10-03
- 1.0.4 — 2018-09-25
- 1.0.3 — 2018-09-25
- 1.0.2 — 2018-09-25

## README

# click-popup

<!--[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/click-popup.svg?style=flat-square)](https://codecov.io/github/imcuttle/click-popup?branch=master)-->

[![Build status](https://img.shields.io/travis/imcuttle/click-popup/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/click-popup)
[![NPM version](https://img.shields.io/npm/v/click-popup.svg?style=flat-square)](https://www.npmjs.com/package/click-popup)
[![NPM Downloads](https://img.shields.io/npm/dm/click-popup.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/click-popup)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)

The interaction about funny popup animation

![](./screenshot.gif)

- [Live Demo](https://imcuttle.github.io/click-popup)

## Installation

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

## Usage

```javascript
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](https://popmotion.io/api/tween/#tween-props)

## Related

- [popmotion](https://github.com/Popmotion/popmotion) - Simple animation libraries for delightful user interfaces

## Authors

This library is written and maintained by imcuttle, <a href="mailto:moyuyc95@gmail.com">moyuyc95@gmail.com</a>.

## License

MIT

---
_Source: https://npm.io/package/click-popup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
