Typin
Typin is a lightweight JavaScript library that provides a Typin effect for text elements on your web page. It's a simple way to make your text content more engaging and interactive.
Installation
You can install Typin via npm:
npm i typin
Usage
To use Typin in your project, follow these steps:
- Include the library in your JavaScript file:
const Typin = require("Typin");
- Create an HTML element that will display the Typin effect. For example:
<div class="Typin-text"></div>
- Initialize Typin with your desired options:
const txtElement = document.querySelector(".Typin-text");
const words = ["Hello", "World", "Typin"];
const options = {
wait: 1000, // Time to wait after typing a word
deleteSpeed: 50, // Speed of character deletion
typeSpeed: 100, // Speed of character typing
cursor: true, // Show blinking cursor
cursorCharacter: "|", // Cursor character
};
const Typin = new Typin(txtElement, words, options);
- Enjoy the Typin effect on your web page!
Options
Typin accepts the following configuration options:
-
wait
: Time to wait after typing a word (in milliseconds). Default: 1000ms. -
deleteSpeed
: Speed of character deletion. Default: 50ms. -
typeSpeed
: Speed of character typing. Default: 100ms. -
cursor
: Show a blinking cursor. Default: true. -
cursorCharacter
: Character to use for the cursor. Default: '|'.
Examples
For more examples and usage, please check out the example directory.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contact
- Project Link: GitHub Repository
Contributing
We welcome contributions and bug reports. Please see CONTRIBUTING.md for details.
Changelog
See the CHANGELOG.md file for details about what's new.