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

              
                <svg viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg">
<defs>
  <filter id="goo">
      <feGaussianBlur in="SourceGraphic" stdDeviation="3.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 21 -9" result="cm" />
      <feBlend/>
  	</filter>     
</defs>
 <!--  <mask id="lineMask"> -->
  <g  fill="none" stroke="#F2F2F4" stroke-width="2" stroke-miterlimit="10">
<polyline points="725,123 684,52 84,361 191,531 " />
<polyline points="725,500 696,531 83.8,400 "/>
<polyline points="332,307.5 372,53 465,53 "/>
<polyline points="84,211.5 204,52.8 346,532 554,532 "/>
<polyline points="423,53 725,366 571,531 "/>
<polyline points="484,52 415,531 84,308 260,52 305.3,82.6"/>
<polyline points="84,495 725,410 469,356 "/>
<polyline points="552,52 725,178 84,465 "/>
<polyline points="724,324 724,215 483.6,52 "/>
<polyline points="724,324 83.8,211.3 102,240 "/>
<polyline points="83.9,465 83.8,400 332,315 84,176 169,53 84,53 84,123 "/>
<polyline points="400,300 252,532 84,532 83.9,465 "/>
<polyline points="562,532 507,337 724,258.5 559,174 "/>
<polyline points="408,416 83.8,265 554,174 "/>
<polyline points="293,207 312,53 431,99 408,416 "/>
<polyline points="615.5,53 724,80 724,53 282,53 "/>
<polyline points="615.5,531 724,452 302,531 725,151 84,133"/>
  </g>
    <!-- </mask> -->
<!-- <g mask="url(#lineMask)" fill="#ededed">
  <text x="50%" y="50%">🎈</text>
</g> -->  
</svg>

              
            
!

CSS

              
                body {
  background-color:#212121;
  overflow: hidden;
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}


svg{
  width:100%;
  height:100%;
  visibility:hidden;
 
}

text{
  font-size:128px;
}
              
            
!

JS

              
                var xmlns = "http://www.w3.org/2000/svg",
  xlinkns = "http://www.w3.org/1999/xlink",
  select = function(s) {
    return document.querySelector(s);
  },
  selectAll = function(s) {
    return document.querySelectorAll(s);
  },
    allLines = selectAll('polyline')


TweenMax.set('svg', {
  visibility: 'visible'
})
var mainTl = new TimelineMax();
function createLines(){
  
  for(var i = 0; i < allLines.length; i++){
    
    TweenMax.set(allLines[i], {
      drawSVG:'0% 0%'
    })
    var length = 5;//(getPolylineLength(allLines[i])/1000) * 2;
    //var tl = new TimelineMax({repeat:-1, repeatDelay:randomBetween(0, 5)});
    var tl = new TimelineMax({paused:true});
    tl.to(allLines[i], length * 0.2, {
      drawSVG:'0% 20%',
      ease:Linear.easeNone
    })
      .to(allLines[i], length * 1, {
      drawSVG:'50% 70%',
      ease:Linear.easeNone
    })
     .to(allLines[i], length * 0.6, {
      drawSVG:'70% 90%',
      ease:Linear.easeNone
    })
     .to(allLines[i], length * 0.3, {
      drawSVG:'100% 100%',
      ease:Linear.easeNone
    })
    
    var t = TweenMax.to(tl, randomBetween(6, 10), {
      time:tl.duration(),
      ease:Power3.easeInOut,
      repeat:-1, 
      yoyo:true,
      repeatDelay:randomBetween(3, 7)
    })
    mainTl.add(t, i)
  }
}

function randomBetween(min, max) {
  return Math.floor(Math.random() * (max - min + 1) + min);
}  

function getPolylineLength(p){
  var l = 0;
for (var i = 0 ; i < p.points.numberOfItems;i++) {
    var pos = p.points.getItem(i);
    if (i > 0) {
        l += Math.sqrt(Math.pow((pos.x - prevPos.x), 2) + Math.pow((pos.y - prevPos.y), 2));
    }
    prevPos = pos;
}  
  
  return l;
}
createLines();
mainTl.seek(100).timeScale(2.8)

              
            
!
999px

Console