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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 xmlns="http://www.w3.org/2000/svg" width="852" height="880" viewBox="0 0 852 880">
  <defs>
   <filter id="goo" color-interpolation-filters="sRGB">
     <feGaussianBlur in="SourceGraphic" stdDeviation="8" 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 25 -20" result="cm" />
<!--      <feColorMatrix in="blur" mode="matrix" values="1 0.3 0 0 0  0 1 0.3 0 0  0 0 1 0 0  0 0 0 25 -20" result="cm" />  -->
    </filter>
  </defs>
    <g id="blob" filter="url(#goo)">
      <rect fill="#00BBAA" x="284" y="301" width="284" height="284"></rect>
      <path d="M350,509 L350,628.509414"/>
      <path d="M510,512 L644.5,512"/>
      <path d="M507,494 L507,644.799536"/>
      <path d="M436,515 L436,708.205849"/>
      <path d="M337,394.082031 L337,166.5639"/>
      <path d="M426,392.972656 L426,231.521425"/>
      <path d="M513,418.191406 L513,192.398359"/>
      <path d="M475,389 L740.5,389"/>
      <path d="M302,524 L222.5,524"/>
      <path d="M313,360 L220.5,360"/>
      <path d="M380.5,450 L133.5,450"/>
    </g>
</svg>
<h1>Click me</h1>
              
            
!

CSS

              
                body { 
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
  background-color: #344;
  flex-direction: column;
  color: #fff;
}
svg path {
  stroke: #0ba;
  stroke-width: 60px;
  stroke-linecap: round;
  opacity: 0;
}
              
            
!

JS

              
                const svg = document.querySelector('svg');
const allLines = document.querySelectorAll('path');
const duration = .8;
const ease = Power2.easeOut;

function playBubble() {
  const lineCount = allLines.length;
  const randomNum = Math.floor(Math.random()* lineCount);
  
  const randomLine = allLines[randomNum];
  var tl = new TimelineMax();
  tl.set(randomLine, {
    css:{autoAlpha: 1},
    drawSVG:'40% 40%'
  })
  .to(randomLine, duration, {
    drawSVG:'40% 70%',
    ease: Linear.easeNone
  })
  .to(randomLine, duration, {
    drawSVG:'100% 100%',
    ease: ease
  });
}

svg.addEventListener('click', playBubble);
              
            
!
999px

Console