cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 50 600 450" opacity="0">
  <line x1="150" x2="450" y1="300" y2="300" fill="none" stroke="#333" stroke-width="48" stroke-linecap="round"/>
  <line x1="150" x2="450" y1="300" y2="300" fill="none" stroke="#222" stroke-width="30" stroke-linecap="round"/>
  <path stroke-dashoffset="833" stroke-dasharray="834 834" stroke-linecap="round" fill="none" fill-rule="evenodd" stroke="#8ADB2C" stroke-width="18" d="M150,300c0,0,138,0,198,0c112,0,66-122,15-165c-43.9-37-92-10-79,33c7.7,25.5,51.6,47.6,99,36c139-34,67,96,67,96" />
  <text fill="#FFF" transform="translate(145.615 266.265)" font-family="sans-serif" font-size="31">
    loading...
  </text>
  <polygon fill="#FFA06C" points="434 278 424 205 459 286 498 234 479 298 538 275 484 320 542 349 462 335 462 394 439 318 372 356 427 299 372 260" />
  <polygon fill="#FFE45F" points="414 252 440 299 497 233 479 287 529 283 498 315 539 334 476 329 503 382 448 329 432 382 426 317 372 333 420 299" />
  <polygon fill="#FFF" points="434.1 303.9 428.3 261.2 451.7 290.5 457.6 265.4 468.5 296.4 528 252 481.9 303.9 517.1 312.3 469.3 316.5 509.6 341.6 462.6 336.6 458.4 376 443.3 319.8 417.4 357.6 426.6 314 383 298.9" />
</svg>
            
          
!
            
              body{
	margin:0;
	background:#222;
}
svg{
	width:100%;
	height:100%;
	position:fixed;
}
            
          
!
            
              var path = document.querySelector("path");
var length = path.getTotalLength();
// create timeline
var timeline = new TimelineMax({
	repeat: -1,
	repeatDelay: 1
});

// initial animation of svg
TweenMax.to("svg", 0.5, {
	opacity: 1
});

// set up looping text animation
TweenMax.to("text", 0.5, {
	opacity: .2,
	yoyo: true,
	repeat: -1,
	ease: Sine.easeInOut
});

// path animation
timeline.from(path, 1, {
	autoAlpha: 0,
	ease: Power2.easeOut
});
timeline.to(path, 2, {
	attr: {
		"stroke-dashoffset": 0
	},
	ease: Quint.easeIn
}, 0);


// Explosion
timeline.staggerFrom("polygon", .2, {
		scale: 0,
		transformOrigin: "center",
		ease: Back.easeOut
	}, .05, 2);
	timeline.staggerTo("polygon", 0.5, {
		cycle: {
			rotation: [-90, 90]
		},
		transformOrigin: "center"
	}, 0, 2);
	timeline.staggerTo("polygon", .5, {
		autoAlpha: 0,
		transformOrigin: "center",
		ease: Back.easeOut
	}, -.05, 2 + "+=.4");

// remove path
timeline.to(path, 2, {
	attr: {
		"stroke-dashoffset": -length
	},
	autoAlpha: 0,
	ease: Quint.easeInOut
}, 2);


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console