Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                        <nav>
            <button class='hamburger hamburger--elastic' type="button">
                BUTTON
            </button>
            <canvas id="navigationBackground" width="550" height="907"></canvas>
            <ul>
                <li class="nav-item">
                    <div class="bwki-logo">
                        <div class="womix__image-wrapper">
                            <div>
                                <Link href="/">

                                </Link>
                            </div>
                            <p>
                            </p>
                        </div>
                    </div>
                </li>
                <li class="nav-item womix__gradient" data-scroll="intro">
                    <LinkSmoothScroll>
                        <a class="womix__gradient">These</a>
                    </LinkSmoothScroll>
                </li>
                <li class="nav-item womix__gradient" data-scroll="ablauf">
                    <LinkSmoothScroll >
                        <a class="womix__gradient">Takes</a>
                    </LinkSmoothScroll>
                </li>
                <li class="nav-item womix__gradient">
                    <a class="womix__gradient">Time</a>
                    <a></a>
                </li>
            </ul>
        </nav>


<div id="debug"></div>
              
            
!

CSS

              
                

html body nav {
    position: fixed;
    width: 30%;
    height: 100vh;
    min-width: 550px;
    z-index: 9999;
    pointer-events: none
}

html body nav .hamburger {
    z-index: 14;
    position: absolute;
    cursor: pointer;
    left: 0;
    top: 0;
    height: 70px;
    pointer-events: visible
}

html body nav .hamburger>span>span {
    background-color: #0083d3
}

html body nav .hamburger>span>span:after,
html body nav .hamburger>span>span:before {
    background-color: #0083d3
}

html body nav canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0
}

html body nav ul {
    position: absolute;
    z-index: 12;
    height: inherit;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-flow: column;
    flex-flow: column;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: calc(100% - 150px);
    padding-top: 10vh
}

html body nav ul li {
    cursor: pointer;
    padding: 10px;
    opacity: 0;
    transform: matrix(1, 0, 0, 1, 0, 0);
}

html body nav.is-active ul li {
    opacity: 0;
    transform: matrix(1, 0, 0, 1, 20, 0);
}

html body nav ul li:first-of-type {
    margin-bottom: 8vh
}

html body nav ul li a,
html body nav ul li p {
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    font-size: 3vw;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none
}


#debug{
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  overflow: scroll;
}
              
            
!

JS

              
                $(function () {
    var xCoordTop = {
        x: 0
    };
    var xCoordTopSecondLayer = {
        x: 0
    };
    var xCoordBottom = {
        x: 0
    };
    var tweenNavigation = new TimelineMax({
        paused: !0
    })

    $('body').on('click', '.hamburger', function () {
        if ($(this).hasClass('is-active')) {
            hideLeftMenu();
        }
        else {
            openLeftMenu();
        }
    });

    $('body').on("click", function (e) {
        var elm = $(e.target);
        var container = $('nav');
        if (!container.is(elm) && container.has(elm).length === 0) {
            $("nav").hasClass("is-active") && hideLeftMenu();
        }
    });

    $(window).on('scroll', function () {
        $("nav").hasClass("is-active") && hideLeftMenu();
    });

    function openLeftMenu() {
        $(".hamburger").addClass("is-active");
        $("nav").addClass("is-active");
        drawCanvas();
        animationCanvas();
        tweenNavigation.play();
    }

    window.hideLeftMenu = function (e) {
        $(".hamburger").removeClass("is-active");
        $("nav").removeClass("is-active");
        tweenNavigation.reverse(.7)
    }

    function drawCanvas() {
        var e = document.getElementById("navigationBackground"),
            i = document.getElementById("navigationBackground").getContext("2d"),
            n = $(window).height(),
            r = $("nav").width();
        e.width = r, e.height = n, i.fillStyle = "#00abee", i.shadowColor = "#000", i.shadowBlur = 15, i.beginPath(), i.moveTo(0, 0), i.lineTo(xCoordTopSecondLayer.x, 0), i.lineTo(xCoordBottom.x, n), i.lineTo(0, n), i.closePath(), i.fill(), i.fillStyle = "#fff", i.beginPath(), i.moveTo(0, 0), i.lineTo(xCoordTop.x, 0), i.lineTo(xCoordBottom.x, n), i.lineTo(0, n), i.closePath(), i.fill();
    }

    function animationCanvas() {
        var e = $("nav").width() - 20,
            i = $(".nav-item");
        $('#debug').html( $('#debug').html()+'Timeline `tweenNavigation` is being added to.<br>' );
        tweenNavigation.to(xCoordBottom, .3, {
            ease: Back.easeOut.config(.6),
            x: e - 120,
            onUpdate: drawCanvas
        }, 0).to(xCoordTop, .3, {
            ease: Back.easeOut.config(.6),
            x: e - 40,
            onUpdate: drawCanvas
        }, .1).to(xCoordTopSecondLayer, .2, {
            ease: Back.easeOut.config(.6),
            x: e,
            onUpdate: drawCanvas
        }, .2).staggerTo(i, .3, {
            opacity: 1,
            x: 20,
            delay: 0
        }, .05)
      
      console.log( tweenNavigation );
    }
});
              
            
!
999px

Console