Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="create">
  <button class="create-button" onclick="openDialog(event)">
      <div class="create-inner"><div class="create-text">Go Create!</div></div>
    </button>
  <svg id="arrow-down-mini" viewBox="0 0 300 154" width="300" height="154"><path id="path" d="m 268.10523,8.8753335 c 0.51266,-0.5435292 2.3001,-2.3345525 3.73347,-3.7539722 1.43337,-1.4194197 2.65706,-2.615199 2.75337,-2.711514 0.0963,-0.096315 0.40793,-0.604345 0.40793,-0.98206 0,-0.377715 -0.15108,-0.725215 -0.40793,-0.98206 -0.25685,-0.256845 -0.60434,-0.40793 -0.98206,-0.40793 -0.37771,0 -0.85363,0.27951 -0.98206,0.40793 -0.12843,0.12842 -2.92998,3.1051319 -5.6204,5.6204 -2.75081,-2.5574243 -5.49196,-5.49198 -5.62039,-5.6204 -0.12843,-0.12842 -0.60434,-0.40793 -0.98206,-0.40793 -0.37771,0 -0.7101,0.13598466 -0.98206,0.39283 -0.27196,0.25684534 -0.42304,0.64211 -0.42304,0.99716 0,0.35505 -0.04,0.5269297 0.39282,0.98206 0.4328,0.4551303 2.08128,2.1020604 3.56285,3.5911816 1.48157,1.4891212 2.78004,2.7937047 2.93385,2.9508386 0.15381,0.1571339 0.69148,0.4195142 1.11877,0.4227298 0.42729,0.00322 0.86184,-0.2119443 1.09694,-0.4992638 z"></path></svg>
  <div class="menu">
    <div class="new-pen">
      <svg class="new-pen-svg" viewBox="0 0 20 20" width="100%" height="100%"><path d="M0 9.002C0 8.45.455 8 .992 8h18.016c.548 0 .992.456.992 1.002v9.996c0 .553-.455 1.002-.992 1.002H.992C.444 20 0 19.544 0 18.998V9.002zm0-8C0 .45.451 0 .99 0h4.02A.99.99 0 0 1 6 1.003v4.994C6 6.551 5.549 7 5.01 7H.99A.99.99 0 0 1 0 5.997V1.003zm7 0C7 .45 7.451 0 7.99 0h4.02A.99.99 0 0 1 13 1.003v4.994C13 6.551 12.549 7 12.01 7H7.99A.99.99 0 0 1 7 5.997V1.003zm7 0C14 .45 14.451 0 14.99 0h4.02A.99.99 0 0 1 20 1.003v4.994C20 6.551 19.549 7 19.01 7h-4.02A.99.99 0 0 1 14 5.997V1.003z"></path></svg>
      <span
        class="new-pen-text">New Pen</span>
    </div>
    <div class="new-pen-from-template">New Pen from Template</div>
    <div class="new-project">
      <svg class="new-project-svg" viewBox="0 0 20 20" width="100%" height="100%"><path d="M7 .995C7 .445 7.447 0 7.999 0H19c.552 0 .999.456.999.995v8.01c0 .55-.447.995-.999.995H8C7.447 10 7 9.544 7 9.005V.995zm0 11.003c0-.551.447-.998.999-.998H19c.552 0 .999.446.999.998v7.004c0 .551-.447.998-.999.998H8A.998.998 0 0 1 7 19.002v-7.004zM0 .992C0 .444.451 0 .99 0h4.02c.546 0 .99.455.99.992v18.016a.996.996 0 0 1-.99.992H.99a.999.999 0 0 1-.99-.992V.992z"></path></svg>New
      Project</div>
    <div class="new-post">
      <svg class="new-post-svg" viewBox="0 0 20 20" width="100%" height="100%"><path d="M0 5c0-.552.455-1 .992-1h18.016c.548 0 .992.445.992 1v14c0 .552-.455 1-.992 1H.992A.994.994 0 0 1 0 19V5zM0 1C0 .447.455 0 .992 0h18.016c.548 0 .992.443.992.999v1.002c0 .552-.455.999-.992.999H.992A.992.992 0 0 1 0 2.001V.999z"></path></svg>New
      Post</div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background: black;
  font-family: "Lato";
}

.create {
  margin: 0 auto;
  position: relative;
  width: 320px;
}

.create-button {
  background: #343436;
  border-radius: 3px;
  border: 3px solid transparent;
  color: white;
  cursor: pointer;
  display: inline-block;
  font-family: "Lato";
  font-size: 1rem;
  font-weight: normal !important;
  text-shadow: none;
  line-height: 1.2;
  min-width: 70px;
  min-height: 18px;
  margin: 0 10px 0 0;
  margin-left: 210px;
  outline: 0;
  padding: 10px 40px 10px 16px;
  position: relative;
  text-overflow: ellipsis;
  text-decoration: none !important;
  text-align: center;
  transition: width 300ms, padding 300ms;
  white-space: nowrap;
}

.create-button:hover {
  background: #4d4d50;
}

.create-button:active {
  margin-top: 1px;
}

.create-button.expanded {
  padding-left: 14px;
  padding-right: 14px;
}

.create-inner {
  overflow: hidden;
  transition: width 300ms;
  width: 48px;
}

.create-text {
  transition: transform 300ms;
  transform: translateX(-24px);
}

.create-inner.expanded {
  width: 76px;
}

.create-text.expanded {
  transform: translateX(0px);
}

#arrow-down-mini {
  fill: #47cf73;
  margin-left: 5px;
  position: absolute;
  left: 24px;
  pointer-events: none;
  top: 20px;
}

.menu {
  opacity: 0;
  transform: translateY(0);
  transition: opacity 50ms 0ms;
}

.menu.show {
  opacity: 1;
  transition: opacity 200ms 200ms;
}

.new-pen {
  color: #555;
  cursor: pointer;
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  left: 28px;
  padding: 20px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 9px;
  width: 261px;
}

.new-pen:hover {
  background: #444;
  color: white;
}

.new-pen.show {
  pointer-events: all;
}

.new-pen-svg {
  fill: #0ebeff;
  width: 23px;
  height: 23px;
  margin-right: 10px;
}

.new-pen-text {
  vertical-align: top;
}

.new-pen-from-template {
  background: #f7f7f7;
  border-bottom: 1px solid #e2e2e2;
  border-top: 1px solid #e2e2e2;
  color: #666;
  cursor: pointer;
  display: block;
  height: 22px;
  left: 29px;
  padding: 10px;
  position: absolute;
  text-align: center;
  top: 76px;
  width: 280px;
}

.new-pen-from-template:hover {
  background: #444;
  color: white;
}

.new-pen-from-template.show {
}

.new-project {
  border-right: 1px solid #e2e2e2;
  cursor: pointer;
  font-weight: bold;
  height: 24px;
  left: 28px;
  line-height: 24px;
  padding: 10px;
  position: absolute;
  text-align: center;
  top: 120px;
  width: 130px;
}

.new-project:hover {
  background: #444;
  color: white;
}

.new-project.show {
}

.new-project-svg {
  cursor: pointer;
  fill: #ffdd40;
  height: 20px;
  margin-right: 7px;
  position: relative;
  top: -2px;
  vertical-align: middle;
  width: 20px;
}

.new-post {
  cursor: pointer;
  font-weight: bold;
  height: 24px;
  left: 179px;
  line-height: 24px;
  padding: 10px;
  position: absolute;
  text-align: center;
  top: 120px;
  width: 130px;
}

.new-post:hover {
  background: #444;
  color: white;
}

.new-post.show {
}

.new-post-svg {
  fill: #47cf73;
  cursor: pointer;
  height: 20px;
  margin-right: 7px;
  position: relative;
  top: -2px;
  vertical-align: middle;
  width: 20px;
}

              
            
!

JS

              
                function animD(duration, delay, id, value) {
  anime({
    targets: id,
    d: {
      value: value,
      duration: duration,
      delay: delay,
      easing: "easeInOutQuad"
    }
  });
}

function animTranslateX(duration, delay, id, value) {
  anime({
    targets: id,
    translateX: {
      value: value,
      duration: duration,
      delay: delay,
      easing: "easeInOutQuad"
    }
  });
}

function animTranslateY(duration, delay, id, value) {
  anime({
    targets: id,
    translateY: {
      value: value,
      duration: duration,
      delay: delay,
      easing: "easeInOutQuad"
    }
  });
}

function animFill(duration, delay, id, value) {
  anime({
    targets: id,
    fill: {
      value: value,
      duration: duration,
      delay: delay,
      easing: "easeInOutQuad"
    }
  });
}

function openMenu() {
  document.querySelector(".create-button").classList.add("expanded");
  document.querySelector(".create-inner").classList.add("expanded");
  document.querySelector(".create-text").classList.add("expanded");
  document.querySelector(".menu").classList.add("show");
  document.querySelector(".new-pen").classList.add("show");
  document.querySelector(".new-pen-from-template").classList.add("show");
  document.querySelector(".new-project").classList.add("show");
  document.querySelector(".new-post").classList.add("show");
  animTranslateY(300, 0, "#arrow-down-mini", 35);
  animD(
    200,
    100,
    "#path",
    "m 203.96632,156.40793 c 17.25572,-0.0312 58.22657,-0.1762 99.44981,-0.35825 0.23008,-35.02657 0.71253,-63.941156 1.23324,-104.627323 0.35821,-9.633627 0.13321,-10.651298 0.13321,-24.396682 0,-6.230066 0.58338,-11.278463 -0.13321,-27.8128127 -17.114,-0.13709681 -12.69782,0.10391192 -30.71168,-0.5793139 -21.42981,1.3664516 -21.63667,1.29798565 -37.70924,0.68322582 -25.63755,0.068467 -35.72548,0.88853707 -57.39097,0.36277558 -25.31576,0.0278109 -42.00161,-0.29430813 -62.85677,-0.36277558 -23.587869,-0.0684659 -82.552835,0.68322578 -89.635085,0.68322578 -7.082063,0 -15.364052,-0.49006623 -27.978786,0.33025636 0.3665563,19.26741864 0.2667094,20.15604264 0.2667094,26.01219264 0,5.856149 -0.2669757,15.001409 -0.8333344,41.477327 0.3970649,35.678564 1.0661554,45.221444 2.199786,88.229904 51.009115,0.64845 62.172445,0.60118 86.818502,1.22625 24.165048,-0.22428 56.210418,0.0309 64.020168,0.1402 8.21306,-0.003 29.29614,-0.87441 53.12765,-1.0082 z"
  );
  animFill(300, 0, "#arrow-down-mini", "#ffffff");
}

function closeMenu() {
  document.querySelector(".create-button").classList.remove("expanded");
  document.querySelector(".create-inner").classList.remove("expanded");
  document.querySelector(".create-text").classList.remove("expanded");
  document.querySelector(".menu").classList.remove("show");
  document.querySelector(".new-pen").classList.remove("show");
  document.querySelector(".new-pen-from-template").classList.remove("show");
  document.querySelector(".new-project").classList.remove("show");
  document.querySelector(".new-post").classList.remove("show");
  animTranslateY(300, 0, "#arrow-down-mini", 0);
  animD(
    200,
    100,
    "#path",
    "m 268.10523,8.8753335 c 0.51266,-0.5435292 2.3001,-2.3345525 3.73347,-3.7539722 1.43337,-1.4194197 2.65706,-2.615199 2.75337,-2.711514 0.0963,-0.096315 0.40793,-0.604345 0.40793,-0.98206 0,-0.377715 -0.15108,-0.725215 -0.40793,-0.98206 -0.25685,-0.256845 -0.60434,-0.40793 -0.98206,-0.40793 -0.37771,0 -0.85363,0.27951 -0.98206,0.40793 -0.12843,0.12842 -2.92998,3.1051319 -5.6204,5.6204 -2.75081,-2.5574243 -5.49196,-5.49198 -5.62039,-5.6204 -0.12843,-0.12842 -0.60434,-0.40793 -0.98206,-0.40793 -0.37771,0 -0.7101,0.13598466 -0.98206,0.39283 -0.27196,0.25684534 -0.42304,0.64211 -0.42304,0.99716 0,0.35505 -0.04,0.5269297 0.39282,0.98206 0.4328,0.4551303 2.08128,2.1020604 3.56285,3.5911816 1.48157,1.4891212 2.78004,2.7937047 2.93385,2.9508386 0.15381,0.1571339 0.69148,0.4195142 1.11877,0.4227298 0.42729,0.00322 0.86184,-0.2119443 1.09694,-0.4992638 z"
  );
  animFill(300, 0, "#arrow-down-mini", "#47cf73");
}

var open = false;
function openDialog(event) {
  if (!open) {
    openMenu();
  } else {
    closeMenu();
  }
  open = !open;
  event.stopPropagation();
}

document.addEventListener("click", function(event) {
  if (open) {
    closeMenu();
  }
  open = false;
});

              
            
!
999px

Console