Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nuel/speak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

speak

Gabe talking using speak.js

A small library for making text appear as if spoken.

It types text one character at a time, knows how to handle formatting tags -- and pauses at commas and other punctuation.

Skipping is also supported, for longer texts.

Use it for visual novels, twine games, anything you can think of!

Try the demo.

Usage

Add speak.js to your page. Then call speak with any DOM element as its first argument.

// Take any DOM element
const element = document.querySelector('.whateverElementYouWantToUse');

// Pass it to speak
speak(element);

Skipping

Calling skip will skip to the end of the current text.

// Skip to the end
skip();

Controlling speed

Using the data attribute data-speed:

<div class="dialog" data-speed=".3">This line will be spoken s l o w l y.</div>

Setting the current speed in your function call:

// This will set the current speaking speed at 50%
speak(element, .5);

About

Visual novel style typewriter effect

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published