Skip to content

Discover the effects of alcohol, see what it can do on your page.

Notifications You must be signed in to change notification settings

darlandieterich/drunkerjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrunkerJS

Discover the effects of alcohol, see what it can do on your page.

Live Example

See

Code Example

Simple Dizzy, recursive effect and speed normal.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test Drunker</title>
</head>
<body>
    <h2>Test</h2>
    <div id="target" style="width:150px;height:150px;background-color:blue">the test</div>
    <button id="reset">Reset</button>
    <script src="./drunker.min.js"></script>
    <script>
        var d = new Drunker('#target', Drunker.DrunkerEffects.DIZZY);
        d.Drunk({
            type: Drunker.DrunkerType.UNTILDROP,
            speed: Drunker.DrunkerSpeed.NORMAL
        });
        document.getElementById('reset').onclick = function() {
            d.StopDrunk()
        }
    </script>
</body>
</html>

Properties

Effects

    //Enums
    Drunker.DrunkerEffects.BLUR
    Drunker.DrunkerEffects.DIZZY
    Drunker.DrunkerEffects.DISAPPEAR
    Drunker.DrunkerEffects.SHAKE
    Drunker.DrunkerEffects.SPIN
    Drunker.DrunkerEffects.PULSE
    Drunker.DrunkerEffects.AUTO //Random effect

Speed

    //Enum
    Drunker.DrunkerSpeed.FAST
    Drunker.DrunkerSpeed.NORMAL
    Drunker.DrunkerSpeed.SLOW

Types

    //Enum
    Drunker.DrunkerType.MODERATE //One time
    Drunker.DrunkerType.UNTILDROP //Recursive mode