View on GitHub

realistic-typewriter.js

A library for simulating typewriter effect in the browser

Download this project as a .zip file Download this project as a tar.gz file

realistic-typewriter.js

A library for simulating typewriter effect in the browser.

Demo

Usage

var tw = typewriter(targetDomElement).withAccuracy(90)
                                     .withMinimumSpeed(5)
                                     .withMaximumSpeed(10)
                                     .build();

tw.clear()
  .put('$ ')
  .waitRange(1000, 2000)
  .type('whoami')
  .put('<br/>')
  .wait(2000)
  .put('realistic-typewriter.js', function () {
    console.log('yeah');
  })
  .put('<br/>')
  .waitRange(500, 1000)
  .put('$ ')
  .waitRange(1000, 2000)
  .type('exit', function () {
    console.log('finished');
  });

Showcase

Did something interesting with realistic-typewriter.js?

Tweet me about it!

Installation

You can use this library with browserify or download a pre-compiled version (see below) from the project's releases page.

build/typewriter-bundle.js is the browserify bundle.
build/typewriter-bundle.min.js is the minified version of the browserify bundle.
build/typewriter-bundle-sa.js is the UMD browserify bundle.
build/typewriter-bundle-sa.min.js is the minified version of the UMD browserify bundle.

License

Copyright (c) 2013 Fardjad Davari

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.