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

              
                    <div class="container">

        <div id="hamburger" data-toggle="modal" data-target="#myModal" class="hamburglar is-closed">

            <div class="burger-icon">
                <div class="burger-container">
                    <span class="burger-bun-top"></span>
                    <span class="burger-filling"></span>
                    <span class="burger-bun-bot"></span>
                </div>
            </div>

            <div class="burger-ring">
                <svg class="svg-ring">
                    <path class="path" fill="none" stroke="dodgerblue" stroke-miterlimit="10" stroke-width="3" d="M 34 2 C 16.3 2 2 16.3 2 34 s 14.3 32 32 32 s 32 -14.3 32 -32 S 51.7 2 34 2" />
                </svg>
            </div>

            <svg width="0" height="0">
                <mask id="mask">
                    <path xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#ff0000" stroke-miterlimit="10" stroke-width="3" d="M 34 2 c 11.6 0 21.8 6.2 27.4 15.5 c 2.9 4.8 5 16.5 -9.4 16.5 h -4" />
                </mask>
            </svg>
            <div class="path-burger">
                <div class="animate-path">
                    <div class="path-rotation"></div>
                </div>
            </div>
        </div>

        <div class="modal fade" id="myModal">
            <div class="modal-dialog modal-xl">
                <div class="modal-content">

                    <div class="modal-header">
                        <h4 class="modal-title">Modal Heading</h4>
                    </div>

                    <div class="modal-body">
                        <li>Modal body..</li>
                        <li>Modal body..</li>
                        <li>Modal body..</li>
                        <li>Modal body..</li>
                        <li>Modal body..</li>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    </div>

                </div>
            </div>
        </div>

    </div>
              
            
!

CSS

              
                        *,
        *:before,
        *:after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            margin: 0;
        }
        
        .fade {
            transition: opacity .15s linear;
        }
        
        @media (prefers-reduced-motion:reduce) {
            .fade {
                transition: none;
            }
        }
        
        .modal-open {
            overflow: hidden;
        }
        
        .modal-open .modal {
            overflow-x: hidden;
            overflow-y: auto;
        }
        
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1050;
            display: none;
            width: 100%;
            height: 100%;
            overflow: hidden;
            outline: 0;
        }
        
        .modal-dialog {
            position: relative;
            width: 80%;
            height: 100%;
            pointer-events: none;
        }
        
        .modal.fade .modal-dialog {
            transition: -webkit-transform .3s ease-out;
            transition: transform .3s ease-out;
            transition: transform .3s ease-out, -webkit-transform .3s ease-out;
            -webkit-transform: translate(-50px);
            transform: translate(-50px);
        }
        
        @media (prefers-reduced-motion:reduce) {
            .modal.fade .modal-dialog {
                transition: none;
            }
        }
        
        .modal.show .modal-dialog {
            -webkit-transform: none;
            transform: none;
        }
        
        .modal-content {
            position: relative;
            display: -ms-flexbox;
            display: flex;
            -ms-flex-direction: column;
            flex-direction: column;
            width: 100%;
            height: 100%;
            background: white;
            pointer-events: auto;
            background-clip: padding-box;
            border-bottom: 1px solid rgba(0, 0, 0, .2);
            outline: 0;
        }
        
        .modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1040;
            width: 100vw;
            height: 100vh;
            background-color: #000;
        }
        
        .modal-backdrop.fade {
            opacity: 0;
        }
        
        .modal-backdrop.show {
            opacity: .5;
        }
        
        .modal-header {
            display: -ms-flexbox;
            display: flex;
            -ms-flex-align: start;
            align-items: flex-start;
            -ms-flex-pack: justify;
            justify-content: space-between;
            padding: 3rem 1rem;
            border-bottom: 1px solid #dee2e6;
            background: dodgerblue;
        }
        
        .modal-header .close {
            padding: 1rem 1rem;
            margin: -1rem -1rem -1rem auto;
        }
        
        .modal-title {
            margin-bottom: 0;
            line-height: 1.5;
            color: white;
        }
        
        .modal-body {
            position: relative;
            -ms-flex: 1 1 auto;
            flex: 1 1 auto;
            padding: 1rem;
        }
        
        .modal-footer {
            display: -ms-flexbox;
            display: flex;
            -ms-flex-align: center;
            align-items: center;
            -ms-flex-pack: end;
            justify-content: flex-end;
            padding: 1rem;
            border-top: 1px solid #dee2e6;
        }
        
        .modal-footer>:not(:first-child) {
            margin-left: .25rem;
        }
        
        .modal-footer>:not(:last-child) {
            margin-right: .25rem;
        }
        
        .hamburglar {
            transform: scale(1);
            margin: 0;
            float: right;
            position: relative;
            display: block;
            width: 68px;
            height: 68px;
            background: transparent;
            -webkit-touch-callout: none;
            user-select: none;
            cursor: pointer;
        }
        
        .path-burger {
            position: absolute;
            top: 0;
            left: 0;
            height: 68px;
            width: 68px;
            mask: url(#mask);
            -webkit-mask-box-image: url(https://raygun.io/upload/mask.svg);
        }
        
        .animate-path {
            position: absolute;
            top: 0;
            left: 0;
            width: 68px;
            height: 68px;
        }
        
        .path-rotation {
            height: 34px;
            width: 34px;
            margin: 34px 34px 0 0;
            transform: rotate(0deg);
            transform-origin: 100% 0;
        }
        
        .path-rotation:before {
            content: '';
            display: block;
            width: 30px;
            height: 34px;
            margin: 0 4px 0 0;
            background: dodgerblue;
        }
        
        @keyframes rotate-out {
            0% {
                transform: rotate(0deg);
            }
            40% {
                transform: rotate(180deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        
        @keyframes rotate-in {
            0% {
                transform: rotate(360deg);
            }
            40% {
                transform: rotate(180deg);
            }
            100% {
                transform: rotate(0deg);
            }
        }
        
        .hamburglar.is-open .path {
            animation: dash-in 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-open .animate-path {
            animation: rotate-in 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-closed .path {
            animation: dash-out 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-closed .animate-path {
            animation: rotate-out 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .path {
            stroke-dasharray: 240;
            stroke-dashoffset: 240;
            stroke-linejoin: round;
        }
        
        @keyframes dash-in {
            0% {
                stroke-dashoffset: 240;
            }
            40% {
                stroke-dashoffset: 240;
            }
            100% {
                stroke-dashoffset: 0;
            }
        }
        
        @keyframes dash-out {
            0% {
                stroke-dashoffset: 0;
            }
            40% {
                stroke-dashoffset: 240;
            }
            100% {
                stroke-dashoffset: 240;
            }
        }
        
        .burger-icon {
            position: absolute;
            padding: 20px 16px;
            height: 68px;
            width: 68px;
        }
        
        .burger-container {
            position: relative;
            height: 28px;
            width: 36px;
        }
        
        .burger-bun-top,
        .burger-bun-bot,
        .burger-filling {
            position: absolute;
            display: block;
            height: 3px;
            width: 36px;
            border-radius: 2px;
            background: dodgerblue;
        }
        
        .burger-bun-top {
            top: 0;
            transform-origin: 34px 2px;
        }
        
        .burger-bun-bot {
            bottom: 0;
            transform-origin: 34px 2px;
        }
        
        .burger-filling {
            top: 12px;
        }
        
        .burger-ring {
            position: absolute;
            top: 0;
            left: 0;
            width: 68px;
            height: 68px;
        }
        
        .svg-ring {
            width: 68px;
            height: 68px;
        }
        
        .hamburglar.is-open .burger-bun-top {
            animation: bun-top-out 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-open .burger-bun-bot {
            animation: bun-bot-out 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-closed .burger-bun-top {
            animation: bun-top-in 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-closed .burger-bun-bot {
            animation: bun-bot-in 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        @keyframes bun-top-out {
            0% {
                left: 0;
                top: 0;
                transform: rotate(0deg);
            }
            20% {
                left: 0;
                top: 0;
                transform: rotate(15deg);
            }
            80% {
                left: -5px;
                top: 0;
                transform: rotate(-60deg);
            }
            100% {
                left: -5px;
                top: 1px;
                transform: rotate(-45deg);
            }
        }
        
        @keyframes bun-bot-out {
            0% {
                left: 0;
                transform: rotate(0deg);
            }
            20% {
                left: 0;
                transform: rotate(-15deg);
            }
            80% {
                left: -5px;
                transform: rotate(60deg);
            }
            100% {
                left: -5px;
                transform: rotate(45deg);
            }
        }
        
        @keyframes bun-top-in {
            0% {
                left: -5px;
                bot: 0;
                transform: rotate(-45deg);
            }
            20% {
                left: -5px;
                bot: 0;
                transform: rotate(-60deg);
            }
            80% {
                left: 0;
                bot: 0;
                transform: rotate(15deg);
            }
            100% {
                left: 0;
                bot: 1px;
                transform: rotate(0deg);
            }
        }
        
        @keyframes bun-bot-in {
            0% {
                left: -5px;
                transform: rotate(45deg);
            }
            20% {
                left: -5px;
                bot: 0;
                transform: rotate(60deg);
            }
            80% {
                left: 0;
                bot: 0;
                transform: rotate(-15deg);
            }
            100% {
                left: 0;
                transform: rotate(0deg);
            }
        }
        
        .hamburglar.is-open .burger-filling {
            animation: burger-fill-out 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        .hamburglar.is-closed .burger-filling {
            animation: burger-fill-in 0.6s linear normal;
            animation-fill-mode: forwards;
        }
        
        @keyframes burger-fill-in {
            0% {
                width: 0;
                left: 36px;
            }
            40% {
                width: 0;
                left: 40px;
            }
            80% {
                width: 36px;
                left: -6px;
            }
            100% {
                width: 36px;
                left: 0px;
            }
        }
        
        @keyframes burger-fill-out {
            0% {
                width: 36px;
                left: 0px;
            }
            20% {
                width: 42px;
                left: -6px;
            }
            40% {
                width: 0;
                left: 40px;
            }
            100% {
                width: 0;
                left: 36px;
            }
        }
              
            
!

JS

              
                        $('document').ready(function() {
            var trigger = $('#hamburger'),
                isClosed = false,
                isOpened = true;

            trigger.click(function() {
                burgerTime();
            });

            function burgerTime() {

                if (isClosed == false) {
                    $('#myModal').on('show.bs.modal', function(e) {
                        trigger.removeClass('is-closed');
                        trigger.addClass('is-open');
                        isClosed = true;
                    })
                } 
                if (isOpened == true) {
                    $('#myModal').on('hide.bs.modal', function(e) {
                        trigger.removeClass('is-open');
                        trigger.addClass('is-closed');
                        isOpened = true;
                    })
                }
            }
        });
              
            
!
999px

Console