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.


                <button id="everybodydance"><span>PARTY!</span></button>


                html { height: 100%; }
body { min-height: 100%; margin: 0; display: flex; justify-content: center; align-items: center; }
button { 
  border-radius: 50%; 
  width: 200px;
  height: 200px;
  border: none;
  color: white;
  font-family: Avenir, Arial, sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  background: red;
  text-shadow: 0 3px 1px rgba(122,17,8,.8);
  box-shadow: 0 8px 0 rgb(183,9,0), 
    0 15px 20px rgba(0,0,0,.35);
  text-transform: uppercase;
  transition: .4s all ease-in;
  outline: none; 
  cursor: pointer;
  text-align: center;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
button span { position: relative; }
/* fix for IE 11 (and IE8+, although the earlier versions are harder to address) stupidly moving the inner button text on click */
.pressed { 
  padding-top: 3px;
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgb(183,0,0),
    0 8px 6px rgba(0,0,0,.45);



                var contextClass = (window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext);
var dance = document.getElementById("everybodydance");
if (contextClass) {
  var context = new contextClass();
} else {
var request = new XMLHttpRequest();'GET', "", true);
request.responseType = 'arraybuffer';
request.onload = function() {
 context.decodeAudioData(request.response, function(theBuffer) {
  buffer = theBuffer;
  }, onError);

function onError() { console.log("Bad browser! No Web Audio API for you"); }

function unpress() { dance.classList.remove("pressed"); }

function playSound() {
  var source = context.createBufferSource();
  source.buffer = buffer;
  var delay = 2000;
dance.addEventListener('click', function(event) { playSound(); });