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 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

              
                <header>
	<h1>Click to cycle between the different experiments</h1>
	
</header>

<main>
	
	
	
	
	
	
	<section id="dom">
		
		<article>
	
			<p>1000</p>
			
		</article>
		
	</section>
	
	
	
	
	<section id="spriteSheet">
	
		<article>

			<div class="sprite">

				<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/1000bubling.gif" alt="1000">
				
			</div>
		
		</article>
	
	</section>
	
	
	
	
	<section id="svgMorph">
		
		<article>
			
			<svg id="morph" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 72.5">
				
				<!-- 	Hide the morph paths -->
				<symbol>
					<g id="grp5">
					<path class="ones" d="M22.2,14.7H22L10.7,20.8,9,14.1,23.2,6.5h7.5v65H22.2Z"/>
					<path class="tens" d="M91.3,38.2c0,22.1-8.2,34.3-22.6,34.3C56,72.5,47.4,60.6,47.2,39.1S56.6,5.3,69.8,5.3,91.3,17.5,91.3,38.2ZM56,39.2c0,16.9,5.2,26.5,13.2,26.5S82.5,55.2,82.5,38.6,78.4,12.1,69.3,12.1,56,21.5,56,39.2Z"/>
					<path class="hundreds" d="M152.9,38.2c0,22.1-8.2,34.3-22.6,34.3-12.7,0-21.3-11.9-21.5-33.4s9.4-33.8,22.6-33.8S152.9,17.5,152.9,38.2Zm-35.3,1c0,16.9,5.2,26.5,13.2,26.5s13.3-10.5,13.3-27.1S140,12.1,130.9,12.1,117.6,21.5,117.6,39.2Z"/>
					<path class="thousands" d="M214.4,38.2c0,22.1-8.2,34.3-22.6,34.3-12.7,0-21.3-11.9-21.5-33.4s9.4-33.8,22.6-33.8S214.4,17.5,214.4,38.2Zm-35.3,1c0,16.9,5.2,26.5,13.2,26.5s13.3-10.5,13.3-27.1-4.1-26.5-13.2-26.5S179.1,21.5,179.1,39.2Z"/>
					</g>
					<g id="grp4">
					<path class="ones"  d="M7.8,71.5V70.4a13.6,13.6,0,0,0,2.9-.3l2.5-.8a6.2,6.2,0,0,0,2-1.5,3,3,0,0,0,.6-1.8V29.9a2.7,2.7,0,0,0-.7-2,6.4,6.4,0,0,0-1.9-1.3l-2.6-.8-2.8-.2V24.5h24v1.1l-2.7.2-2.6.8A5.5,5.5,0,0,0,24.6,28a2.8,2.8,0,0,0-.8,2V66.1a2.9,2.9,0,0,0,.8,2.1,4.6,4.6,0,0,0,2,1.3,11.1,11.1,0,0,0,2.6.7l2.6.2v1.1Z"/>
					<path class="tens"  d="M91.3,57.8a25.8,25.8,0,0,1-5.2,7.9,21.4,21.4,0,0,1-7.6,5,23.3,23.3,0,0,1-9,1.8,26.5,26.5,0,0,1-8.1-1.4,21.3,21.3,0,0,1-7.9-4.4,22.4,22.4,0,0,1-5.9-7.8,25.9,25.9,0,0,1-2.3-11.3,23,23,0,0,1,1.8-9,23.8,23.8,0,0,1,5.1-7.5,24.9,24.9,0,0,1,7.7-5.2A24.6,24.6,0,0,1,69.8,24a23.4,23.4,0,0,1,8.6,1.6,22.3,22.3,0,0,1,7.5,4.6,23.7,23.7,0,0,1,5.3,7.5,25.4,25.4,0,0,1,2,10.2A24.6,24.6,0,0,1,91.3,57.8ZM87,40.7a19.8,19.8,0,0,0-9.9-10.9,17.8,17.8,0,0,0-7.8-1.6,17.7,17.7,0,0,0-7.7,1.6,18.9,18.9,0,0,0-6,4.5,19.2,19.2,0,0,0-4,6.4,20.3,20.3,0,0,0-1.5,7.7A19.8,19.8,0,0,0,51.6,56,19.3,19.3,0,0,0,61.8,66.8a18.3,18.3,0,0,0,15.4,0,18.6,18.6,0,0,0,6-4.4A18.1,18.1,0,0,0,87.1,56a21.7,21.7,0,0,0,1.3-7.6A22.3,22.3,0,0,0,87,40.7Z"/>
					<path class="hundreds"  d="M152.8,57.8a24.1,24.1,0,0,1-5.2,7.9,21,21,0,0,1-7.5,5,23.3,23.3,0,0,1-9,1.8,27.7,27.7,0,0,1-8.2-1.4,21.8,21.8,0,0,1-7.8-4.4,22.4,22.4,0,0,1-5.9-7.8,24.5,24.5,0,0,1-2.3-11.3,23,23,0,0,1,1.8-9,25.2,25.2,0,0,1,5-7.5,26.6,26.6,0,0,1,7.8-5.2,24.6,24.6,0,0,1,9.9-1.9,23.4,23.4,0,0,1,8.6,1.6,22.3,22.3,0,0,1,7.5,4.6,25.4,25.4,0,0,1,5.3,7.5,25.4,25.4,0,0,1,2,10.2A24.7,24.7,0,0,1,152.8,57.8Zm-4.2-17.1a22.9,22.9,0,0,0-3.9-6.4,18.9,18.9,0,0,0-6-4.5,18.5,18.5,0,0,0-7.8-1.6,17.7,17.7,0,0,0-7.7,1.6,18.3,18.3,0,0,0-6.1,4.5,21,21,0,0,0-4,6.4,22.3,22.3,0,0,0-1.4,7.7,21.8,21.8,0,0,0,1.4,7.6,18.5,18.5,0,0,0,4.1,6.4,19,19,0,0,0,6.1,4.4,18.5,18.5,0,0,0,7.8,1.7,18.1,18.1,0,0,0,7.7-1.7,18.6,18.6,0,0,0,6-4.4,19.4,19.4,0,0,0,3.8-6.4,21.8,21.8,0,0,0,1.4-7.6A22.3,22.3,0,0,0,148.6,40.7Z"/>
					<path class="thousands"  d="M214.4,57.8a24.1,24.1,0,0,1-5.2,7.9,21.4,21.4,0,0,1-7.6,5,22.6,22.6,0,0,1-9,1.8,26.5,26.5,0,0,1-8.1-1.4,22.2,22.2,0,0,1-7.9-4.4,23.6,23.6,0,0,1-5.9-7.8,25.9,25.9,0,0,1-2.3-11.3,23,23,0,0,1,1.8-9,23.8,23.8,0,0,1,5.1-7.5,26.1,26.1,0,0,1,7.7-5.2,24.6,24.6,0,0,1,9.9-1.9,23,23,0,0,1,8.6,1.6,22.3,22.3,0,0,1,7.5,4.6,23.4,23.4,0,0,1,7.3,17.7A24.6,24.6,0,0,1,214.4,57.8Zm-4.3-17.1a19,19,0,0,0-3.9-6.4,16.9,16.9,0,0,0-6-4.5,19.6,19.6,0,0,0-15.5,0,18.9,18.9,0,0,0-6,4.5,21,21,0,0,0-4,6.4,20.3,20.3,0,0,0-1.5,7.7,21.1,21.1,0,0,0,5.5,14,19.5,19.5,0,0,0,6.2,4.4,18.1,18.1,0,0,0,7.7,1.7,17.7,17.7,0,0,0,7.7-1.7,16.7,16.7,0,0,0,6-4.4,18.1,18.1,0,0,0,3.9-6.4,21.7,21.7,0,0,0,1.3-7.6A20.2,20.2,0,0,0,210.1,40.7Z"/>
					</g>
					<g id="grp3">
					<path class="ones"  d="M15.7,48.6l-.3-28.3c-.1-3.3-.4-5.5-1-6.7S12.6,12,10.7,12l-2.8.2-2.8.3c-2.6,0-3.8-1.2-3.8-3.4S2.5,5.6,4.9,5.6l3.6.3a31.3,31.3,0,0,0,3.9.2,39.5,39.5,0,0,0,5.2-.2l3.7-.3c1.4,0,2.3.5,2.6,1.3a7.4,7.4,0,0,1,.4,3c0,.2,0,1-.1,2.4-.3,6.9-.5,13.2-.5,18.9v11c0,2,0,4.7.1,8.1s.2,6.8.2,8.1c.1,4.5,1.6,6.8,4.5,6.8l3.2-.3,3.2-.2c3.1,0,4.7,1.1,4.7,3.4s-1.4,3.4-4.3,3.4l-3.1-.2a109.1,109.1,0,0,0-12.5-1.1A90.1,90.1,0,0,0,9.2,71l-5,.5C1.4,71.5,0,70.3,0,68s1.6-3.3,4.8-3.3a15.3,15.3,0,0,1,3,.3l2.9.2q3.5,0,4.2-2.7C15.4,60.7,15.7,56.1,15.7,48.6Z"/>
					<path class="tens"  d="M68.9,72.5c-8.5,0-15.2-3.1-20-9.4s-7.2-14.8-7.2-25.7S44.2,17.5,49.2,11,61.1,1.4,69.9,1.4s14.9,3.1,19.7,9.2,7.3,14.5,7.3,25.1-2.5,20.4-7.5,26.9S77.5,72.5,68.9,72.5ZM70.1,8.8C57.8,8.8,51.4,17.9,51,36.3v1.5c0,8.7,1.6,15.5,4.8,20.2a15.4,15.4,0,0,0,13.6,7.2q9,0,14.1-7.8c3.4-5.2,5.1-12.4,5.1-21.5S87,20.4,83.8,15.8,76,8.8,70.1,8.8Z"/>
					<path class="hundreds"  d="M130.4,72.5c-8.4,0-15.1-3.1-19.9-9.4s-7.3-14.8-7.3-25.7,2.5-19.9,7.6-26.4,11.9-9.6,20.6-9.6,14.9,3.1,19.8,9.2,7.2,14.5,7.2,25.1-2.5,20.4-7.5,26.9S139.1,72.5,130.4,72.5Zm.5-63.7c-12.2,0-18.6,9.1-19.1,27.5v1.5c0,8.7,1.6,15.5,4.8,20.2a15.5,15.5,0,0,0,13.6,7.2q9,0,14.1-7.8c3.4-5.2,5.1-12.4,5.1-21.5s-1.6-15.5-4.8-20.1S136.9,8.8,130.9,8.8Z"/>
					<path class="thousands"  d="M192,72.5c-8.5,0-15.1-3.1-20-9.4s-7.2-14.8-7.2-25.7,2.5-19.9,7.5-26.4,12-9.6,20.7-9.6,14.9,3.1,19.7,9.2S220,25.1,220,35.7s-2.5,20.4-7.5,26.9S200.7,72.5,192,72.5Zm.8-63.7c-12.3,0-18.6,9.1-19.1,27.5v1.5c0,8.7,1.6,15.5,4.8,20.2a15.4,15.4,0,0,0,13.6,7.2q9,0,14.1-7.8c3.4-5.2,5.1-12.4,5.1-21.5s-1.6-15.5-4.8-20.1S198.7,8.8,192.8,8.8Z"/>
					</g>
					<g id="grp2">
					<path class="ones" d="M35,70.4c0,.6-.8.9-2.2,1.1H8.3C6.8,71.3,6,71,6,70.4s.4-.9,1.4-.9h4.7q3-.2,3.3-1.5a40.7,40.7,0,0,0,.3-6.3V14.7a22.7,22.7,0,0,0-.2-3.8q-.3-.6-1.5-.6l-6.5.5H5.9c-.8,0-1.2-.2-1.2-.7s.4-.8,1.1-.9a28.6,28.6,0,0,0,9.5-2.8A27.4,27.4,0,0,0,23,.9,3.1,3.1,0,0,1,24.5,0c.5,0,.8.3,1.2,1V64.5c-.4,2.4-.3,3.8-.1,4.2s1.1.6,2.5.8h5.5C34.5,69.4,35,69.7,35,70.4Z"/>
					<path class="tens"  d="M92.4,37.8a54.7,54.7,0,0,1-2.6,16.8,34,34,0,0,1-7.3,12.7A16.5,16.5,0,0,1,70,72.5q-10.3,0-17.1-10.2c-4.5-6.8-6.8-15.5-6.8-26.1,0-12.3,3.2-22,9.5-29A18,18,0,0,1,69.6.8c6.5,0,11.8,2.9,15.6,8.9S92.4,26.4,92.4,37.8ZM81.6,34.2q0-15-3.3-24.6c-1.7-5-4.6-7.4-8.8-7.4-8.4,0-12.6,11.1-12.6,33.5s4.5,35.1,13.3,35.1c4.2,0,7.1-3.4,8.9-10.2S81.6,45.6,81.6,34.2Z"/>
					<path class="hundreds"  d="M154,37.8a51.9,51.9,0,0,1-2.7,16.8,33.8,33.8,0,0,1-7.2,12.7,16.8,16.8,0,0,1-12.5,5.2c-7,0-12.7-3.4-17.2-10.2s-6.7-15.5-6.7-26.1c0-12.3,3.1-22,9.5-29a17.8,17.8,0,0,1,14-6.4c6.5,0,11.7,2.9,15.6,8.9S154,26.4,154,37.8Zm-10.8-3.6q0-15-3.3-24.6c-1.7-5-4.6-7.4-8.8-7.4-8.4,0-12.6,11.1-12.6,33.5s4.4,35.1,13.3,35.1c4.1,0,7.1-3.4,8.9-10.2S143.2,45.6,143.2,34.2Z"/>
					<path class="thousands"  d="M215.5,37.8a51.8,51.8,0,0,1-2.6,16.8,34,34,0,0,1-7.3,12.7,16.5,16.5,0,0,1-12.5,5.2q-10.3,0-17.1-10.2c-4.5-6.8-6.8-15.5-6.8-26.1,0-12.3,3.2-22,9.5-29a18,18,0,0,1,14-6.4c6.6,0,11.8,2.9,15.6,8.9S215.5,26.4,215.5,37.8Zm-10.8-3.6q0-15-3.3-24.6c-1.6-5-4.6-7.4-8.8-7.4-8.4,0-12.6,11.1-12.6,33.5s4.5,35.1,13.3,35.1c4.2,0,7.1-3.4,8.9-10.2S204.7,45.6,204.7,34.2Z"/>
					</g>
				</symbol>

				<!-- 	The target paths -->
				<g id="trgGrp">
					<path class="ones"  d="M16.9,67.5l4.8-42.6c-3.4,2.3-6.1,4.1-8.3,5.4L8,33.4l-1.3.8.6-5c6.8-2.4,14.3-6.5,22.6-12.3L24.3,67.5H37.1l-5,4H2.5l5.1-4Z"/>
					<path class="tens"  d="M47.7,56.4q0-13.5,9.3-24.6c6.2-7.4,13-11.1,20.5-11.1a11.5,11.5,0,0,1,9.6,4.6c2.5,3.1,3.7,7.1,3.7,12.2,0,8.6-3.1,16.6-9.4,23.9S68.3,72.5,61,72.5a11.6,11.6,0,0,1-9.5-4.6A17.3,17.3,0,0,1,47.7,56.4ZM83.3,43.3c0-5.2-1.1-9.5-3.5-12.7a10.9,10.9,0,0,0-9.2-4.9c-4.2,0-7.9,2.4-10.9,7s-4.5,10.4-4.5,17,1.2,9.6,3.5,12.8a10.7,10.7,0,0,0,9.2,4.9c4.3,0,7.9-2.4,10.9-7S83.3,50,83.3,43.3Z"/>
					<path class="hundreds"  d="M109.3,56.4q0-13.5,9.3-24.6c6.2-7.4,13-11.1,20.5-11.1a11.5,11.5,0,0,1,9.6,4.6c2.4,3.1,3.7,7.1,3.7,12.2,0,8.6-3.2,16.6-9.4,23.9s-13.1,11.1-20.5,11.1a11.7,11.7,0,0,1-9.5-4.6C110.5,64.9,109.3,61.1,109.3,56.4Zm35.6-13.1c0-5.2-1.2-9.5-3.5-12.7a11,11,0,0,0-9.2-4.9c-4.3,0-7.9,2.4-10.9,7s-4.5,10.4-4.5,17,1.1,9.6,3.5,12.8a10.7,10.7,0,0,0,9.2,4.9c4.2,0,7.9-2.4,10.9-7S144.9,50,144.9,43.3Z"/>
					<path class="thousands"  d="M170.9,56.4c0-9,3.1-17.2,9.2-24.6s13.1-11.1,20.5-11.1a11.8,11.8,0,0,1,9.7,4.6c2.4,3.1,3.6,7.1,3.6,12.2,0,8.6-3.1,16.6-9.4,23.9s-13.1,11.1-20.4,11.1a11.7,11.7,0,0,1-9.5-4.6C172.1,64.9,170.9,61.1,170.9,56.4Zm35.6-13.1c0-5.2-1.2-9.5-3.6-12.7a10.9,10.9,0,0,0-9.1-4.9c-4.3,0-7.9,2.4-11,7s-4.5,10.4-4.5,17,1.2,9.6,3.5,12.8a10.7,10.7,0,0,0,9.2,4.9c4.3,0,7.9-2.4,10.9-7A31.2,31.2,0,0,0,206.5,43.3Z"/>
				</g>
			</svg>
			
		</article>
		
	</section>

	

	
	
	
	<section id="svgFilter">
		
		<article>
			
			<svg id="filter" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 72.5">
	
				<filter id="displacementFilter">

					<feTurbulence 
						type="turbulence"
						baseFrequency="0.05"
						numOctaves="2"
						type="turbulence"
						stitchTiles="stitch"
						result="turbulence"
						/>

					<feDisplacementMap 
						in2="turbulence"
						in="SourceGraphic"
						scale="5"
						xChannelSelector="R"
						yChannelSelector="G"
						/>

				</filter>

				<g filter="url(#displacementFilter)">
					<path class="ones" d="M22.2,14.7H22L10.7,20.8,9,14.1,23.2,6.5h7.5v65H22.2Z"/>
					<path class="tens" d="M91.3,38.2c0,22.1-8.2,34.3-22.6,34.3C56,72.5,47.4,60.6,47.2,39.1S56.6,5.3,69.8,5.3,91.3,17.5,91.3,38.2ZM56,39.2c0,16.9,5.2,26.5,13.2,26.5S82.5,55.2,82.5,38.6,78.4,12.1,69.3,12.1,56,21.5,56,39.2Z"/>
					<path class="hundreds" d="M152.9,38.2c0,22.1-8.2,34.3-22.6,34.3-12.7,0-21.3-11.9-21.5-33.4s9.4-33.8,22.6-33.8S152.9,17.5,152.9,38.2Zm-35.3,1c0,16.9,5.2,26.5,13.2,26.5s13.3-10.5,13.3-27.1S140,12.1,130.9,12.1,117.6,21.5,117.6,39.2Z"/>
					<path class="thousands" d="M214.4,38.2c0,22.1-8.2,34.3-22.6,34.3-12.7,0-21.3-11.9-21.5-33.4s9.4-33.8,22.6-33.8S214.4,17.5,214.4,38.2Zm-35.3,1c0,16.9,5.2,26.5,13.2,26.5s13.3-10.5,13.3-27.1-4.1-26.5-13.2-26.5S179.1,21.5,179.1,39.2Z"/>
				</g>
			</svg>
			
		</article>
	</section>

	
	
	
	
	<section id="physicsPlugin">
		
		<article>
			
			<div id="tmplt" class="exploding">
				<p>1000</p>
				<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/Explosion_Sequence_A1.png" />
			</div>
			
		</article>

	</section>

	
	
	
	
	<section id="canvas">
		
		<article>
			
			<canvas></canvas>
			
		</article>
	</section>

	
	
	
	


	
	
	<section id="threeJs">
	
		<article>


		</article>

	</section>

</main>
              
            
!

CSS

              
                /* TODO: Move all shared CSS into an external pen and use as a resource */
html, body {
	width: 100%;
	height: 100%;
	margin: 0;
}

body {
	display: flex;
	flex-direction: column;
	background-color: hsla(180, 10%, 90%, 1)
}



header {
	background-color: hsl(180, 10%, 80%);
	text-align: center;
}



main {
	flex-grow: 1;
/* 	background: green; */
	overflow: hidden;
	position: relative;
	cursor: pointer;
	visibility: hidden;
}



section {
	display: flex;
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0;
	top: 0;
/* 	background: hsla(0, 50%, 50%, 0.5); */
}

section > * {
	margin: auto;
	mouse-event: none;
}



article {
/* 	background: hsl(0, 100%, 50%); */
	text-align: center;
}

p {
	font-size: 25vmin;
}



svg {
	width: 80%;
	height: 80%;
	overflow: visible;
}





#dom p {
	font-family: sans-serif;
	text-shadow: 0px 0px 15px hsl(180, 15%, 25%);
	user-select: none;
	color: hsl(0, 100%, 50%);
}





#spriteSheet .sprite {
	overflow: hidden;
	position: relative;
	height: calc(67px * 3); /* Original size * multiplier */
	width: calc(152px * 3); /* Original size * multiplier */
}

#spriteSheet .sprite > img {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: auto;

/* 	https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering */
/* 	Although it seems the MDN docs is outdated as this works in FF, Chrome, Opera but not Safari */
	image-rendering: -webkit-optimize-contrast;
	image-rendering: pixelated; 
	
}




#svgMorph svg {
	fill: hsl(190, 80%, 30%);
	stroke: hsl(190, 80%, 15%);
}



#svgFilter svg {
	fill: hsl(320, 80%, 30%);
	stroke: hsl(320, 80%, 15%);
}



#physicsPlugin .exploding {
	position: relative;
	font-size: 5rem;
}

#physicsPlugin .exploding > img {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 200%;
	height: auto;
	transform: translate(-50%, -50%);
	z-index:-1;
	visibility:hidden;
}


#canvas canvas {
	background: hsl(0, 100%, 100%);
}



#threeJs > article {
	width: inherit;
	height: inherit;
}
              
            
!

JS

              
                var main = document.querySelector( 'main' )
var sections = main.querySelectorAll( 'section' )
var tweens = []
var currSection = 0
var nextSection = currSection + 1





var domTween = function() {

	var split = new SplitText('#dom p', {type:'chars'})
	var dur = 1

	TweenMax.set('#dom p', {
		yPercent:-12.5,
	})
	
	var _tl = new TimelineMax( { paused:true } )

	_tl.staggerTo(split.chars, dur*5, {
		color:'hsl(360, 100%, 50%)',
		repeat:-1,
		ease:Linear.easeNone
	}, dur*0.75, 0)

	_tl.staggerTo(split.chars, dur, {
		scaleY:0.5,
		yPercent:'+=25',
		repeat:-1,
		ease:Power1.easeInOut,
		yoyo:true
	}, dur*0.25, 0)


	return _tl
}()

tweens.push( domTween )





var spriteTween = function () {
	
	return TweenMax.to('.sprite > img', 1.5, {
		x:'-='+((152 * 3) * 8), // width * num of frames
		ease:SteppedEase.config(8),
		repeat:-1,
		paused:true
	})
	
}()

tweens.push( spriteTween )





var morphTween = function() {
	
	// Get all the decimal numbers in the visible group
	var trgPaths = document.querySelector( '#trgGrp' ).querySelectorAll( 'path' )
	
	var morphTl = new TimelineLite( { paused:true } )


	trgPaths.forEach( function( path ) {
		// for each decimal path found
		// make a timeline
		morphTl.add( morphTimeline( path ).timeScale( Math.random() + 0.1 ), 0 ) // with distorted time scale

	} )



	function morphTimeline( path ) {

		// Get all hidden paths of the same decimal
		var srcPaths = document.querySelector( 'symbol' ).querySelectorAll( '.' + path.getAttribute( 'class' ) )

		var _tl = new TimelineMax( {repeat:-1, yoyo:true} )

		srcPaths.forEach( function( srcPath ) {

			// Each tween is to have a random duration of at least 0.5 second
			_tl.to( path, Math.random() + 0.5, {
				morphSVG: srcPath,
				ease:Elastic.easeInOut
			} )

		} )

		// Jump the timeline to a random position
		_tl.progress( Math.random() )

		return _tl;
	}
	
	
	return morphTl;
	
}()

tweens.push( morphTween )





var filterTween = function() {
	return TweenMax.to('#svgFilter #displacementFilter > feTurbulence', 1, {
		attr:{
			baseFrequency:Math.sin( Math.PI )
		},
		repeat:-1,
		ease:Linear.easeNone,
		paused:true
	})
}()

tweens.push( filterTween )





var physicsTween = function() {
	
	var tmplt = document.querySelector( '#tmplt' )
	var path = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/Explosion_Sequence_A'

	// Load and insert image sequence for explosion
	for(var i = 2; i <= 16; i++) {

		var img = new Image()

		img.src = path + i + '.png'

		tmplt.appendChild( img )

	}

	// This function creates a timeline that will create a copy of itself when completed
	function jump( el, _dur ) {
		
		// This time we don't return the tween
		// We want this particular tween to
		// always override the previous one
		// in order to have new velocity and angle
		// every time it plays
		TweenLite.to( el, _dur, {
			physics2D:{
				velocity:Math.random() * 400 + 150, 
				angle:Math.random() * 40 + 250, 
				gravity:500
			}
		} )

	}


	var hold = 1
	
	var _tl = new TimelineMax( { 
			paused:true,
			repeat:-1,
		} )
		

	_tl.addCallback(jump, "+=0", [ '#tmplt', hold])

	_tl.set( '#tmplt > p', { autoAlpha:0 }, "+="+hold )

	_tl.add(TweenMax.staggerFromTo( '.exploding > img', 0.016, {
		autoAlpha:0
	}, {
		autoAlpha:1,
		repeat:1,
		yoyo:true
	}, 0.024) )

	_tl.set( ['#tmplt', '#tmplt > p'], { clearProps:'all' } )
	_tl.set( '#tmplt > p', { autoAlpha:1 } )
	
	
	return _tl;
	
}()

tweens.push( physicsTween )





var canvasTween = function() {
	var num = 500
	var canvas = document.querySelector('#canvas canvas')
	canvas.width = num
	canvas.height = num
	canvas.style.width = num/2 + 'px'
	canvas.style.height = num/2 + 'px' 

	var ctx = canvas.getContext('2d')

	function draw( radian, degrees ) {

		// Draw a semi transparent background
		ctx.fillStyle = 'rgba(255,255,255,0.05)'
		ctx.fillRect(0, 0, num, num)
		// Store the white background
		ctx.save()


		// Move the origin the center of the canvas
		ctx.translate( num/2, num/2 )
		// rotate it
		ctx.rotate( radian )
		// Move it back to its starting position
		ctx.translate( -num/2, -num/2 )

		// Draw the number
		ctx.fillStyle = 'hsla(' + degrees + ', 80%, 50%, 0.55)'
		ctx.font = num/3 + 'px sans-serif'
		ctx.textBaseline = 'middle'
		ctx.textAlign = 'center'
		ctx.fillText('1000', num/2, num/2)

		// Restore the white background
		ctx.restore()

	}


	return TweenMax.fromTo({}, 2.5, {
		rotation:0
	}, {
		rotation:1080,
		modifiers: {
			rotation: function( rotation ) {

			var angle = ( Math.PI / 180 ) * rotation 

			draw( angle, rotation )

			}
		},
		ease:Power4.easeInOut,
		repeat:-1,
		paused:true
	});
}()

tweens.push( canvasTween )





var threeTween = function() {
	
	var scene, camera, renderer, txt
	var cameraCube, sceneCube
	var holder = document.querySelector( '#threeJs article' )
	var holderRect = holder.getBoundingClientRect()
	
	scene = new THREE.Scene()


    camera = new THREE.PerspectiveCamera( 45, holderRect.width / holderRect.height, 0.1, 1000 ) // TODO Make this take the parent's width height

    camera.position.z = 5
	camera.position.y = 0.25
	

    var devicePixelRatio = window.devicePixelRatio || 1

    renderer = new THREE.WebGLRenderer( {alpha:true } )
    renderer.setSize( holderRect.width, holderRect.height )
    renderer.setPixelRatio( devicePixelRatio )

    holder.appendChild( renderer.domElement )
	
	
	var ambient = new THREE.AmbientLight( 0xffffff );
	scene.add( ambient );
	
	var path = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/'
	var format = '.jpg'
	var urls = [
		path + 'ny' + format,
		path + 'nx' + format,
		path + 'nz' + format,
		path + 'ny' + format,
		path + 'nx' + format,
		path + 'nz' + format,
	]
	
	var matLoader = new THREE.CubeTextureLoader()
	matLoader.crossOrigin = ''
	reflectionCube = matLoader.load( urls )
	
	
	var material = new THREE.MeshLambertMaterial({ color: 0xdddddd, envMap: reflectionCube })
	
		
    
	var loader = new THREE.ColladaLoader()
	loader.load( 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/text3D1000.dae', function( collada ) {
				
		// Override the collada material
		var mesh = collada.scene.children[0].children[0]
		mesh.material = material
		
		scene.add( collada.scene )
		
		// Whenever we are done loading, we replace the tween
		var tween = TweenMax.to( mesh.rotation, 4, {
			x: ( Math.PI / 180 ) * 360,
			onUpdate:function() {
				renderer.render(scene, camera)
			},
			ease:Elastic.easeInOut,
			repeat:-1,
			repeatDelay:0.5,
			paused:true
		})
		
		
		tweens.push( tween )
		
		// render it once just to have something to show right at the start
		renderer.render( scene, camera )
				
	})
	
	
	
}()






function pauseTween( tween, curr ) {
		
	tween.pause()
	
}


function playTween( tween ) {
		
	tween.play()
	
	main.addEventListener( 'click', onClick, true )

}





function onClick( e ) {
		
	main.removeEventListener( 'click', onClick, true )
	
	var _dur = 0.5

	TweenMax.to( sections[currSection], _dur, {
		yPercent:-100,
		onStart:pauseTween,
		onStartParams:[ tweens[currSection], currSection ],
		ease:Power2.easeIn
	})
	
	
	
	TweenMax.fromTo( sections[nextSection], _dur, {
		yPercent:100
	}, {
		yPercent:0,
		onComplete:playTween,
		onCompleteParams:[ tweens[nextSection] ],
		ease:Back.easeOut.config(0.75),
		delay:_dur*0.8
	})
	
	
	
	currSection++
	if(currSection === sections.length) currSection = 0
	
	nextSection++
	if(nextSection === sections.length) nextSection = 0
	
}





// wait until DOM is ready
document.addEventListener("DOMContentLoaded", function(event) {

	// wait until window, stylesheets, images, links, and other media assets are loaded
	window.onload = function() {
		
		
		// Move all but the first section out of view
		TweenMax.set( 'section', {
			yPercent:function(i) {
				return i === 0 ? 0 : 100
			}
		})
		
		// Show the elements 
		TweenMax.to('main', 0.3, {autoAlpha:1})

		
		// Start
		playTween( tweens[0] )
		

	}

})
              
            
!
999px

Console