0.0.7 • Published 9 years ago

typewriter.js v0.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Typewriter

Typewriter provides an easy way to print out text on the web. It comes with a few different configuration options that are all documented below.

See some examples here.

Letter by letter, fixed interval.

var tw = new Typewriter('.example-1-output', {
    text: 'I love printing text! Pity my intervals are the same each time.',
    interval: 100
});

tw.type();

Letter by letter, random natural human interval.

var tw = new Typewriter('.example-2-output', {
    text: 'My intervals are randomised to look like a human is typing.',
    interval: 'human'
});

tw.type();

Word by work, fixed interval

var tw = new Typewriter('.example-3-output', {
    text: 'I LOVE PRINTING THE MOST!',
    interval: 500,
    words: true
});

tw.type();

Letter by letter, random natural human interval with bounds specified and a callback on completion.

var tw = new Typewriter('.example-4-output', {
    text: 'Woah! So glad this is the last example I have to sit through.',
    interval: 'human',
    lowerBound: 30,
    upperBound: 130
});

tw.type(function() {
    console.log('Finished typing now');
});

All options

var tw = new Typewriter('selector', {
    text: 'The text to write into the selector',
    words: false, // Optional. Defaults to false.
    interval: 'human' || 300, // Optional. Defaults to human.
    lowerBound: 30 || null, // Optional. Defaults to 30ms
    upperBound: 200 || null // Optional. Defaults to 200ms
});

tw.type(callback)
0.0.7

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago