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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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="action">Toggle Reveal</button>
<svg id="demo" xmlns="" width="100%" height="100%" >
<mask id="theMask">
<rect x="0" y="0" width="100%" height="100%" fill="#fff" />
<circle id="cover"r="200" fill="black" cx="50%" cy="50%"/>

<g mask="url(#theMask)"> 
<rect id="goAway" x="0" y="0" width="100%" height="100%" fill="#000" /> 



                * {
  box-sizing: border-box;

body {
  height: 100vh;
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  color: white;
  font-family: "Roboto", sans-serif;
  background: url("")
    center center no-repeat;
  background-size: cover;

#action {
  padding: 10px;
  font-size: 0.875em;
  cursor: pointer;
  font-weight: 700;
  font-family: "Roboto", sans-serif;
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;



TweenLite.defaultEase = Power2.easeInOut;
TweenMax.set("#action", {xPercent:-50, yPercent:-50});
document.querySelector("#action").addEventListener("click", doCoolStuff);

var toggle = "open";
var r = 0;
var dur = 0.75;

function doCoolStuff() {
  if (toggle == "closed") {
    toggle = "open";"#cover", dur, { attr: { r: r } });
  } else {
    toggle = "closed";"#cover", dur, { attr: { r: 200 } });

function figureMask() {
  // find the minimum radius needed to cover
  // the entire SVG and center the circle 
  var data = document.querySelector("#goAway").getBBox();
  r = figureRadius(data.width, data.height);
  // if the image is visible
  // update the radius while resizing
  if (toggle != "closed") {
    TweenMax.set("#cover", { attr: { r: r } });

function figureRadius(w, h) {
  return Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 2;

window.addEventListener("resize", figureMask);