Pen Settings



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


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.


                <svg id="defs" xmlns="">
   <linearGradient id="_x2E_stem_1_" gradientUnits="userSpaceOnUse" x1="211.5078" y1="105.9541" x2="249.011" y2="105.9541">
            <stop  offset="0" style="stop-color:#006837"/>
            <stop  offset="7.625596e-02" style="stop-color:#007C3E"/>
            <stop  offset="0.1643" style="stop-color:#008C43"/>
            <stop  offset="0.2319" style="stop-color:#009245"/>
            <stop  offset="0.5141" style="stop-color:#339933"/>
            <stop  offset="0.7929" style="stop-color:#006837"/>
            <stop  offset="0.975" style="stop-color:#39B54A"/>

         <linearGradient id="_x2E_pumpkin_1_" gradientUnits="userSpaceOnUse" x1="75.7889" y1="270.599" x2="397.8843" y2="270.599">
            <stop  offset="0" style="stop-color:#F15A24"/>
            <stop  offset="2.075104e-02" style="stop-color:#F26223"/>
            <stop  offset="0.103" style="stop-color:#F57D20"/>
            <stop  offset="0.176" style="stop-color:#F68D1F"/>
            <stop  offset="0.2319" style="stop-color:#F7931E"/>
            <stop  offset="0.5141" style="stop-color:#F15A24"/>
            <stop  offset="0.7929" style="stop-color:#F7931E"/>
            <stop  offset="0.975" style="stop-color:#F15A24"/>
      <symbol id="jack-o-lantern"> 
         <path class="stem st0" d="M230.3,148L230.3,148c-10.4,0-18.8-8.4-18.8-18.8c1.3-13.8,2.7-27.7,4-41.5

         <path class="pumpkin st1" d="M76,269.1c0.6-36.9,1.4-83,34-120.1c8.8-10.1,29.9-34,59.3-35.3

         <path id="_x2E_eye-whites" class="left-eye st2" d="M209.1,234.7c1.5,9.3-16,24-32.6,22.8c-19.6-1.4-29.4-24.5-32.5-31.9

         <path class="right-eye st2" d="M273.4,234.7c-1.5,9.3,16,24,32.6,22.8c19.6-1.4,29.4-24.5,32.5-31.9

         <path class="st2" d="M328.5,332c0,17.1-44.7,54.5-91.7,54.5s-97.1-41.6-97.1-58.7s50.1,0.2,97.1,0.2S328.5,314.9,328.5,332z"/>

<h1>Happy Halloween!</h1>
<h2>Touch to throw a pumpkin</h2>
<div class="container"></div>
<script id="jackTemplate" type="text/template">
   <div class="jack-image">
      <svg version="1.1" xmlns="" viewBox="0 0 480 480">
      <use xlink:href="#jack-o-lantern" />


                html {
   font-size: 80%;

@media screen and (max-width: 480px) {
   html {
      font-size: 40%;

body {
   font-family: "Rock Salt";
   overflow: hidden;
   background: hsl(190, 20%, 10%);
   text-align: center;
   visibility: hidden;

h1 {
   color: white;
   user-select: none;
   margin: 0;
   font-size: 3rem;
   letter-spacing: 4px;
h2 {
   color: hsl(37, 100%, 69%);
   font-size: 1.65rem;
   user-select: none;
   margin: 0;

.container {
   height: 100vh;
   width: 100vw;
   position: fixed;
   top: 0;
   right: 0;
   left: 0;
   bottom: 0;

.jack {
   height: 40vmin;
   width: 40vmin;
   position: absolute;
   transform-origin: top left;

.jack-image {
   transform: translate(-20vmin, -20vmin);

#defs {
   height: 0;
   width: 0;
   overflow: hidden;

.st0 {
   fill: url(#_x2E_stem_1_);
.st1 {
   fill: url(#_x2E_pumpkin_1_);
   stroke: #f15a24;
   stroke-width: 4;
   stroke-miterlimit: 10;
.st2 {
   fill: #ffc338;
   stroke: #5e4900;
   stroke-width: 4;
   stroke-miterlimit: 10;



                var container = document.querySelector('.container');
var jackTemplate = document.querySelector('#jackTemplate').innerHTML;

function hitTheRoadJack(x, y) { 
   var jack = document.createElement('div');
   jack.innerHTML = jackTemplate; = x; = y; 
   var t1 = just.animate({
      targets: jack, 
      duration: just.shuffle([1000, 1100, 1200]),
      easing: 'ease-out',
      web: {
         opacity: [1, 1, 0],
         scale: .1,
         y: just.random(-140, -110, 'vmin', true),
         x: just.random(-40, 40, 'vmin', true),
         rotate: -420
   });{ destroy: true });

   t1.once('finish', function() {

function intro() {
   // show document body = 'visible';
   var t1 = just.animate({
      targets: just.splitText('h1').characters,
      duration: 430,
      endDelay: 600,
      stagger: 80,
      web: {
         opacity: [0, .3, 1],
         x: [0, -10, 0, -15, 0, -5, 0],
         y: [40, 0]
      targets: 'h2',
      duration: 1000,
      web: {
         opacity: [0, 1]
   t1.on('finish', function() {
      hitTheRoadJack('50vw', '70vw')

var last = undefined
container.addEventListener('click', function(evt) {
   var now =
   if (last === undefined || (now - last) > 200) {
      hitTheRoadJack(evt.clientX + 'px', evt.clientY + 'px');
      last = now;