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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-2 -2 504 504" id="menu" style="transform-origin: 50% 50% 0px; transform: matrix3d(-0.999934, 0.0114547, 0, 0, -0.0114547, -0.999934, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); touch-action: none; user-select: none;">
<style>#menu{display:block;margin:0 auto;}a{cursor:pointer;outline:none;}.item .sector{transition:all .1s linear;fill:#fff;stroke:#111;}.item:hover .sector,.item:focus .sector{fill:#eee;}.menu-trigger{fill:#EA2A55;pointer-events:auto;}.menu-trigger:hover,.menu-trigger:focus{cursor:pointer;}symbol{overflow:visible;}</style>
<g id="symbolsContainer">    <symbol class="icon icon-" id="icon-1" viewBox="0 0 73 73"><!--Replace the contents of this symbol with the content of your icon--><rect fill="none" stroke="#111" stroke-width="1" width="100%" height="100%"></rect><text fill="#222" x="50%" y="50%" dy=".3em" text-anchor="middle" font-size="1.2em">1</text></symbol>

    <symbol class="icon icon-" id="icon-2" viewBox="0 0 73 73"><!--Replace the contents of this symbol with the content of your icon--><rect fill="none" stroke="#111" stroke-width="1" width="100%" height="100%"></rect><text fill="#222" x="50%" y="50%" dy=".3em" text-anchor="middle" font-size="1.2em">2</text></symbol>

    <symbol class="icon icon-" id="icon-3" viewBox="0 0 73 73"><!--Replace the contents of this symbol with the content of your icon--><rect fill="none" stroke="#111" stroke-width="1" width="100%" height="100%"></rect><text fill="#222" x="50%" y="50%" dy=".3em" text-anchor="middle" font-size="1.2em">3</text></symbol>

    <symbol class="icon icon-" id="icon-4" viewBox="0 0 73 73"><!--Replace the contents of this symbol with the content of your icon--><rect fill="none" stroke="#111" stroke-width="1" width="100%" height="100%"></rect><text fill="#222" x="50%" y="50%" dy=".3em" text-anchor="middle" font-size="1.2em">4</text></symbol>

    <symbol class="icon icon-" id="icon-5" viewBox="0 0 73 73"><!--Replace the contents of this symbol with the content of your icon--><rect fill="none" stroke="#111" stroke-width="1" width="100%" height="100%"></rect><text fill="#222" x="50%" y="50%" dy=".3em" text-anchor="middle" font-size="1.2em">5</text></symbol>

</g>
<g id="itemsContainer">        <a class="item" id="item-1" role="link" tabindex="0" xlink:href="" xlink:title="" xlink:target="_parent" transform="matrix(1,0,0,1,0,0)" data-svg-origin="250 250" style=""><path fill="none" stroke="#111" stroke-width="1" class="sector" d="M250,250 l250,0 A250,250 0 0,0 455.7459664734141,107.98381331721106 z"></path><use xlink:href="#icon-1" width="73" height="73" x="394.89697265625" y="156.97442626953125" transform="rotate(72.6923076923077 431.39697265625 193.47442626953125)"></use></a>
        <a class="item" id="item-2" role="link" tabindex="0" xlink:href="" xlink:title="" xlink:target="_parent" transform="matrix(0.80545,-0.59266,0.59266,0.80545,-99.52833097874066,196.80276470326774)" data-svg-origin="250 250" style=""><path fill="none" stroke="#111" stroke-width="1" class="sector" d="M250,250 l250,0 A250,250 0 0,0 455.7459664734141,107.98381331721106 z"></path><use xlink:href="#icon-2" width="73" height="73" x="394.89697265625" y="156.97442626953125" transform="rotate(72.6923076923077 431.39697265625 193.47442626953125)"></use></a>
        <a class="item" id="item-3" role="link" tabindex="0" xlink:href="" xlink:title="" xlink:target="_parent" transform="matrix(0.2975,-0.95472,0.95472,0.2975,-63.05598009093717,414.30445316333567)" data-svg-origin="250 250" style=""><path fill="none" stroke="#111" stroke-width="1" class="sector" d="M250,250 l250,0 A250,250 0 0,0 455.7459664734141,107.98381331721106 z"></path><use xlink:href="#icon-3" width="73" height="73" x="394.89697265625" y="156.97442626953125" transform="rotate(72.6923076923077 431.39697265625 193.47442626953125)"></use></a>
        <a class="item" id="item-4" role="link" tabindex="0" xlink:href="" xlink:title="" xlink:target="_parent" transform="matrix(-0.3262,-0.94529,0.94529,-0.3262,95.22574354655734,567.8756510638775)" data-svg-origin="250 250" style=""><path fill="none" stroke="#111" stroke-width="1" class="sector" d="M250,250 l250,0 A250,250 0 0,0 455.7459664734141,107.98381331721106 z"></path><use xlink:href="#icon-4" width="73" height="73" x="394.89697265625" y="156.97442626953125" transform="rotate(72.6923076923077 431.39697265625 193.47442626953125)"></use></a>
        <a class="item" id="item-5" role="link" tabindex="0" xlink:href="" xlink:title="" xlink:target="_parent" transform="matrix(-0.82298,-0.56806,0.56806,-0.82298,313.7297797906251,597.762153156203)" data-svg-origin="250 250" style=""><path fill="none" stroke="#111" stroke-width="1" class="sector" d="M250,250 l250,0 A250,250 0 0,0 455.7459664734141,107.98381331721106 z"></path><use xlink:href="#icon-5" width="73" height="73" x="394.89697265625" y="156.97442626953125" transform="rotate(72.6923076923077 431.39697265625 193.47442626953125)"></use></a>
</g>
<g id="trigger" class="trigger menu-trigger" role="button">
<circle cx="250" cy="250" r="80"></circle>
<text id="menu-text" xmlns="http://www.w3.org/2000/svg" text-anchor="middle" x="-50%" y="-50%" fill="#fff">CLICK TO OPEN</text>
</g>
</svg>
              
            
!

CSS

              
                svg {
  width: 400px;
}
.item {
  visibility: hidden;
}
#menu-text {
  transform: rotate(180deg);
}
              
            
!

JS

              
                var svg = document.getElementById('menu'),
	items = svg.querySelectorAll('.item'),
    trigger = document.getElementById('trigger'),
    label = trigger.querySelectorAll('#label')[0],
    open = false,
    angle = 36;

//set up event handler
trigger.addEventListener('click', toggleMenu, false);
// svg.style.pointerEvents = "none";

//toggle menu when trigger is clicked
function toggleMenu(event) {
   if (!event) var event = window.event;
    event.stopPropagation();
  open = !open;
  if (open) {
    var tl = new TimelineLite();
  	tl.to(items, 0.2, {autoAlpha: 1, scale:1, ease:Back.easeOut.config(4)}, 0.05);
    for(var i=0; i<items.length; i++){
      tl.to(items[i], 0.7, {autoAlpha: 1, rotation:-i*angle + "deg", ease:Bounce.easeOut}, 0.35);
    }
    label.innerHTML = "-";
    svg.style.pointerEvents = "auto";
  } else {
    var tl = new TimelineLite();
    for(var i=0; i<items.length; i++){
      tl.to(items[i], 0.3, {rotation: 0, ease:Circ.easeOut}, 0.05);
    }
    tl.to(items, .3, {scale:0, ease:Back.easeIn}, 0.3);
    label.innerHTML = "+";
    svg.style.pointerEvents = "none";
  }
  
}

svg.onclick = function (e) {
    e.stopPropagation();
}
//close the nav when document is clicked
document.onclick = function () {
    open = false;
    var tl = new TimelineLite();
    for(var i=0; i<items.length; i++){
      tl.to(items[i], 0.3, {rotation: 0, ease:Circ.easeOut}, 0.05);
    }
    tl.to(items, .3, {scale:0, ease:Back.easeIn}, 0.3);
    label.innerHTML = "+";
    svg.style.pointerEvents = "none";
}
              
            
!
999px
There are 10 kinds of people, those who understand binary and those who don’t.

Console