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

              
                <svg viewBox="0 0 466 421" width="800" height="800" class="wv-map" aria-hidden="true">
  <defs>
    <path id="wvMap" d="M202 0h-2l-4 4-1-2h-3l-2 1-2 2-1 2 1 2 3 4 2 5 1 2v4l-2 5v3h1l1 1v7l-1 4v1l-3 2-1 1-1 5-1 2-1 5-1 2-2 4-1 3v8l-1 3v1l-1 2-1 2v1l1 1v1l-1 1h-2l-1-1-1 2 1 1v2l1 1-1 1-1 3h-1l-1 2v4l-1 1-2 1-1 1 1 1 2 2v2l1 1-1 3-1 1-1 1v2l-1 3v2l-7 4-10 8-3 3-2 4-1 2-5 2-1 1-3 3-1 1-2 1h-4l-2 1-3 4h-3l-2-2-1-2-1-2v-1h-4l-2 1-7 6-1 3v4l-2 2v-1h-2v1l-1-1-2 1h-4l-2 4-4 6-1 2v8l-1 2-5 2v2h1v1l1 1 2 1v2l-1 5 1 2 1 1v2l-2 1-1-1-2-2h-2l-1 2v3l-1 2-3 1-1 2-2-1-1-2 1-1v-2h1v-1l1-1-1-1v-2l-2-2-1-2-2-1-2-1-2-1-2-1-3 3-3 4-3 4-2 4v5l-1 2-1 2-1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1h1l1-1 2-3v-2h1v-2l1-2 4-5 4-3 2-4 1-1v-1l-1-2 1-1h-1v-1l1-1v-7l1-1 2-4 2-2v-5l-1-4 1-1v-2l1-3h2l1 1 6 4 5 4 6 5 5 4 5 4 6 4 6 4 5 4 1 1 1 1v-2l1-1 2-4 1-5 2-4 2-5v-2h1l-2-2v-5l1-2-1-3-5-1-1-1 2-2v-4h1l1-1h-2l-2 1h-1l-2-2 1-1v-2l-1-1-1 1v3h-1l-2-5v-1l2-1 2-1v-2l-1-2-1-1h-2l-1 1-1 1-2-1-1 1h-1l-2 1-3-1-1-1-8-8-5-2h-6l-1 1-2 4h-2l-1 2-1 1h-2l-4-1-2 1-2 1-1 1-2-1-1 1 2 4h-3l-1 1v1l2 1v1l-1 1-3 2h-9v1l-8-1-3-1-1-1h-1l-3-3h-1l-1-1v-1l1-1h1v-1l-1-1-1-1-1-1h-1v2l-1 1-1 2-1 1v1l1 1-1 1-2 1h-1l-1 1-1 2-1 2-6 6v1h-1v1l-1 1-1-1h-2l-1-2-2-1h-2l-1-1-1 1-3 2h-1v1l-1 3v1h-1v1l-2 2-1 1h-1v1l-4 2-3 2-1 2-1 1-1 2v1h-1l-4 1h-1l-10 10h-1l-1 1h-1v-63h-12l-12 1h-74l1-8-1-9V0z"></path>

    <circle id="blobCircle" cx="233" cy="210.5" r="50" />

    <clipPath id="wvMapClip">
      <use href="#wvMap" width="800" height="800" />
    </clipPath>

    <!-- Gooey blobs mask -->
    <filter id="gooeyFilter">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9" result="goo" />
      <feComposite in="SourceGraphic" in2="goo" operator="atop" />

      <feTurbulence type="turbulence" baseFrequency="0.05" numOctaves="3" result="turbulence" />
      <feDisplacementMap in="SourceGraphic" in2="turbulence" scale=40 />
    </filter>

    <mask id="blobsMask">
      <g filter="url(#gooeyFilter)" fill="white">
        <use href="#blobCircle" class="wv-map__blob" />
        <use href="#blobCircle" class="wv-map__blob" />
        <use href="#blobCircle" class="wv-map__blob" />
        <use href="#blobCircle" class="wv-map__blob" />
        <use href="#blobCircle" class="wv-map__blob" />
      </g>
    </mask>

    <!-- Grunge mask -->
    <filter id="alphaFilter">
      <feComponentTransfer in="SourceGraphic">
        <feFuncR type="table" tableValues="0 1" />
        <feFuncG type="table" tableValues="0 1" />
        <feFuncB type="table" tableValues="0 1" />
        <feFuncA type="identity" />
      </feComponentTransfer>
    </filter>

    <mask id="grungeMask" x="0" y="0" width="1" height="1" maskUnits="objectBoundingBox">
      <image href="https://live.staticflickr.com/65535/53120533481_5285aadd0f_h.jpg" height="100%" width="100%" preserveAspectRatio="xMaxYMid slice" filter="url(#alphaFilter)" />
    </mask>
  </defs>

  <!-- <use href="#wvMap" class="hp-campuses-svg__stroke" /> -->

  <g clip-path="url(#wvMapClip)">
    <g mask="url(#blobsMask)">
      <rect width="100%" height="100%" mask="url(#grungeMask)" class="wv-map__rect" />
    </g>
  </g>
</svg>
              
            
!

CSS

              
                body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
}

.wv-map {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;

  // &__stroke {
  // 	fill: none;
  // 	stroke: $wvu-gold;
  // 	stroke-width: 1;
  // }

  &__blob {
    transform: rotate(var(--blob-rotation, 0deg)) matrix(4, 0, 0, 4, 0, var(--blob-translate, 100));
    transform-origin: center center;

    .animate & {
      animation-name: move-blob;
      animation-duration: 4s;
      animation-timing-function: ease-out;
      animation-fill-mode: both;
    }

    &:nth-child(1) {
      --blob-translate: 0;
    }

    &:nth-child(2) {}

    &:nth-child(3) {
      --blob-rotation: 45deg;
    }

    &:nth-child(4) {
      --blob-rotation: 135deg;
    }

    &:nth-child(5) {
      --blob-rotation: 225deg;
    }
  }

  &__rect {
    fill: #9ddae6;
  }
}

@keyframes move-blob {
  from {
    transform: rotate(var(--blob-rotation, 0deg)) matrix(0.01, 0, 0, 0.01, 0, 0);
  }
}

              
            
!

JS

              
                (function () {
  var map = document.querySelector(".wv-map");

  map.classList.add("animate");

  map.addEventListener("click", function () {
    this.classList.remove("animate");

    this.offsetWidth;

    setTimeout(() => {
      this.classList.add("animate");
    }, "100");
  });
})();

              
            
!
999px

Console