cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <link href="https://fonts.googleapis.com/css?family=Signika+Negative:300,400,600" rel="stylesheet">
<div class="banner">
			<div class="panel panel1">
				<div class="bg" style="background:#e644dc;"></div>
        <div class="text">
          <span>Code</span> <span>animations</span><br>
				  <span>like</span> <span>a</span> <span>pro</span>
        </div>
				<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/greensock-man-logo.svg" class="logo"/>
			</div>
			<div class="panel panel2">
				<div class="bg" style="background:#4471e6;"></div>
        <div class="text">
          <span>Craft</span> <span>readable,</span><br>
				  <span>efficient</span> <span>code</span>
        </div>
				<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/greensock-man-logo.svg" class="logo"/>
			</div>
			<div class="panel panel3">
				<div class="bg" style="background:#666;"></div>
        <div class="text">
				  <span>Animate</span> <span>smart.</span><br>
				  <span class="gsap">GSAP</span>
        </div>
				<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/greensock-man-logo.svg" class="logo"/>
			</div>
		</div>
            
          
!
            
              body {
  background: #ddd;
  font-family: 'Signika Negative', sans-serif;
}

.banner {
  position: relative;
  white-space:nowrap;
}

.panel {
  width: 300px;
  height: 250px;
  display: inline-block;
  background: black;
  position: relative;
  overflow:hidden;
}

.bg {
  position: absolute;
  width: 300px;
  height: 178px;
  background-color: #e644dc;
}

.logo {
  position: absolute;
  left: 105px;
  top: 147px;
  widtH:78px;
}

.text {
  position: absolute;
  font-size: 32px;
  text-align: center;
  width: 300px;
  top: 50px;
  color: white;
  font-weight: 300;
  text-shadow: 2px 2px rgba(0, 0, 0, 0.3);
}

.text span {
  display: inline-block;
}

.gsap {
  color: #87ce02;
  font-weight: 700;
  font-size: 36px;
}

            
          
!
            
              //even though this is a relatively simplistic example, the code can still be overwhelming.

var tl = new TimelineMax();
tl.from(".panel1 .bg", 0.4, {scale:0, ease:Power1.easeInOut}, "in1")
  .from(".panel1 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, "in1")
  .staggerFrom(".panel1 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out1", "+=1")
	.staggerTo(".panel1 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out1")
  .to(".panel1 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut})
  .from(".panel2 .bg", 0.4, {scale:0, ease:Power1.easeInOut}, "in2")
  .from(".panel2 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, "in2")
  .staggerFrom(".panel2 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out2", "+=1")
	.staggerTo(".panel2 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out2")
  .to(".panel2 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut})
  .from(".panel3 .bg", 0.4, {scale:0, ease:Power1.easeInOut}, "in3")
  .from(".panel3 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, "in3")
  .staggerFrom(".panel3 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out3", "+=1")
  .staggerTo(".panel3 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out3")
  .to(".panel3 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut}); 

//good
//tl.play("in3");
//tl.timeScale(3).repeat(2);


//make smaller for when demo is embedded
TweenLite.set(".banner", {scale:0.8, transformOrigin:"left top"});
            
          
!
999px
Loading ..................

Console