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

              
                <div id="demoWrapper">
  <div id="bg"></div>
  <div id="slides">
    <div class="slide" id="robust">
      <h1>Freakishly Robust</h1>
      <h2>With features that makes other engines look like cheap toys</h2>
      <div class="info">
        <div class="feature"><img src="https://www.greensock.com/_img/codepen/feature_robust.png" width="240" height="151"></div>
        <p class="description">Animate colors, beziers, css properties, arrays, scrolls and lots more. Round values, smoothly reverse() on the fly, use relative values, employ virtually any easing equation, and manage conflicting tweens like a pro. GSAP does all this and much more with ease.</p>
      </div>
    </div>
    <div class="slide" id="overwrite">
      <h1>Overwrite Manager</h1>
      <h2>Control how (and if and when) tweens get overwritten</h2>
      <div class="info">
        <div class="feature"><img src="https://www.greensock.com/_img/codepen/feature_overwrite.png" width="152" height="171"></div>
        <p class="description">OverwriteManager resolves conflicts between tweens and controls if (and how) existing tweens of the same target are overwritten. Think of it as a referee or traffic cop for tweens.</p>
      </div>
    </div>
    <div class="slide" id="compatible">
      <h1>Compatibility</h1>
      <h2>GSAP integrates seamleassly with your favorite tech</h2>
      <div class="info">
        <div class="feature"><img src="https://www.greensock.com/_img/codepen/feature_compatible.png" width="222" height="184"></div>
        <p class="description">HTML5, jQuery, Canvas, CSS, new browsers, old browsers, RequireJS, EaselJS, mobile, and more – GSAP gets along with them famously. Use your favorite tools without jumping through endless hoops to ensure compatibility.</p>
      </div>
    </div>
    <div class="slide" id="support">
      <h1>Dedicated Support</h1>
      <h2>Everybody needs a little help sometimes</h2>
      <div class="info">
        <div class="feature"><img src="https://www.greensock.com/_img/codepen/feature_suport.png" width="234" height="149"></div>
        <p class="description">We’ve got your back. When deadlines are looming and you can’t figure something out, hop over to our forums to get your GreenSock-related questions answered promptly. Our paid staff and community experts are eager to assist you.</p>
      </div>
    </div>
    <div class="slide" id="plugins">
      <h1>Plugins</h1>
      <h2>Load only the tools you need</h2>
      <div class="info">
        <div class="feature"><img src="https://www.greensock.com/_img/codepen/feature_plugin.png" width="237" height="150"></div>
        <p class="description">GSAP's plugin architecture keeps the core engine tight while allowing virtually any feature to be added via optional plugins. The entire platform was designed to be modular, flexible, and ultra-efficient.</p>
      </div>
    </div>
  </div>
  <div id="nav"> <img src="https://www.greensock.com/_img/codepen/icon_robust.png" width="83" height="59" id="icon_robust"><img src="https://www.greensock.com/_img/codepen/icon_overwrite.png" width="43" height="59" id="icon_overwrite"><img src="https://www.greensock.com/_img/codepen/icon_compatible.png" width="73" height="59" id="icon_compatible"><img src="https://www.greensock.com/_img/codepen/icon_support.png" width="83" height="59"><img src="https://www.greensock.com/_img/codepen/icon_plugin.png" width="76" height="59"> </div>
</div>


              
            
!

CSS

              
                body, h1, h2, h3, p {
	font-family: Arial, Helvetica, sans-serif;
	margin: 0;
	color: #fff;
}
body { background-color:#000;}
h1 {
	position: relative;
	margin-top: 10px;
	font-size: 36px;
	font-weight: normal;
}
h2 {
	position: relative;
	font-size: 21px;
	font-weight: normal;
	color: #cfcfcf;
}
#demoWrapper {
	width: 600px;
	height: 350px;
	-webkit-font-smoothing: antialiased;
	color: black;
	overflow: hidden;
}
#bg {
	position: absolute;
	background-image: url(https://www.greensock.com/_img/codepen/black_textured_background.png);
	width: 600px;
	height: 350px;
}
.slide {
	position: absolute;
	padding-left: 15px;
	visibility: hidden;
}
.info {
	margin-top: 20px;
	height: 300px;
	overflow: hidden;
}
.feature {
	position: relative;
	float: left;
	width: 240px;
	text-align: center;
}
.description {
	position: relative;
	float: left;
	margin-left: 20px;
	width: 290px;
	font-size: 16px;
	line-height: 24px;
}
#nav {
	position: absolute;
	top: 285px;
	left: 140px;
	white-space: nowrap;
}
#nav img {
	position: relative;
	margin-right: 20px;
	float: left;
	cursor: pointer;
}
              
            
!

JS

              
                var currentSection,
	    currentSectionNum;
		
function initNav() {
  $("#nav img").each(function(index, element) {
    $(this).on("click", gotoSection);
    $(this).on("mouseenter", function(){TweenLite.to(element, 0.2, {scale:1.2, ease:Back.easeOut})});
    $(this).on("mouseleave", function(){TweenLite.to(element, 0.2, {scale:1})});
  });
}
	
function gotoSection(e) {
  if(currentSectionNum != $(e.currentTarget).index()){
			if(currentSection) {
				TweenLite.to(currentSection, 0.5, {rotationX:-90, transformOrigin:"50% 50% -200", autoAlpha:0});
			}
			currentSectionNum = $(e.currentTarget).index();
			currentSection = $(".slide")[currentSectionNum];
			TweenLite.to(currentSection, 0.2, {autoAlpha:1});
			TweenMax.fromTo(currentSection, 0.5, {rotationX:90}, {rotationX:0, transformOrigin:"50% 50% -200"});
  }
}		
		
function init(){
  initNav();
  $("#nav img")[0].click();
  TweenMax.staggerFrom("#nav img", 0.2, {autoAlpha:0, scale:0.5, delay:0.6}, 0.1);    
  TweenLite.set("#slides", {perspective:800});
}		
	
init();
          
              
            
!
999px

Console