drunkerjs

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

Usage no npm install needed!

<script type="module">
  import drunkerjs from 'https://cdn.skypack.dev/drunkerjs';
</script>

README

DrunkerJS

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

(in development)


Live Example

Sample

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="../dist/drunker.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