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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
//has to be placed after jQuery initialization, or after php wp_head()
var $startAnim = $("#start-anim");
var $exitAnim = $("#exit-anim");
var $demoText = $("#gsap-anim-text-1");
var $postTitleText = $("#post-title-text");
$demoText.html ( $demoText.html().replace(/./g, "<span>$&</span>").replace(/\s/g, "&nbsp;"));
$postTitleText.html( $postTitleText.html().replace(/./g, "<span>$&</span>").replace(/\s/g, "&nbsp;"));
$startAnim.on("click", startAnimation);
$exitAnim.on("click", startAnimation2);
function startAnimation(){
TweenLite.set($startAnim, {autoAlpha:0});
TweenMax.staggerFromTo( $demoText.find("span"), 0.09, {autoAlpha:0, scale:2}, {autoAlpha:1, scale:1}, 0.01, reset );
TweenMax.staggerFromTo( $postTitleText.find("span"), 0.4, {autoAlpha:0, rotationX:-90, top:"-30px"}, {autoAlpha:1, rotationX:0, top:"0px"}, 0.1, reset );}
function startAnimation2(){
TweenLite.set($startAnim, {autoAlpha:0});
TweenMax.staggerFromTo( $demoText.find("span"), 0.09, {autoAlpha:1, scale:1}, {autoAlpha:0, scale:2}, 0.01, reset2);
TweenMax.staggerFromTo( $postTitleText.find("span"), 0.4, {autoAlpha:1, rotationX:0, top:"0px"}, {autoAlpha:0, rotationX:-90, top:"-30px"}, 0.1, reset2 );}
function reset(){$startAnim, 1, {autoAlpha:1});}
function reset2(){$demoText, 1, {autoAlpha:0});$postTitleText, 1, {autoAlpha:0});}
<div class="gsap-anim-button" id="start-anim">Start animation</div>
<div class="gsap-anim-button" id="exit-anim">Exit animation</div>
<div id="gsap-anim-text-1">Wow, TweenMax can tween scale!</div>
<div id="post-title-text">It can even drop down!</div>


                /* GSAP css injections

	CSS Reset
html,body,div,span,applet,object,iframe,audio,video,h1,h2,h3,h4,h5,h6,h7,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark {
	vertical-align: baseline;

.gsap-anim-button { /* has to be class="gsap-anim-button", in the same div with id="start-anim" and/or id="exit-anim" */
	position:relative;      /* !important */
	display:inline-block;   /* !important */
	cursor:pointer;        /* !important */
  border: 1px solid black;

#start-anim, #exit-anim { /* has to be in the same div with class="gsap-anim-button" */
	position: inherit;
#gsap-anim-text-1, #post-title-text {
    position: relative;

#gsap-anim-text-1 span { /* !important for gsap, has to be in <div> with relative position */
	position: relative;
#post-title-text span { /* !important for gsap, has to be in <div> with relative position */
	position: relative;