Git Product home page Git Product logo

scrambling-letters's Introduction

downloads Tests Coverage Status npm version status license

Scrambling Letters

A lightweight javascript library for scrambling letters within a piece of text, giving a nice decoding effect.

Loops through any elements with the relevant selector or data attribute and scrambles the letters randomly for a couple of seconds before returning them one by one to their original state or an alternate string.

Demo Page

Documentation

scrambling-letters's People

Contributors

brianbento avatar dependabot[bot] avatar gigitux avatar recidvst avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

scrambling-letters's Issues

Function to execute upon completion

To circunvent jumping im doing this:

        let item = $(cls).get(0)
        item.style.height = `${item.clientHeight}px`

        Scrambler(
        {
            target: cls,
            random: [250, 250],
            speed: 100
        })

        setTimeout(function()
        {
            item.style.height = 'initial'
        }, 1000)

I have to use 1000ms because of the time not being exact issue I posted earlier.

A function that is called when the scrambling is done would help here. An optional function that is passed to Scrambler and executes it when animation finishes.

Random time not exact

I'm using random: [250, 250] to have exactly a 250ms animation.
But I'm finding it takes more than 250ms, like 500ms or more.

Height changing

Hi, nice library.

I was testing to see how it incorporated on my chat application. I wanted it to make a 500ms effect on chat messages.

It worked nicely (except that it sometimes didn't seem to do anything, maybe randomly picking the same letter all the time?), but there is a problem when the text is wide enough to jump between one or more lines in height, since the letters change, the text can overflow to another line for a bit. This height change is unwanted (so I had to revert it). Would be nice if there was a way so the text doesn't change height, even nicer if it doesn't change width too somehow.

Thanks.

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.