1.0.0 • Published 6 years ago

vue-tinytyper v1.0.0

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

VueTinyTyper - a vue component for creating a typing effect element.

Credits

This project is forked from https://github.com/lourenc/tinytyper . Some parts of the readme are also originally from above repository.

Why

This project was created because I was missing events in the non-vue version.

Demo

Full credits to https://github.com/lourenc/tinytyper

Installation

Library can be easily installed via either Yarn or NPM:

npm i vue-tinytyper --save

or

yarn add vue-tinytyper

Usage

Basic setup looks like this:

import VueTinytyper from 'vue-tinytyper';

then

<vue-tinytyper text="Hello, please type this out."></vue-tinytyper>

or

<vue-tinytyper>Hello, please type this out.</vue-tinytyper>

Available props:

PropDefaultTypeDescription
text | String | The text to animate
textSpeed95NumberDefines text speed animation
cursor&#9612;StringDefines current cursor symbol
blinkSpeed0.05NumberDefines blink speed of the cursor
containerClass'tiny-typer-container'StringA CSS class for the container element
cursorClasstiny-typer-cursorStringA CSS class for cursor element
textClasstiny-typer-textStringA CSS class for text element
staticCursorfalseBooleanMakes cursor static (disables blinking)
staticTextfalseBooleanMakes text static (disables animation)
customEvents{}ObjectPass custom "on-character" events. Example: { '!': 'my-event' }, where the event 'my-event' will be triggered every time the current animation character matches the object key, eg. "!".

Available events

EventnameTriggerPayload
animation-finishedWhen animation doesn't have any more characters to animateNone

Contributions

Contributions are welcome. Feel free to create issues

License

MIT