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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <label>
  <input type="checkbox" />
  <svg width="512px" height="512px" viewBox="0 0 112 64">
    <g class="icon">
      <g class="debug">
        <path class="bottom-right" d="
          M 56,32
          L 72,48
          C 80,56 80,56 88,56
          L112,56
        "></path>
        <path class="top-right" d="
          M 56,32
          L 72,16
          C 80, 8 80, 8 88, 8
          L112, 8
        "></path>
        <path class="bottom-left" d="
          M 56,32
          L 40,48
          C 32,56 32,56 24,56
          L  0,56
        "></path>
        <path class="top-left" d="
          M 56,32
          L 40,16
          C 32, 8 32, 8 24, 8
          L  0, 8
        "></path>
        <path class="middle" d="
          M  0,32
          L112,32
        "></path>
      </g>
      <path class="bottom-right" d="
        M 56,32
        L 72,48
        C 80,56 80,56 88,56
        L112,56
      "></path>
      <path class="top-right" d="
        M 56,32
        L 72,16
        C 80, 8 80, 8 88, 8
        L112, 8
      "></path>
      <path class="bottom-left" d="
        M 56,32
        L 40,48
        C 32,56 32,56 24,56
        L  0,56
      "></path>
      <path class="top-left" d="
        M 56,32
        L 40,16
        C 32, 8 32, 8 24, 8
        L  0, 8
      "></path>
      <path class="middle" d="
        M  0,32
        L112,32
      "></path>
    </g>
    <defs>
      <filter id="gooey">
        <feGaussianBlur
          in="SourceGraphic"
          result="blur"
          stdDeviation="2"
        />
        <feColorMatrix
          in="blur"
          mode="matrix"
          values="
            1 0 0 0 0
            0 1 0 0 0
            0 0 1 0 0
            0 0 0 18 -7
          "
          result="gooey"
        />
        <feBlend
          in2="gooey"
          in="SourceGraphic"
          result="mix"
        />
      </filter>
    </defs>
  </svg>
</label>

              
            
!

CSS

              
                html
  margin 0
  padding 0
  background #272a36

label
  cursor pointer
  input
    display none

svg
  position absolute
  top 50%
  left 50%
  transform translate(-50%, -50%)
  filter url("#gooey")

path
  fill none
  stroke-linecap round
  stroke #A06BA5
  stroke-width 3.5px
  transition all 1000ms cubic-bezier(0.5, -0.3, 0.5, 1.3), transform 750ms cubic-bezier(0.4, 0, 0.6, 1)

.top-left
.top-right
.bottom-left
.bottom-right
  stroke-dasharray 10px 65.43px
  stroke-dashoffset -49.43px
  transform translate(0px)

.middle
  stroke-dasharray 16px 132px
  stroke-dashoffset -48px
  transition all 750ms cubic-bezier(0.5, -1, 0.5, 2)

.top-left
  transform translate( 42px,  15px)
.top-right
  transform translate(-42px,  15px)
.bottom-left
  transform translate( 42px, -15px)
.bottom-right
  transform translate(-42px, -15px)

input:checked + svg
  .top-left
  .top-right
  .bottom-left
  .bottom-right
    stroke-dashoffset 0px
    stroke-dasharray 10px 65.43px
    transform translate(0)

  .middle
    stroke-dasharray 1px 132px
    stroke-dashoffset -55.5px

.debug 
  display none
  path
    stroke-dasharray none !important
    stroke #000 !important

.enable-debug
  .debug
    display inherit
  .icon
    transform translateX(0) !important
  svg
    filter none

              
            
!

JS

              
                const input = document.getElementsByTagName('input')[0];
const label = document.getElementsByTagName('label')[0];
const blur = document.all.gooey.children[0]

// auto toggle until manual interaction
const autoToggle = setInterval(() => {
  input.checked = !input.checked;
}, 3000);
input.onchange = (e) => (settings.open = input.checked);
label.onclick = (e) => clearInterval(autoToggle);

// adjust values
const settings = {
  debug: false,
  outerTime: 1000,
  middleTime: 750,
  transitionTime: 750,
  strokeSize: 3.5,
  gooeySize: 2,
};

const applyChanges = function() {
  if (settings.debug) {
    document.body.classList.add('enable-debug');
  } else {
    document.body.classList.remove('enable-debug');
  }
  const paths = document.getElementsByTagName('path');
  for (const path of paths) {
    path.style.transitionDuration = '0ms';
    path.style.strokeWidth = settings.strokeSize + 'px';
  }
  blur.setStdDeviation(settings.gooeySize, settings.gooeySize);
  setTimeout(() => {
    for (const path of document.getElementsByTagName('path')) {
      path.style.transitionDuration = settings.outerTime + 'ms, ' + settings.transitionTime + 'ms';
    }
    document.all.middle.style.transitionDuration = settings.middleTime + 'ms';
  }, 0);
};

var gui = new dat.GUI();
gui.add(settings, "debug").onChange(applyChanges);
gui.add(settings, "outerTime", 50, 2000, 1).onChange(applyChanges);
gui.add(settings, "middleTime", 50, 2000, 1).onChange(applyChanges);
gui.add(settings, "transitionTime", 50, 2000, 1).onChange(applyChanges);
gui.add(settings, "strokeSize", 0.5, 5, 0.1).onChange(applyChanges);
gui.add(settings, "gooeySize", 1, 10, 0.1).onChange(applyChanges);

gui.close();

              
            
!
999px

Console