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.


                <script src=""></script>

<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;


                // Enable touch gestures
// Create global Hammer.js instance
var mc = new Hammer(document.body);
mc.get('pan').set({ direction: Hammer.DIRECTION_ALL });

// Create menu slide tween
slide = TweenMax.fromTo('.side-menu' , 2, { x:'90%', opacity:.9 }, { x:'0%', opacity:.9, display:'block' }).paused(true);

// Listen for touch gestures
mc.on("panleft", function(e) {
  var distance = Math.floor(e.distance) / 100;
  // Constrain distance
  ( Math.abs(distance) > 1 ) ? distance = 1 : "";

  // Jump to progress position
  // Slow down animation

mc.on("panend", function() {

  // Get current time
  var currentAnimPos = slide.time();

  // Play from position where release happened
  // This one makes trouble, so I commented it out