Natural Typing Animations In JavaScript – Typecadence

Category: Animation , Javascript , Text | July 28, 2023
Author:ccmars
Views Total:158 views
Official Page:Go to website
Last Update:July 28, 2023
License:MIT

Preview:

Natural Typing Animations In JavaScript – Typecadence

Description:

Typecadence is a JavaScript library that provides an animated typing effect that simulates natural human typing, including speed variations and mistakes.

How to use it:

1. Download and include the Typecadence library on the page.

<script src="/dist/typecadence.js"></script>

2. Apply the typing effect to any HTML element with the class typecadence.

<span class="typecadence">
  ...
</span>

3. The start of the typing animation can be delayed using the data-typecadence-delay attribute. The value is in milliseconds.

<span class="typecadence" data-typecadence-delay="3000">
  This is Typecadence with a start delay.
</span>

4. The minimum and maximum typing speed can be set using the data-typecadence-speed attribute. The value is a range in milliseconds separated by a comma.

<span class="typecadence" data-typecadence-speed="200,1400">
  This is Typecadence with a custom speed.
</span>

5. The caret can be enabled or disabled using the data-typecadence-caret attribute. The value is a boolean.

<span class="typecadence" data-typecadence-caret="false">
  This is Typecadence with caret.
</span>

6. Simulate typing mistakes.

<span class="typecadence" data-typecadence-mistakes="25">
  This is Typecadence with a 25% chance of a mistake being made with each keystroke.
</span>
<span class="typecadence" data-typecadence-mistakes-present="3">
  This is Typecadence with a maximum of three mistakes present before backspacing to correct the earliest mistake.
</span>
<span class="typecadence" data-typecadence-mistakes-keyboard="azerty">
  This is Typecadence with a AZERTY keyboard layout.
</span>

Changelog:

v1.0.8 (07/28/2023)

  • Bugfix

v1.0.6 (07/13/2023)

  • Allow for mistakes to be set at zero

v1.0.3 (07/08/2023)

  • Update

v1.0.0 (07/03/2023)

  • Use universal module definition

You Might Be Interested In:


Leave a Reply