Giter Site home page Giter Site logo

msoftware / glitter.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lorenzoboccaccia/glitter.js

0.0 2.0 0.0 184 KB

Glitter.js is a library for creating eye catching effects on normally boring text

License: Other

CSS 29.08% JavaScript 41.40% HTML 29.52%

glitter.js's Introduction

Glitter.js: It's Fabolous

Glitter.js is a library for creating eye catching effects on normally boring text

Integrating glitter in your code is as easy as including the script itself:

<script type="text/javascript" src="glitter.js"></script>

Then you can start the awesome with:

glitter('#text-id', {
    loopPeriod: 5000,        //ms between each glitter
    maxIteration: undefined, //maximum number of glitters
    accentTime: 100,         //time the accent class is shown
    highlightTime: 20,        //time the highlight class is shown 
    downlightTime: 20,        //time the downlight class is shown
    rtl: false,              //direction of the glitter
    travelPeriod: 40,        //ms between each subsequent letter glitter
    flipping: false          //makes half loop between default and accent
});

and that's it!

The library rolls these 4 css classes along the text characters:

    glitter-default   //class the text is normally at
    glitter-highlight //class the text gets before the accent
    glitter-accent    //class that represent the highlighted text
    glitter-downlight //class the text gets after the accent

Normally the classes are applied in order according to the timed defined in the configuration; the only difference of note is when using 'flipping: true', which maintains the accent for a whole half loop before showing the default again on the next loop.

See more samples here

Glitter.js was was built as part of the fashiontech application LOOKCAST

To use transforms and transitions on a span use this trick as demonstrated on the samples page:

display:inline-block;
min-width:3px;

Beware of browser timers! Background tabs fire them at a reduced rate. Use instead the wonderful HackTimer library found here: https://github.com/turuslan/HackTimer

glitter.js's People

Contributors

lorenzoboccaccia avatar

Watchers

Michael jentsch 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.