GithubHelp home page GithubHelp logo

bornasepic / placeholder-typewriter Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 113 KB

Pure JavaScript plugin for animating placeholders on input elements

HTML 9.69% JavaScript 52.70% TypeScript 37.61%
javascript placeholder placeholder-text placeholder-animation text-animation

placeholder-typewriter's Introduction

Placeholder-Typewriter

Pure JavaScript plugin for animating placeholders on input elements

How to use:

  1. Include the typewriter.js script into your file before the tag.
  2. Call the typewriter with the new Typewriter constructor function
  3. Enjoy :shipit:

API

Calling a new instance of the typewriter:

new TypeWriter('#zipcodeInput', ['Input Your Zip Code', 'eg. 93108'], {writeDelay: 200});

The new TypeWriter accepts three arguments

  1. A querySelector to select the input field
  2. An array of strings to be typed out in the selected input field
  3. An options settings object to overwrite default settings

Settings

  • writeDelay => Delay between each letter is written (default: 60ms)
    --expecting a number of miliseconds
  • deleteDelay => Delay between each letter is removed (default: 40ms)
    --expecting a number of miliseconds
  • holdOnceWritten => Delay once the current phrase has been fully displayed (default: 1000ms)
    --expecting a number of miliseconds
  • holdOnceDeleted => Delay once the current phrase has been fully deleted (default: 1000ms)
    --expecting a number of miliseconds
  • stopAfterOnce => Runs through the phrases only once, then leaves the first phrase as a static placeholder
    --expecting a boolean

placeholder-typewriter's People

Contributors

bornasepic avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

second24life

placeholder-typewriter's Issues

Stop effect on form focus

Is it somehow possible to stop the effect (not type anything) when the user has his cursor inside the form?
As soon as the user types it's gone anyway. But it's pretty misleading that the cursor of the user appears + the automatic typing text.

Can this be removed somehow as soon as the user clicks in the side the form (and bring it back when the user clicks outside of it again)?

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.