No description
  • JavaScript 65%
  • HTML 24.2%
  • SCSS 10.8%
Find a file
2017-05-18 13:39:58 +10:00
css updates to the demo site 2015-10-10 22:09:32 +11:00
dist remove npm-debug.log 2016-02-09 21:37:55 +11:00
scss updates to the demo site 2015-10-10 22:09:32 +11:00
src squash bug that starts more than 1 instance at a time 2015-10-31 19:47:20 +11:00
.gitignore update gitignore to ignore .sass-cache 2015-10-10 12:02:31 +11:00
bower.json 0.3.4 2017-05-18 13:39:58 +10:00
Gruntfile.js add a minfied version 2015-10-15 20:26:55 +11:00
index.html Remove references to samjdavis13 github profile 2017-05-18 13:39:13 +10:00
LICENSE-MIT add license file 2015-10-10 12:00:14 +11:00
package.json 0.3.4 2017-05-18 13:39:58 +10:00
README.md Remove references to samjdavis13 github profile 2017-05-18 13:39:13 +10:00

TWReplace.js

Continually replace text using a typing animation.

follow @samjdavis for updates on TWRelpace.

LIVE DEMO

Live examples

sjd.co

Documentation

It takes just second to install and use TWReplace.js

Installation

Bower
bower install twreplace
HTML
<script src="src/twreplace.js"></script>

Basic Usage

HTML

Usage is incredibly simple requiring only a single dataset attribute added to any text based html element. It is important to pass a valid JSON array, including double quotes, of values.

<p>This text has an <span twreplace='["fantastic", "easy", "simple"]'>editable</span> element</p>

Customisability

Several options are available to TWReplace.js at this stage:

  • twreplace-charspeed (Speed that characters are removed/added. Measured in ms. Defaults to 25)
 <p twreplace='["Word 1", "Word 2"]' twreplace-charspeed="50">Change</p>
  • twreplace-wordspeed (Speed that words are changed. Measured in ms. Defaults to 2000)
 <p twreplace='["Word 1", "Word 2"]' twreplace-wordspeed="1000">Change</p>

Contribute

The library is written in vanilla javascript, please update src/twreplace.js

We use grunt to compile the scss into css.

Install the libraries

npm install

Get the compilation running in the background

grunt watch

Bug Tracker

If you find a bug, please report it here on Github!

Developer

Developed by Samuel Davis, sjd.co

Thanks!