Coder Social home page Coder Social logo

tobalsan / livetype Goto Github PK

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

jQuery LiveType plugin. A lightweight jQuery plugin to simulate live typing on the screen (also known as the typewriter effect)

License: MIT License

JavaScript 64.62% HTML 35.38%

livetype's Introduction

jQuery LiveType plugin

This is a jQuery plugin to provide the "typewriter" effect. More precisely, it makes content on your website look like it's being typed right at the moment the visitor is looking to the page.

Usage

Usage is pretty straightforward. Either download the files using the link at the top of this page or clone this repository to your project folder.

Write the content that you want to have typed live in a div or a p and include jQuery and this plugin js files in your html document:

<body>
    <div class="example">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
        Possimus error fuga ad voluptate quibusdam.
        Deserunt minus reiciendis maiores accusantium in error voluptatem eos
        quibusdam harum nobis dolor alias quasi modi?
    </div>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
    <script src="js/jquery.liveType.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function(){
            $('.example').liveType({
                typeSpeed: 50
            });
        })
    </script>
</body>

No CSS required: you style things as you please.

Options

There are several options to customize the plugin. Use it like so:

$(document).ready(function(){
    $('.example').liveType({
        // options
    });
})

Here are all the options, with their default values:

typeSpeed          : 50,                                // Time between each character typed
pauseEvery         : 40,                                // Number of characters between each pause. Only used when pauseOnPunctuation is set to false
pauseTime          : 1500,                              // The duration of pause
pauseOnPunctuation : true,                              // If the pause should be on punctuation characters
punctuationChars   : ['.', '.', '?', '!', ':', ';'],    // An array of characters to pause on
cursorEffect       : true,                              // "True" for smooth blinking, "false" for plain blinking
cursorSpeed        : 500,                               // Cursor blinking speed
cursor             : '|',                               // Cursor type
cursorClass        : 'cursor'                           // The classname for the cursor element

TODO

Add randomizer (scramble function then backspace erase and retyping on the last word) to add even more realism.

LICENSE

This plugin is licenced under the MIT license

Contact & infos

For any questions or comment feel free to contact me at tobalsan (a) gmail.com

livetype's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

meowsus

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.