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

              
                <input id="trigger" class="toggle-checkbox" type="checkbox"><label for="trigger">Throw the Switch</label>

<div class="bracket"><svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 337 334"><path fill="#b7b0b0" d="M217 296h25v-48h24v-34h27v-62h22V47h22V0H0v47h22v105h22v62h27v34h23v48h26v38h97v-38zm-38 1v10h-22v-10h-9v-22h9v-9h22v9h10v22h-10z"/></svg><div class="bracketbottom"></div></div>
<div class="shrinkray"><svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 958 383"><path fill="#696969" d="M289 28l196-1v327H290l-1-326z"/><path fill="#3d5070" d="M758 147h33v20h45v11h87v23h-87v12h-45v19h-33v28h-63V119h63v28z"/><path fill="#404040" d="M329-4l1 392-258 1v-34H51v-25H27v-27H1L0 81h26V53h24V28h21V-3l258-1z"/><path fill="#b0b0b0" d="M502 52l165-1v28l32-1 1 223h-33v27l-175 1 10-277z"/><path fill="#9f5f3a" d="M478 11h24v359h-24V11zM686 62h14v257h-14V62zM745 103h13v175h-13V103zM784 131h14v119h-14V131zM824 153h14v75h-14v-75zM940 166h8v9h9v29h-9v9h-8v8h-28v-8h-9v-9h-9v-29h9v-9h9v-8h28v8z"/></svg><div class="beam"></div></div>
<div class="scientist"><svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 208 374"><g transform="matrix(1.08695 0 0 1.04752 -4822 -2524)"><path fill="#3d5070" fill-rule="nonzero" d="M4491 2723v-71h81v23h1v48h-37v-39h-9v39h-36z"/><path fill="#60422d" fill-rule="nonzero" d="M4436 2584h33v35h-33zM4627 2584h-36v29h36z"/><path fill="#43703d" fill-rule="nonzero" d="M4591 2551h9v10h9v9h9v10h9v9h-27v15h-9v-9h-9v-6h-10v63h-81v-63h-55v-10h9v-9h9v-9h9v-10h9v-9h119v9z"/><path fill="#2d2d2d" fill-rule="nonzero" d="M4491 2645h81v9h-81zM4527 2766h-59v-36h23v-11h36v47zM4536 2719h37v11h23v36h-60v-47z"/><path fill="#60422d" fill-rule="nonzero" d="M4509 2525h45v26h-45z"/><path fill="#fff" fill-rule="nonzero" d="M4570 2542h21v9h9v10h9v9h9v10h9v9h-27v15h-9v-9h-9 1v67h2v37h-42v-5h-7v-27h-2v-49h2v-31h4v-11h1v-13h2v-11h3v-13h24v3zM4500 2542v-3h21v13h2v11h3v13h3v13h1v11h1v36h-4v48h-6v13h-21v8h-33v-18h4v-18h7v-17h5v-16h1v-47h-48v-10h9v-9h9v-9h9v-10h9v-9h28z"/><path fill="#1b1006" fill-rule="nonzero" d="M4563 2419h10v28h-82v-28h8v-10h64v10z"/><path fill="#7c5439" fill-rule="nonzero" d="M4564 2438h13v18h14v29h-10v28h-8v9h-9v10h-18v10h-28v-10h-18v-10h-9v-9h-10v-28h-9v-29h14v-18h14v-10h64v10z"/><path fill="#fff" fill-rule="nonzero" d="M4536 2447h31v29h-31zM4500 2447h27v29h-27z"/>
  <path class="mouth" fill="#493222" fill-rule="nonzero" d="M4518 2504h27v9h-27z"/><g class="eyes"><path id="rteye" fill="#444445" fill-rule="nonzero" d="M63 45h9v9h-9z" transform="matrix(1.01311 0 0 1.05124 4454 2409)"/><path id="lteye" fill="#444445" fill-rule="nonzero" d="M108 36h9v9h-9z" transform="matrix(1.01311 0 0 1.05124 4447 2419)"/></g><path fill="#1b1006" fill-rule="nonzero" d="M4573 2438h9v37h-9zM4481 2438h10v37h-10z"/><path fill="#342217" d="M4529 2444h38l1 1 16 7v5h-2l-14-6v27l-1 2h-33l-1-2v-15h-3v15l-1 2h-33l-1-2v-27l-14 6h-2v-5l16-7 1-1h33zm-32 2v31h31v-31h-31zm69 0h-31v31h31v-31zm-33 0h-3v15h3v-15z"/><path fill="#1b1006" fill-rule="nonzero" d="M4577 2438h5v37h-5zM4481 2438h5v37h-5z"/><path fill="#60422d" fill-rule="nonzero" d="M4527 2466h9v28h-9z"/>
  <g class="mug"><path fill="silver" d="M4546 2586v40h-30v-7h-11l-1-1v-23l1-1h11v-8h30zm-30 30v-20h-10v20h10z"/><path fill="#fff" fill-rule="nonzero" d="M4523 2598v5h-2 1v-2h-3v2h1-2 1v-4h-1v-1h2v1h-1v1h3v-1h-1v-1h2zM4528 2603h-4v-3h1v3h1v-1h1v-2h-1 2v3zM4532 2600h3v3h-2 1v-3h-1v1h-1v2h1-2v-3 1h-1v2h1-2v-3h3zM4538 2601v-1h-1v1h1zm1 0v1h-2v1h1v-1h1v1h-3v-3h3v1zM4542 2601v1-2h1v1h-1v3h-1v1h-1v-1h1v-3h-1v-1h2-1v1h1zM4525 2605v1h1v1h-1v2h1v1h-2v-3h-1v-1h1v-1h1zM4529 2608v-1h-2v1h2zm0-1h1v1h-3v1h3-1v1h-2v-1h-1v-2h1v-1h2v1zM4533 2606v1h-2v2h2v1h-2v-1h-1v-2h1v-1h2zM4538 2607v3h-2v-1h1v-2h-2v2h1v1h-2v-5h1v2h1v-1h1v1h1z"/>
  </g>
    <g><path fill="#7c5439" fill-rule="nonzero" d="M4497 2588h8v9h6v19h-6v9h-27v-7h-35v-23h35v-7h1v-2h18v2z"/></g><g><path fill="#7c5439" fill-rule="nonzero" d="M4582 2601h45v28h-9v10h-18v-10h-9v-19h-9v-9z"/></g></g></svg></div>
 <div class="z">
      <svg id="hat" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 183 60"><path fill="#8d5e3f" d="M128.4 7.2h7.4V48H146v-2.7h36.2v11.6H164v2.7H18V57H0V45.3h36.2V48h10.6V7.2h7.4V0h74.2v7.2z"/></svg>
   <div id="cowboy">
  <svg fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 208 394"><path fill="#91c1a3" d="M0 208h43v25H0v-25zm169 0h39v25h-39v-25z"/><path fill="#593000" d="M40 169v-10h129v10h9v10h10v10h10v10h10v9l-30 1v9h-19v-9h-10v62H60v-62H49v9H30v-9l-30-1v-9h10v-10h10v-10h10v-10h10z"/><path fill="#2e1d0d" d="M99 337v57H35v-37h25v-20h39zm10 0h40v20h25v37h-65v-57z"/><path fill="#433122" d="M60 273h89v65h-40v-31H99v31H60v-66 1z"/><path fill="#9cd3b3" d="M4 228h6v-10h50v10H49v20h-9v10H20v-10H10v-10H4v-10zm144-10h50v10h7v10h-7v10h-10v10h-20v-10h-9v-20h-11v-10z"/><path fill="#91c1a3" d="M79 149h50v20H79z"/><path fill="#3a3a3a" d="M149 55H60V31h10V21h19v9h10v9h10v-9h10v-9h19v10h11v24z"/><path fill="#9cd3b3" d="M140 51h9v19h20v30h-11v29h-9v10h-9v10h-20v10H89v-10H69v-10h-9v-10H50v-29H40V70h20V51h9V41h71v10z"/><path fill="#fbeb8e" d="M109 60h30v30h-30V60zm-40 0h30v30H69V60z"/><path fill="#758b7c" d="M89 120h30v10H89z"/><path fill="#444445" d="M119 80h10v10h-10zM69 70h10v10H69z"/><path fill="#4d4c4c" d="M149 264v10h-29v2H99v2H87v2H58v-9h12v-3h21v-2h18v-2h40z"/><path d="M54 259h3v3h3v18h-3v31h-2v18h-5v-18h-1v-31h-3v-18h3v-3h2v-6h3v6z"/><path fill="#2f2218" d="M44 285v-16h16v38H47v-22h-3z"/>
    <path fill="#3a3a3a" d="M149 50h10v39h-10zM50 50h10v39H50z"/>
     </svg>
     </div>
    <div id="mustache"> <svg fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 100 208 394"><path fill="#3a3a3a" d="M141 105h10v35h-4v4h-18v-32H80v32H61v-4h-3v-35h10v-5h73v5z"/></svg></div>
    <svg id="nose" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 208 394"> <path fill="#91c1a3" d="M99 80h10v29H99z"/></svg>
   
</div>
<div class="stage"></div>



<div class="logo"><a href="https://undead.institute" target="_blank"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1804713/UndeadInsti-LogoOnWhite.png" alt="Getting Braaains should be fun"></a></div>
              
            
!

CSS

              
                :root{
  --timing: 4s;
}

.toggle-checkbox:checked ~ .shrinkray .beam { 
  animation: var(--timing) ease-in-out 0s beamer forwards;
}
.shrinkray .beam {
  opacity: 0;
}
@keyframes beamer {
  0% { opacity: 0;}
  1%, 99% { opacity: 1; }
  20% {
    transform: scaleX(1);
  }
  100% { opacity: 0; transform: scaleX(1);}
}
.toggle-checkbox:checked ~ .z #mustache svg {
  animation: var(--timing) ease-in-out 0s nonshrinkydink-s forwards;
}
#mustache svg {
  transform-origin: top center;
  position: absolute;
  width: 100%;
  transform: scale( 0.2, 0.2 );
}
@keyframes nonshrinkydink-s {
  0%, 20% {   transform: scale(0.2, 0.2); }
  100% { transform: scale(1, 1.4); }
}
.toggle-checkbox:checked ~ .z {
  animation: var(--timing) linear 0s highlight forwards;
}
@keyframes highlight {
  0%, 99% {   filter: drop-shadow(0 0 0.5vw yellow) drop-shadow(0 0 1vw yellow); }
  100% { filter: none; }
}
#mustache {
  transform-origin: top center;
  transform: translate( 0, 0 );
  position: absolute;
  z-index: 1000;
  width: 75vw;
  top: 7.25vw;
  left: -30vw;
}
#nose {  
  position: absolute;
  z-index: 10000;
  width: 100%;
  top: 0;
}
.bracket {
  width: 10vw;
  position: absolute;
  bottom: 40vw;
  left: 15vw;
  z-index: 10;
}
.bracketbottom {
  height: 100vh;
  width: 10vw;
  background-color: #b7b0b0;
  position: absolute;
  top: -99vh;
}
.shrinkray {
  width: 25vw;
  position: absolute;
  bottom: 37vw;
  left: 15vw;
  transform-origin: 20% 50%;
  transform: rotate(25deg);
  z-index: 9;
}
.beam {
  position: absolute;
  width: 39vw;
  height: 0.5vw;
  bottom: 5.05vw;
  left: 24vw;
  background-color: yellow;
  z-index: -1;
  box-shadow: 0 0 0.5vw yellow, 0 0 0.5vw yellow;
}
.scientist {
  width: 15vw;
  position: absolute;
  bottom: 1vw;
  left: 15vw;
}
.z {
  width: 15vw;
  position: absolute;
  bottom: 3.5vw;
  right: 15vw;
  z-index: 10;
}
#hat {
  position: absolute;
  z-index: 10;
  transform: rotate(0) translateY(0);
  transform-origin: center 50px;
  top: -1vw;
  margin-bottom: -5.5em;
}

.stage {
  width: 30vw;
  background-color: darkslategray;
  height: 5vw;
  position: absolute;
  bottom: -1vw;
  right: 7.5vw;
  z-index: 0;
}

body {
  background-color: lightskyblue;
  overflow: hidden;
}

.logo {
  width: 100%;
  max-width: 400px;
  position: absolute;
  top: 0;
  right: 0;
}
.logo img {
  width: 100%;
}
input{
  display: none;
}
input:checked + label {
  box-shadow: inset 3px 3px 2px #660000;
  transform: translate(3px, 3px);
}
label {
  font-size: 1.5em;
  color: #FFF;
  background-color: #960B0B;
  width: 200px;
  height: 30px;
  text-align: center;
  font-weight: bold;
  display: block;
  border-radius: 7px;
  box-shadow: 3px 3px 0 #660000;
  cursor: pointer;
  position: relative;
  z-index: 1000;
}
              
            
!

JS

              
                
              
            
!
999px

Console