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

              
                <div id="box"></div>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<div id="svgCont">
<svg version="1.1" id="masterGroup" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
	 y="0px" viewBox="0 0 1024 768" enable-background="new 0 0 1024 768" xml:space="preserve" id="svgMain">
<g id="desktop">
	<g>
		<polygon fill="#363636" points="567,508 567,527 513,527 513,508 530,508 530,473 549,473 549,508 		"/>
	</g>
	<g>
		<path fill="#616161" d="M678,477H402c-6.1,0-11-4.9-11-11V308c0-6.1,4.9-11,11-11h276c6.1,0,11,4.9,11,11v158
			C689,472.1,684.1,477,678,477z"/>
	</g>
	<g>
		<rect x="406" y="312" fill="#FFFFFF" width="268" height="151"/>
	</g>
	<rect x="468" y="317" fill="none" stroke="#363636" stroke-miterlimit="10" width="143" height="23"/>
	<rect x="468" y="372" fill="none" stroke="#363636" stroke-miterlimit="10" width="143" height="23"/>
	<rect x="468" y="435" fill="none" stroke="#363636" stroke-miterlimit="10" width="143" height="23"/>
	<rect x="468" y="346" fill="none" stroke="#363636" stroke-miterlimit="10" width="63" height="20"/>
	<rect x="468" y="402" fill="none" stroke="#363636" stroke-miterlimit="10" width="112" height="20"/>
	<rect x="548" y="346" fill="none" stroke="#363636" stroke-miterlimit="10" width="63" height="20"/>
	<circle fill="none" stroke="#363636" stroke-miterlimit="10" cx="599" cy="412" r="11"/>
	<g>
		<path id="desktopSignature" fill="none" stroke="#363636" stroke-width="2" stroke-miterlimit="10" d="M474,449.1c0,0,2.8-5.7,2.8-7.1
			c0-1.4,3.5,3.5,3.5,5s-2.1,2.8,0,4.3c2.1,1.4,2.1,2.8,4.3,0c2.1-2.8,3.5-5.7,4.3-6.4s5.7-9.9,2.1-1.4c-3.5,8.5-2.8,10.6-0.7,6.4
			c2.1-4.3,2.1-12.8,3.5-6.4c1.4,6.4,1.4,5.7,2.1,3.5c0.7-2.1,0.7-7.8,0.7-2.1c0,5.7,5.7,0.7,7.1,0c1.4-0.7,0.7,0.7,0.7,5
			c0,4.3-0.7,3.5,2.8-2.1c3.5-5.7,4.3-17,4.3-5.7c0,11.3,3.5,6.4,7.1,2.1c3.5-4.3,2.8-1.4,3.5,4.3c0.7,5.7-5,8.5,2.1,1.4
			c7.1-7.1-2.1-14.2,9.9-5s10.6,10.6,13.5,4.3s-5.7-11.3,4.3-6.4c9.9,5-6.4,2.8,10.6,5s11.3,4.3,17,1.4"/>
	</g>
	<g>
		
			<line class="desktopFormContent" fill="none" stroke="#363636" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="478" y1="329" x2="601" y2="329"/>
		
			<line class="desktopFormContent" fill="none" stroke="#363636" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="478" y1="384" x2="601" y2="384"/>
		
			<line class="desktopFormContent" fill="none" stroke="#363636" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="478" y1="356" x2="522" y2="356"/>
		
			<line class="desktopFormContent" fill="none" stroke="#363636" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="558" y1="356" x2="602" y2="356"/>
		
			<line class="desktopFormContent" fill="none" stroke="#363636" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="478" y1="412" x2="570" y2="412"/>
	</g>
	<g>
		<path id="desktopTick" fill="none" stroke="#363636" stroke-width="2" stroke-linejoin="round" stroke-miterlimit="10" d="M593,412c0,0,5,1,6,5
			c0,0,2-13,12-18"/>
	</g>
</g>
<g id="Tablet">
	<g>
		<path fill="#616161" d="M243.4,460.1h-99.4c-1.4,0-2.6-1.1-2.6-2.6V333.1c0-1.4,1.1-2.6,2.6-2.6h99.4c1.4,0,2.6,1.1,2.6,2.6v124.5
			C246,458.9,244.9,460.1,243.4,460.1z"/>
	</g>
	<g>
		<rect x="145.7" y="340.5" fill="#FFFFFF" width="96.1" height="109.5"/>
	</g>
	<g id="tabletFormContent">
		
			<line fill="none" stroke="#363636" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="159" y1="357" x2="229" y2="357"/>
		
			<line fill="none" stroke="#363636" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="159" y1="390" x2="229" y2="390"/>
		
			<line fill="none" stroke="#363636" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="159" y1="406" x2="209" y2="406"/>
		
			<line fill="none" stroke="#363636" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="158" y1="373" x2="182" y2="373"/>
		
			<line fill="none" stroke="#363636" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="205" y1="373" x2="229" y2="373"/>
		<rect x="151.5" y="350.6" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="84" height="13.5"/>
		<rect x="151.5" y="382.9" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="84" height="13.5"/>
		<rect x="151.5" y="425.7" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="84" height="13.5"/>
		<rect x="151.5" y="367.6" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="37" height="11.8"/>
		<rect x="151.5" y="400.5" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="65.8" height="11.8"/>
		<rect x="198.5" y="367.6" fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" width="37" height="11.8"/>
		<circle fill="none" stroke="#363636" stroke-width="0.75" stroke-miterlimit="10" cx="228.5" cy="406.4" r="6.5"/>
		<path fill="none" stroke="#363636" stroke-miterlimit="10" d="M156,434.8c0,0,1.8-3.6,1.8-4.6c0-0.9,2.3,2.3,2.3,3.2
			c0,0.9-1.4,1.8,0,2.7c1.4,0.9,1.4,1.8,2.7,0c1.4-1.8,2.3-3.6,2.7-4.1c0.5-0.5,3.6-6.4,1.4-0.9c-2.3,5.5-1.8,6.8-0.5,4.1
			c1.4-2.7,1.4-8.2,2.3-4.1c0.9,4.1,0.9,3.6,1.4,2.3c0.5-1.4,0.5-5,0.5-1.4s3.6,0.5,4.6,0c0.9-0.5,0.5,0.5,0.5,3.2s-0.5,2.3,1.8-1.4
			c2.3-3.6,2.7-10.9,2.7-3.6c0,7.3,2.3,4.1,4.6,1.4c2.3-2.7,1.8-0.9,2.3,2.7c0.5,3.6-3.2,5.5,1.4,0.9c4.6-4.6-1.4-9.1,6.4-3.2
			c7.8,5.9,6.8,6.8,8.7,2.7c1.8-4.1-3.6-7.3,2.7-4.1c6.4,3.2-4.1,1.8,6.8,3.2c10.9,1.4,7.3,2.7,10.9,0.9"/>
		<path fill="none" stroke="#363636" stroke-linejoin="round" stroke-miterlimit="10" d="M225,406.9c0,0,3.1,0.6,3.7,3.1
			c0,0,1.2-7.9,7.3-11"/>
	</g>
	<g>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="224" y1="319" x2="228" y2="292"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="190" y1="317" x2="189" y2="291"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="157" y1="320" x2="149" y2="294"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="129" y1="327" x2="110" y2="314"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="124" y1="353" x2="99" y2="352"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="126" y1="387" x2="105" y2="390"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="125" y1="415" x2="99" y2="426"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="126" y1="448" x2="98" y2="463"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="134" y1="468" x2="127" y2="483"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="163" y1="476" x2="163" y2="496"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="195" y1="477" x2="198" y2="500"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="235" y1="479" x2="242" y2="502"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="255" y1="470" x2="285" y2="482"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="260" y1="443" x2="289" y2="452"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="258" y1="415" x2="279" y2="415"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="258" y1="385" x2="284" y2="383"/>
		
			<line class="tabletDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="257" y1="353" x2="281" y2="341"/>
	</g>
</g>
<g>
	<path id="rightJump" fill="none" stroke="#FF7700" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M693,286c0,0,103-59,137,42
		"/>
</g>
<g>
	<path id="leftJump" fill="none" stroke="#FF7700" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M382,286c0,0-73-38-125,31"
		/>
</g>
<g id="smartphone">
	<g>
		<path fill="#616161" d="M873.3,412.5h-37.5c-1,0-1.7-0.8-1.7-1.7v-63.5c0-1,0.8-1.7,1.7-1.7h37.5c1,0,1.7,0.8,1.7,1.7v63.5
			C875,411.7,874.2,412.5,873.3,412.5z"/>
	</g>
	<g>
		<rect x="836.5" y="350.5" fill="#FFFFFF" width="36" height="57"/>
	</g>
	<g id="smartphoneFormContent">
		
			<line fill="none" stroke="#363636" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="841.4" y1="358" x2="868.3" y2="358"/>
		
			<line fill="none" stroke="#363636" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="841.4" y1="376.7" x2="868.3" y2="376.7"/>
		
			<line fill="none" stroke="#363636" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="841.4" y1="384.9" x2="860.6" y2="384.9"/>
		
			<line fill="none" stroke="#363636" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="841" y1="368.2" x2="850.2" y2="368.2"/>
		
			<line fill="none" stroke="#363636" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="859.1" y1="368.2" x2="868.3" y2="368.2"/>
		<rect x="838.5" y="355.6" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="32.3" height="5.2"/>
		<rect x="838.5" y="374" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="32.3" height="5.2"/>
		<rect x="838.5" y="395.5" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="32.3" height="5.2"/>
		<rect x="838.5" y="366.1" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="14.2" height="4.5"/>
		<rect x="838.5" y="382.8" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="25.3" height="4.5"/>
		<rect x="856.6" y="366.1" fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" width="14.2" height="4.5"/>
		<circle fill="none" stroke="#363636" stroke-width="0.25" stroke-miterlimit="10" cx="868.1" cy="385" r="2.5"/>
		<path fill="none" stroke="#363636" stroke-width="0.5" stroke-miterlimit="10" d="M840.2,399c0,0,0.7-1.4,0.7-1.8
			c0-0.4,0.9,0.9,0.9,1.2c0,0.4-0.5,0.7,0,1.1c0.5,0.4,0.5,0.7,1.1,0s0.9-1.4,1.1-1.6c0.2-0.2,1.4-2.5,0.5-0.4
			c-0.9,2.1-0.7,2.6-0.2,1.6c0.5-1.1,0.5-3.2,0.9-1.6c0.4,1.6,0.4,1.4,0.5,0.9c0.2-0.5,0.2-1.9,0.2-0.5s1.4,0.2,1.8,0
			s0.2,0.2,0.2,1.2c0,1.1-0.2,0.9,0.7-0.5s1.1-4.2,1.1-1.4c0,2.8,0.9,1.6,1.8,0.5s0.7-0.4,0.9,1.1s-1.2,2.1,0.5,0.4
			c1.8-1.8-0.5-3.5,2.5-1.2c3,2.3,2.6,2.6,3.3,1.1c0.7-1.6-1.4-2.8,1.1-1.6c2.5,1.2-1.6,0.7,2.6,1.2s2.8,1.1,4.2,0.4"/>
		<path fill="none" stroke="#363636" stroke-width="0.5" stroke-linejoin="round" stroke-miterlimit="10" d="M866.8,385.2
			c0,0,1.2,0.2,1.4,1.2c0,0,0.5-3.1,2.8-4.2"/>
	</g>
	<g>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="855" y1="334" x2="857" y2="319"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="885" y1="339" x2="900" y2="328"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="888" y1="368" x2="907" y2="368"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="888" y1="396" x2="907" y2="398"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="882" y1="423" x2="896" y2="439"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="856" y1="426" x2="857" y2="442"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="834" y1="427" x2="826" y2="446"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="823" y1="412" x2="803" y2="422"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="820" y1="387" x2="793" y2="390"/>
		
			<line class="smartphoneDing" fill="none" stroke="#3E70FF" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="826" y1="361" x2="793" y2="354"/>
	</g>
</g>
</svg>
</div>
              
            
!

CSS

              
                svg{
  display:block;
  width:50%;
  margin:0 auto;
}

#box {
  height: 1000px;
  background-color: red;
}
              
            
!

JS

              
                window.onload = function() {  

  TweenLite.set(["#desktopTick", ".desktopFormContent", "#desktopSignature", "#leftJump", "#rightJump", ".tabletDing", ".smartphoneDing"], {drawSVG:0});
  TweenLite.set(["#tabletFormContent", "#smartphoneFormContent"], {opacity:0});

  function swpAnimate() {
    var tl = new TimelineLite();
    
    tl.to(".desktopFormContent", 0.8, {drawSVG:"5% 95%"}, "+=1")  
      .to("#desktopTick", 0.8, {drawSVG:"5% 95%"})
      .to("#desktopSignature", 1.2, {drawSVG:"5% 95%"})
      .to(["#leftJump", "#rightJump"], 1, {drawSVG:"5% 95%",ease:Back.easeOut.config(2)})
      .to(["#tabletFormContent", "#smartphoneFormContent"], 0.8, {opacity:1}, "-=0.5")
      .to([".tabletDing", ".smartphoneDing"], 0.2, {drawSVG:"5% 95%",  ease: Circ. easeOut}, "-=1")
      .to([".tabletDing", ".smartphoneDing"], 0.2, {drawSVG:0, opacity:0,  ease: Circ. easeOut});

  }

  jQuery.prototype.isInViewport = function() {
    var elementTop = jQuery(this).offset().top;
    var elementBottom = elementTop + jQuery(this).outerHeight();

    var viewportTop = jQuery(window).scrollTop();
    var viewportBottom = viewportTop + jQuery(window).height();

    return elementBottom > viewportTop && elementTop < viewportBottom;
  };

  window.onscroll = function() {
    jQuery('#svgCont').each(function() {
      if (jQuery(this).isInViewport()) {
        swpAnimate();        
      }
    });
  };

};
              
            
!
999px

Console