TypeWriter - Create easily a TypeWriter effect for your website

Overview

TypeWriter

Create easily a TypeWriter effect for your website

Written by Luuk Walstra

Discord: Luuk#8524

Github: https://github.com/Luuk-Dev

Replit: https://replit.com/@LuukDev

Repository: https://github.com/Luuk-Dev/TypeWriter

How to use

You need to call the TypeWriter class in your JavaScript. The class has two parameters. The first one is required, this is the element where you want to add the TypeWriter effect. This can be the element itself or a string to get the element. The second parameter is the custom options. This is an object with the following options:

  • timeout: The time to wait before adding the new character to the string in miliseconds. Default is 100ms.
  • loop: Whether the TypeWriter should be looped for the element or not. Default is false.
  • cursor: The cursor settings
    • speed: The speed of the cursor in miliseconds. Default is 1000ms.
    • size: The size of the cursor in CSS. You can set the size for example to 28px. Default is the larger property value.
    • id: The id of the style element which will be added in the head element for the cursor. You can customize this so you will be able to find it back easy. Default is TypeWriter_Effect_CSS.
    • enabled: Whether the cursor should be enabled or not. Default is true.
  • onend: A callback which will be called once the TypeWriter ends. Only available if the loop is set to false.

Demo

Watch a live demo here

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Some page title</title>
    <style type="text/css">
      html, body{
        margin: 0;
        padding: 0;
        font-family: Arial;
      }
      .center{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
      }
    </style>
    <script type="text/javascript" src="https://typewriter.luukdev.repl.co/TypeWriter.js"></script>
  </head>
  <body>
    <div class="center">
      <h1 id="typewriter"></h1>
    </div>
    <script type="text/javascript">
      new TypeWriter(`#typewriter`, {
        loop: true,
        cursor: {
          speed: 700,
          size: 'larger',
          id: 'Some_TypeWriter_CSS',
          enabled: true
        },
        timeout: 50
      })
      .write(`Hello`)
      .wait(2000)
      .removeAll()
      .write(`Write here something`)
      .wait(2000)
      .remove(6)
      .write(`a book`)
      .wait(2000)
      .removeAll()
      .start();
    </script>
  </body>
</html>
You might also like...

A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning.

A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning.

jquery-character-counter A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning. #Demo Us

Dec 28, 2020

A JavaScript library to create html elements with js easily

A JavaScript library to create html elements with js easily

applecake is a javascript library for making HTML elements with javascript really easy . Why applecake ? Really easy to use It is not heavy It has a s

Jul 21, 2021

Easily create test fixtures at a temporary file-system path

fs-fixture Easily create test fixtures at a temporary file-system path. Support this project by ⭐️ starring and sharing it. Follow me to see what othe

Dec 15, 2022

You can easily create the horizontal timeline with two types by using this jQuery plugin.

You can easily create the horizontal timeline with two types by using this jQuery plugin.

jQuery.Timeline V2 You are able to easily create two types of horizontal timeline with this jQuery plugin. Report bug · Request feature · Blog Table o

Dec 9, 2022

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time. Dropdown, navigation bu

Nov 25, 2022

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and a CLI tool.

Dec 24, 2022

Enable Acrylic/Glass effect for your VS Code.

Enable Acrylic/Glass effect for your VS Code.

Visual Studio Code Extension - Vibrancy Continued The original extension has been deprecated, this version will continue to be supported and receive c

Dec 29, 2022

📝 You Can Create Your Own Short Notes With The Help of Sticky-Notes Website.

Hi 👋 , I'm Sneh Agrawal A passionate Web developer from India 🔭 I’m currently working on Chatting Website Chit-Chat 📫 How to reach me on My Gmail A

Feb 23, 2022

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.

Cuberto Mouse Follower A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website. Dependencies GSAP v3 (

Dec 30, 2022
Owner
Luuk
Luuk
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Little Alpine.js plugin to add a typewriter effect to any HTML element.

⌨️ Alpine Typewriter ⌨️ An Alpine.js plugin to add a typewriter effect to any HTML element. ?? Installation CDN Include the following <script> tag in

Marc Reichel 58 Dec 28, 2022
An open-source Typing-effect Library, That enables potential users to add a typing effect to mere DOM Elements.

Typing Effect Library An open-source Typing-effect Library I created. That enables potential users to add a typing effect to mere DOM Elements. Tool P

Okoye Charles 14 Oct 3, 2022
Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».

Cuberto Reeller Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».

Cuberto 41 Jan 4, 2023
A to-do list website task by (@microverseinc), you can easily manage your daily tasks

To DO list Is a website to manage daily tasks Built With HTML,CSS,JS webpack Live Demo (if available) Live Demo Link Getting Started This is an exampl

Yousef Hesham 6 Oct 22, 2022
Easily add emoji support to your website! Replace keywords with emoji's :yum:

Emoji-Parser.js ?? A emoji parser to easily add emoji support to your website Show your support! Features: Use's the same style GitHub does! TON's of

Marketing Pipeline 13 Sep 9, 2022
Chat View let's you quickly and easily create elegant Chat UIs in your Markdown Files.

Obsidian Chat View Plugin Chat View let's you quickly and easily create elegant Chat UIs in your Markdown Files. Usage Every chat message must be pref

Adifyr 96 Dec 27, 2022
Easily create key board shortcuts for your JS functions. Built using JS only with no other dependency. Inspired from MacOS spotlight

floodlightjs Inspired from macOS spotlight, floodlight is simple JS library that will show a search area. How the search is handled is completely on y

Raj Nandan Sharma 6 Aug 12, 2022
Sticker.js - A Javascript library that allows you to create a Sticker Effect.

Sticker.js A Javascript library that allows you to create a Sticker Effect. No dependencies Works in most of major browsers that support CSS 3 (IE10+)

Jongmin Kim 719 Nov 22, 2022