0.1.0 • Published 8 years ago

tinytyper v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

⌨️ TinyTyper - a tiny library for creating a typing effect on specified text element.

JavaScript Style Guide Build Status Dependency Status

Demo

Size (It's really tiny)

  • Minimized: 2.9KB
  • Gziped: 1.1KB

Installation

Library can be easily installed via either NPM or Bower:

npm i tinytyper --save

OR

bower i tinytyper --save

Usage

Basic setup looks like this:

import TinyTyper from 'tinytyper';

const el       = document.querySelector('.text-el')
const options  = { /* . . . */ }
const instance = new TinyTyper(el, options)

In case you need to run animation again:

instance.animate()

Available options:

OptionDefaultDescription
textinnerText of specifed elementSets a text to be displayed
textSpeed95Defines of text speed animation
cursor▌Defines current cursor symbol
blinkSpeed0.05Defines blink speed of a cursor
cursorClasstiny-typer-cursorA CSS class for cursor element
textClasstiny-typer-textA CSS class for text element
staticCursorfalseMakes cursor static (disables blinking)
staticTextfalseMakes text static (disables animation)

Contributions

Contributions are welcome. Feel free to create issues and PRs