embaralha

0.4.1 • Public • Published

embaralha

Shuffles characters in given html element, then restores it's original text. Embaralha means "to shuffle" in portuguese.

As you can observe in this GIF, I strongly recomend that you use a monospace font ;)

Instalation

npm i embaralha or just grab the index.js file.

Usage

If you want to shuffle the text in the mouseover event, you could do it like this:

import { embaralha } from 'embaralha';
const elem = document.querySelector('.your-embaralha-class');
elem.addEventListener('mouseover', async () => embaralha(elem, 1000));

Contributing

Any contribution is welcome, just make sure the tests (npm test) are passing, but don't worry about the webdriver tests (the ones in the test/specs dir). And if you'd be so kind, write your tests for your additions.

Also, you can run it locally with npm start and then going to http://localhost:8080

To Do

  • don't change char when white space ("respect the words")
  • bug fix when mouseover multiple times causing loss of orinal text
  • use webdriver properly
  • use eslint
  • lower the dist file size
  • add to microjs

License

MIT License found in LICENSE file.

Package Sidebar

Install

npm i embaralha

Weekly Downloads

0

Version

0.4.1

License

MIT

Unpacked Size

25.6 kB

Total Files

13

Last publish

Collaborators

  • graciano