# easy-intro

> Step-by-Step operation Guide

Latest version **0.0.6** (published 2020-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-intro
pnpm add easy-intro
yarn add easy-intro
bun add easy-intro
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-02-19 |
| First published | 2020-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 356.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | duanjl |
| Keywords | intro, guide, operation |

## Links

- npm: https://www.npmjs.com/package/easy-intro
- Repository: https://github.com/Dante-dan/easy-intro
- Homepage: https://github.com/Dante-dan/easy-intro#readme
- Issues: https://github.com/Dante-dan/easy-intro/issues
- npm.io page: https://npm.io/package/easy-intro

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2020-02-19
- 0.0.5 — 2020-02-19
- 0.0.4 — 2020-02-19
- 0.0.3 — 2020-02-16
- 0.0.2 — 2020-02-15
- 0.0.1 — 2020-02-15

## README

# easy-intro
## 介绍 [English](./doc/English.md)

`easy-intro` 用于在web页面中，添加一组 **引导**。
通常用来介绍页面的 **功能** 向用户介绍页面的大致布局和功能概括；
或者 **引导操作** 引导用户完成首次操作体验，类似游戏中的新手指引。
通过这种方式，降低用户的学习成本和操作成本。

[Example](./example/index.html)

![Example](./doc/example.gif)


## 安装
### NPM
`npm install easy-intro -S`

### Yarn
`yarn add easy-intro -S`


## API


|    API          | param      | return   | description                                                                                      |
| ----------      | ---------- | ------   | ------------------------------------------------------------------------------------------------ |
| addIntro        | introObj   | function | 为单个元素添加引导（通常引导用户点击按钮，产生真实的效果） , **返回一个函数用于移除该引导**               |
| addIntros       | [introObj] | void     | 添加一组引导，通常用于功能介绍                                                                              |
| removeAllIntro  |            | void     | 移除所有的引导元素                                                                         |
 
 The `introObj` is an Object.
 
| property  | type | default | description | 
| --------  | ---- | ------- | ----------- |
| el        | DOM element | null | 已经出现在dom上的目标元素  |
| desc      | String | "" | 引导描述 |
| realClick | Boolean | true | 该元素是否真的被点击（即按钮的click事件是否触发） |
| hint | Boolean | true | 是否显示引导点击的动画效果 |


## 用法

通过插件的形式，在已有的dom元素上添加引导蒙层。

```javascript
// example.js
import { addIntro, addIntros, removeAllIntro } from "easy-intro";

// Start the introduction for single defined element
const removeIntroItem = addIntro({
  el: document.getElementById('button'),  // 已经出现在dom上的目标元素
  desc: 'Click Me!', // 引导描述
  realClick: true,  // 该元素是否真的被点击（即按钮的click事件是否触发）
  hint: true, // 是否显示引导点击的动画效果
})

// remove this introduction
removeIntroItem();

// Start the introduction for defined elements.
addIntros([
  {
    el: document.getElementById('step-1'),
    desc: 'First Step! click me!',
    realClick: false,
    hint: false,
  },
  {
   el: document.getElementById('step-2'),
   desc: 'Second Step! click me!',
   realClick: false,
   hint: false,
   },
   {
   el: document.getElementById('step-3'),
   desc: 'Third Step! click me!',
   realClick: false,
   hint: false,
   }
]);

// remove All introductions
removeAllIntro();
```

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