Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

              
                <link href='https://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'>

<div class="mixTxt"><h2>MIX AND MERGE.</h2></div>


  
  
  
  
  
  
  
  
  
              
            
!

CSS

              
                body{
  font-family: 'Asap', Arial, Helvetica, sans-serif;
  color:white;
  background:black url(https://s.cdpn.io/16327/texture_bg.jpg) no-repeat 50% 0px;
  margin:20%;
  overflow:hidden;
}

.mixText{
  -webkit-transform: translate3d(0, 0, 0);
  font-size:44px;
  line-height:50px;
  color:#dedede;
}

.mixText div{
  -webkit-font-smoothing: antialiased;
	-moz-font-smoothing:antialiased;
}

              
            
!

JS

              
                //some helper functions
function randomNumber(min, max){
	return Math.floor(Math.random() * (1 + max - min) + min);
}





//SETUP FOR SPLIT TEXT
mySplitText = new SplitText(".mixTxt h2", {type:"words,chars"}), 
    chars = mySplitText.chars; 

numChars = mySplitText.chars.length
TweenLite.set(".mixTxt h2", {perspective:900})

var approachTL = new TimelineMax({repeat:-1}) 
//set all elements opacity to zero
approachTL.staggerFrom(chars, 0.8, {opacity:0, scale:0, y:70, x:0, rotationX:180, ease:Back.easeOut}, 0.01, "-=.77")
		//add explode label .5 second after TEXT animation is done
		.add("explode", "+=.5")

//ADD EXPLODE EFFECT FOR "MIX AND MERGE"
for(var i = 0; i < numChars; i++){
  approachTL.to(mySplitText.chars[i], 1.75, {z:randomNumber(-1500, 2500), x:randomNumber(-280, 280), y:randomNumber(-240, 240), opacity:0, rotation:randomNumber(360, 720), rotationX:randomNumber(-60, 60), rotationY:randomNumber(-60, 60)}, "explode+=" + Math.random()*0.3);
}






              
            
!
999px

Console