Pen Settings



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


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


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.


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.


                <div class="desc">Drag left to see the effect</div>

<nav class="side-menu">
  <a class="icon icon-tap">1</a>
  <a class="icon icon-tap">2</a>
  <a class="icon icon-tap">3</a>


body {
  width: 100%;
  height: 100%;

body {
  font-family: "Segoue UI", Arial, sans-serif;
  background: #eee;

 * Side menu

.side-menu {
    height: 100%;
    position: fixed;
    top: 0;
    right: 0;
    padding: 70px;
    background: #FDB351;
    background: -webkit-linear-gradient(45deg, #FDB351 0%, #F28543 100%);
    background:         linear-gradient(45deg, #FDB351 0%, #F28543 100%);

.side-menu a {
    display: block;
    text-decoration: none;
    color: #fff;

 * Tap rings

.icon-tap {
    position: relative;
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 18px;
    text-align: center;
    color: #E2913E;
    margin: 20px 0 0 0;
    border: 2px solid;
    border-radius: 999px;

.icon-tap:hover {
    cursor: pointer;

.desc {
  padding: 30px;


                var menu = document.querySelectorAll(".side-menu")[0],
    closedPosition = menu.offsetWidth - 15; //make sure there are 15 pixels showing

Draggable.create(menu, {
  throwProps:true, //enables the momentum-based flicking (requires ThrowPropsPlugin)
  edgeResistance: 0.9, //you can set this to 1 if you don't want the user to be able to drag past the snap point. This controls how much resistance there is after it hits the max/min.
  maxDuration:0.3, //don't let the animation duration exceed 0.3 second (you can tweak this too of course)
  bounds: {maxX:closedPosition, minX:0}, 
  onClick: function() { //when the user clicks/taps on the menu without dragging, we'll toggle it...
    if ( === closedPosition) {, 0.3, {x:0});
    } else {, 0.3, {x:closedPosition});
  snap: {
    x: [0, closedPosition]