Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blivesta/chaffle

Shuffle Characters Randomly.
https://github.com/blivesta/chaffle

Last synced: 7 days ago
JSON representation

Shuffle Characters Randomly.

Awesome Lists containing this project

README

        

# Chaffle

[![npm version](https://img.shields.io/npm/v/chaffle.svg?style=flat-square)](https://www.npmjs.com/package/chaffle)
[![Build Status](https://img.shields.io/travis/blivesta/chaffle/master.svg?style=flat-square)](https://travis-ci.org/blivesta/chaffle)

Shuffle Characters Randomly.

## Demo

http://git.blivesta.com/chaffle/

## Install

```html

```

npm

```html
$ npm install chaffle
```

## Usage

### Markup

```html

English


日本語


ひらがな


カタカナ


Українська


中文


Data options


```

### Call the Chaffle

```js
const elements = document.querySelectorAll("[data-chaffle]");
Array.prototype.forEach.call(elements, function(el) {
const chaffle = new Chaffle(el, {
/* options */
});
chaffle.init();
});
```

e.g: mouseover

```js
import Chaffle from "chaffle";

const elements = document.querySelectorAll("[data-chaffle]");
Array.prototype.forEach.call(elements, function(el) {
const chaffle = new Chaffle(el, {
/* options */
});
el.addEventListener("mouseover", function() {
chaffle.init();
});
});
```

## Options

```html


Data options


```

OR

```js
var chaffle = new Chaffle(el, {
lang: "en", // default: 'en'
// 'en' || 'ja' || 'ja-hiragana' || 'ja-katakana' || 'ua' || 'cn'
speed: 20, // default: 20
delay: 100 // default: 100
});
```

## License

Released under the MIT license.