text-typing-animation

0.2.2 • Public • Published

Introduction

TextTypingAnimation is a library for typing effects.

Install

node.js

npm install text-typing-animation
var TextTypingAnimation = require('text-typing-animation');

browser

<script src="https://unpkg.com/text-typing-animation"></script>
<script>
  var textTypingAnimation = new TextTypingAnimation(element, options)
</script>

Template

var textTypingAnimation = new TextTypingAnimation(element, options);

Options

  • repeat - (Boolean, Number) Number of times to repeat (default: false)
  • start - (Boolean) Whether to run immediately (default: true)

API

go({ text, [delay], [duration], [append] })

  • text - (String) Text
  • delay - (Number) Time entered per text (default: 100)
  • duration - (Number) A Number determining how long the animation will run
  • append - (Boolean) Whether to append to the string entered

back({ text, [delay], [duration] })

  • text - (String) Text to delete
  • delay - (Number) Time deleted per text (default: 100)
  • duration - (Number) A number determining how long the animation will run

delay(delay)

  • delay - (Number) Delay

clear([duration])

  • duration - Duration

start()

pause()

restart()

stop()

Example

var textTypingAnimation = new TextTypingAnimation(document.getElementById('tta'));
textTypingAnimation
  .go({
    text: 'Hello World!',
    duration: 500
  })
  .go({
    text: '\nText Typing Animation',
    delay: 100
  })
  .back({
    text: 'Typing Animation'
    delay: 200
  });

Package Sidebar

Install

npm i text-typing-animation

Weekly Downloads

16

Version

0.2.2

License

MIT

Unpacked Size

46.7 kB

Total Files

11

Last publish

Collaborators

  • ggons