Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <svg viewBox="-10 0 150 210" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">
  <line x1="-10" x2="297" y1="95" y2="95" opacity="0.5" />
  <g class="main">
    <path d="m0.14732 93.838c5.1858 7.1475 21.74-39.844 48.497-60.434 16.401-12.621 20.98 49.518 42.271 47.602 15.285-1.3761 22.306-24.232 37.224-24.933 19.717-0.92603 13.758 44.919 45.171 45.332 27.195 0.3576 23.024-81.442 56.478-83.113 46.974-2.3465 5.388 128.72 56.121 129.96 31.08 0.75925 7.9765-75.263 38.942-77.821 17.669-1.4595 13.858 42.235 30.495 40.05 27.069-3.5549 3.8119-75.344 31.11-75.767 42.67-0.66031 9.5963 117.27 52.27 116.87 35.996-0.33985 4.5563-100.66 42.222-99.398 39.332 1.3154 6.138 64.279 58.342 66.038 43.662 1.4706 35.362-109.17 52.714-118.06" />
    <g>
      <rect class="normal" x="-6.2672" y="93.57" width="17.387" height="52.917" rx="5" />
      <rect class="positive" x="12.154" y="64.681" width="17.387" height="52.917" rx="5" />
      <rect class="positive" x="30.595" y="40.894" />
      <rect class="positive" x="50.908" y="30.737" />
      <rect class="positive" x="69.082" y="66.017" />
      <rect class="positive" x="88.058" y="78.311" />
      <rect class="positive" x="106.23" y="64.413" />
      <rect class="positive" x="124.41" y="55.059" />
      <rect class="positive" x="145" y="86.329" />
      <rect class="negative" x="161.56" y="98.089" />
      <rect class="positive" x="179.46" y="87.666" />
      <rect class="positive" x="197.37" y="52.386" />
      <rect class="positive" x="215.28" y="18.176" />
      <rect class="positive" x="235.86" y="24.323" />
      <rect class="positive" x="253.25" y="77.24" />
      <rect class="negative" x="258.38" y="132.87" />
      <rect class="negative" x="278.35" y="142.72" />
      <rect class="negative" x="297.06" y="126.95" />
      <rect class="positive" x="307.49" y="74.57" />
      <rect class="positive" x="329.14" y="78.311" />
      <rect class="negative" x="348.11" y="105.57" />
      <rect class="positive" x="366.82" y="75.639" />
      <rect class="positive" x="384.46" y="32.074" />
      <rect class="positive" x="403.17" y="59.335" />
      <rect class="negative" x="410.39" y="115.46" />
      <rect class="negative" x="430.96" y="143.53" />
      <rect class="negative" x="449.94" y="122.95" />
      <rect class="positive" x="458.76" y="70.293" />
      <rect class="positive" x="477.2" y="50.515" />
      <rect class="positive" x="496.18" y="64.146" />
      <rect class="negative" x="514.62" y="106.37" />
      <rect class="negative" x="534.67" y="113.32" />
      <rect class="negative" x="554.71" y="100.23" />
      <rect class="positive" x="572.35" y="59.602" />
      <rect class="positive" x="572.35" y="6.6858" />
    </g>
  </g>
</svg>
              
            
!

CSS

              
                body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90vh;
}

svg {
  display: block;
  width: 350px;
  height: 230px;
}

.normal {
  fill: gold;
}

.positive {
  fill: red;
}

.negative {
  fill: darkred;
}

path,
line {
  fill: none;
  stroke: #000fff;
  stroke-width: 0.3;
}

rect {
  transform-box: fill-box;
  transition: 0.2s linear;
}

.main {
  animation: view 10s linear infinite;
  fill: transparent;
}

.main:hover {
  animation-play-state: paused;
}

@keyframes view {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-400px, 0);
  }
}

              
            
!

JS

              
                document.querySelectorAll("rect").forEach(function (rect) {
  rect.setAttribute("height", 40);
  rect.setAttribute("width", 10);
  rect.setAttribute("ry", 2);

  rect.addEventListener("mousemove", function () {
    this.style.transform = "scale(1.1)";
  });

  rect.addEventListener("mouseout", function () {
    this.style.transform = "scale(1)";
  });
});

              
            
!
999px

Console