Code Monkey home page Code Monkey logo

autotyperjs's Introduction

AutoTyper JS

A vanilla javascript plugin for animated typewriting.

Downloads install size

autotyperjs can be accessable in global variable as autoTyper. It exposes outside two functions, start and stop. Multiple instances can be created by using new keyword. Its compatible with Chrome, Firefox, Safari, Internet Explorer and Edge.

  • start() : starts AutoTyper on target element.
  var options = {
    selector: '.content > h1',
    words: ['hello', 'world']
  }

  // start autoTyper
  var typer = new autoTyper(options)
  typer.start()
  • stop() : stops AutoTyper.
  // stop autoTyper
  typer.stop()

Demo on Codepen : https://codepen.io/hsynlms/pen/gzapPz

Available options

Below options can be given to customize AutoTyper before start.

  // available custom options
  var options = {
    selector: '.typerTarget', // target element selector
    words: [], // words/sentences that will be auto typed
    charSpeed: 85, // letter typing animation speed
    delay: 2100, // word/sentence typing animation delay
    loop: true, // if loop is activated, autoTyper will start over
    flipflop: true // if flipflop is activated, letters which are typed animated will be removed ony by one animated
  }

How about blinking caret?

For better typewriting experience, blinking caret is a must. It's optional to use with autoTyper together. You only have to do is giving below styles for autoTyper target element by yourself.

The HTML side will be like:

<div class="typerTarget"></div>

The CSS side will be like:

@-webkit-keyframes blink-caret {
  50% {
    border-color: transparent;
  }
}

.typerTarget {
  border-right: 1px solid #404145;
  -webkit-animation: blink-caret 0.5s step-end infinite alternate;
          animation: blink-caret 0.5s step-end infinite alternate;
}

autotyperjs's People

Contributors

dependabot[bot] avatar hsynlms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.