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

              
                script(src="https://use.fontawesome.com/f769c1e01c.js")
button#btn 
  span.default-text
    |Download
  span.hover-text
    i.fa.fa-download(aria-hidden='true')
#show.content.hide
  h1 Thanks!
  p Downloading in progress...
              
            
!

CSS

              
                @import "bourbon"
body
  margin: 0
  background-color: #3f51b5
  +transition(background 0.5s ease-out)
#btn
  background: transparent
  border: 2px solid #fff
  border-radius: 1em
  color: #fff
  font-size: 24px
  padding: 1em 2em
  position: absolute
  left: 50%
  top: 50%
  +transform(translate(-50%, -50%))
  +transition(all 0.4s ease-out)
.content
  color: #fff
  text-align: center
  position: absolute
  left: 50%
  top: calc(50% + 4em)
  +transform(translate(-50%, -50%))
  +transition(all 0.5s cubic-bezier(.83,-0.43,.21,1.42))
.hide
  opacity: 0
  top: calc(50% + 8em)
  cursor: default
.show
  opacity: 1
  top: calc(50% + 6em)
.on
  background-color: #1976d2
#btn:hover, #btn.active
  background: white
  color: #3f51b5
  outline: none
#btn:focus
  outline: none
.hover-text
  position: absolute
  top: 1em
  left: 3.75em
  transform: translateY(-3em)
  opacity: 0
.default-text
  display: block
  transform: translateX(0)
span
  transition: transform 1s cubic-bezier(.72,-0.61,.25,1.51)
#btn:hover, #btn.active
  .default-text
    transform: translateY(3em)
    opacity: 0
#btn:hover, #btn.active
  .hover-text
    transform: none
    opacity: 1
              
            
!

JS

              
                var download = {
  init: function(settings) {
    download.config = {
      element: $("#show"),
      btn: $("#btn")
    };
    $.extend(download.config, settings);
    download.start();
  },
  start: function() {
    download.config.btn.on("click", function() {
      download.toggleShowElement();
    });
  },
  elementIsHidden: function() {
    download.config.element.hasClass("hide");
  },
  toggleShowElement: function() {
    if (download.elementIsHidden) {
      download.config.element.toggleClass("show");
      $("body").toggleClass("on");
      download.config.btn.toggleClass("active");
    }
  }
};

$(document).ready(download.init);

              
            
!
999px

Console