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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

  h3 Nested Timelines

  //ghost's parts
  //pacman's parts  
              body {
  background-color: tan;
  margin: 0;
  padding: 0;

.wrapper {
  padding: 80px 80px;
  width: 50%;
  height: 30px;
  margin: 20px auto;
  background-color: black;
  border-radius: 10px;
  border-top: brown solid 17px;
  position: relative;

h3 {
  color: white;
  font-family: courier;
  letter-spacing: 1px;
  position: absolute;
  top: -38px;
  left: 10px;

/* all of the ghost's parts */
  background-color: red;
  height: 70px;
  width: 90px;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  padding-top: 30px;
  position: relative;
  bottom: 25px;
  left: 30px;
  margin: 0 auto;

.eye {
  background-color: white;
  height: 30px;
  width: 30px;
  position: relative;
  margin: 0 auto;
  border-radius: 50%;
  display: inline-block;

.pupil {
  background-color: black;
  height: 10px;
  width: 10px;
  top: 11px;
  position: relative;
  margin: 0 auto;
  border-radius: 50%;

  width: 100%;

.bottom1, .bottom2, .bottom3{
  background-color: red;
  width: 31.2px;
  height: 30px;
  border-radius: 50%;
  position: relative;
  top: 20px;
  left: -1px;
  display: inline-block;
  margin: 0 -1px;
  float: right;

/* all of pacman's parts */
.pacmantop {
   border-radius: 90px 90px 0 0;
   background: yellow;

.pacmanbottom {
   height: 65px;
   width: 120px;
   border-radius: 0 0 90px 90px;
   background: yellow;
   position: relative;
  bottom: 11px;

.pacman {
    margin: 0 auto;
    position: relative;
    bottom: 135px;

              // example of nested timelines

// ghost animations:
var look = new TimelineMax({repeat:1, repeatDelay:0});
look.to(".pupil", 1, {x:-10, y: 0})
  .to(".pupil", 0.5, {x:0, y:0});

var blink = new TimelineMax({repeat:1, repeatDelay:0});
blink.to(".eye", 0.1, {opacity: 0})
  .to(".eye", 0.1, {opacity: 1});

var mvRight = new TimelineMax();
mvRight.to(".ghost", 2, {x:60, y: 0});

// ghost's master timeline
var ghostAnimate = new TimelineMax();
  .add(mvRight, 0.8)

// pacman animations:
var topJaw = new TimelineMax();
  topJaw.to(".pacmantop", 0.1, {rotation:-40});
var bottomJaw = new TimelineMax();
  bottomJaw.to(".pacmanbottom", 0.1, {rotation:40});

// pacman's master timeline
var pacmanAnimate = new TimelineMax({repeat:15, repeatDelay:0});
  pacmanAnimate.add(topJaw, 0.1)
   .add(bottomJaw, 0.1);

// Master Timeline:
var scene1 = new TimelineMax({repeat:1, repeatDelay:1});
.add(ghostAnimate, 0.5);
Loading ..................