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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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/logo-nested-timelines.png" 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/logo-nested-timelines.png" 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/logo-nested-timelines.png" 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;
}

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

            
          
!
            
              var panel1 = new TimelineLite();
panel1.from(".panel1 .bg", 0.4, {scale:0, ease:Power1.easeInOut})
  .from(".panel1 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, 0)
  .staggerFrom(".panel1 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out", "+=1")
	.staggerTo(".panel1 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out")
  .to(".panel1 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut})

var panel2 = new TimelineLite();
panel2.from(".panel2 .bg", 0.4, {scale:0, ease:Power1.easeInOut})
  .from(".panel2 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, 0)
  .staggerFrom(".panel2 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out", "+=1")
	.staggerTo(".panel2 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out")
  .to(".panel2 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut})

var panel3 = new TimelineLite();
panel3.from(".panel3 .bg", 0.4, {scale:0, ease:Power1.easeInOut})
  .from(".panel3 .bg", 0.3, {rotation:90, ease:Power1.easeInOut}, 0)
  .staggerFrom(".panel3 .text span", 1.1, {y:-50, opacity:0, ease:Elastic.easeOut}, 0.06)
  .addLabel("out", "+=1")
  .staggerTo(".panel3 .text span", 0.3, {opacity:0, y:50, ease:Power1.easeIn}, -0.06, "out")
  .to(".panel3 .bg", 0.4, {scale:0, rotation:-90, ease:Power1.easeInOut})


var master = new TimelineMax();
master.add(panel1)
  .add(panel2)
  .add(panel3);


//make smaller for when demo is embedded
TweenLite.set(".banner", {scale:0.8, transformOrigin:"left top"});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console