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.

            
              <div id="wrapper">
  <div id="plants"></div>
  <!-- FLYING ZOMBIES <div id="balloon"></div>-->
  <div id="clouds"></div>
  <div id="ground"></div>
  <div id="fence"></div>
  <div id="graveyard"></div>
  <div id="trees"></div>
  <div id="moon"></div>
</div>
<div><p class="credits"><span class="stars">&#10026;</span>A pen by <a href="https://twitter.com/lukeslytalker" target="_blank">Nate Balcom</a> more <a href="https://codepen.io/nbalcom/pens/public/" target="_blank">pens here</a><span class="stars">&#10026;</span></p></div>
            
          
!
            
              @import url("https://fonts.googleapis.com/css?family=Crushed");
html {
  height: 100%;
  background: #000;
}

body {
  margin: 0;
  padding: 0;
  background: #000;
  height: 100%;
}

#wrapper {
  position: relative;
  width: 100%;
  height: 376px;
}

#clouds {
  background: url("https://s25.postimg.org/6je6q7vvz/cloudz.png") repeat-x 0 bottom;
  width: 100%;
  height: 195x;
  /*190px*/
  min-height: 195px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
}

#trees {
  background: url("https://s25.postimg.org/iubqo17an/treez.png") repeat-x 0 bottom;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
}

#ground {
  background: url("https://s25.postimg.org/9xil14n5b/zombiez2.png") repeat-x 0 0 transparent;
  position: absolute;
  bottom: 5px;
  left: 0;
  z-index: 3;
  width: 100%;
  height: 190px;
  min-height: 190px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
  overflow: hidden;
}

#fence {
  background: url("https://s25.postimg.org/ufcq49e0f/fence.png") repeat-x 0 0 transparent;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 192px;
  min-height: 192px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
  overflow: hidden;
}

#graveyard {
  background: url("https://s25.postimg.org/6tlp9kai7/graveyard.png") repeat-x 0 0 transparent;
  position: absolute;
  top: 1;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 192px;
  min-height: 192px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
}

#plants {
  background: url("https://s25.postimg.org/gvraktanj/plant2.png") repeat-x 0 0 transparent;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  height: 192px;
  min-height: 192px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
}

#balloon {
  background: url("https://s25.postimg.org/q09yx9e0f/balloon_zombie.png") repeat-x 0 0 transparent;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  height: 300px;
  min-height: 300px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
}

#moon {
  background: url("https://s25.postimg.org/a2kjsub73/moon.png") repeat-x 0 0 transparent;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 70%;
  height: 275x;
  min-height: 275px;
  border: 0 none transparent;
  outline: 0 none transparent;
  -webkit-transform: translate3d(0, 0, 0.01);
  transform: translate3d(0, 0, 0.01);
  will-change: transform;
}


a {
	color: #3cd2ff;
	-o-transition: color .5s ease-out, background 7s ease-in;
	-ms-transition: color .5s ease-out, background 7s ease-in;
	-moz-transition: color .5s ease-out, background 7s ease-in;
	-webkit-transition: color .5s ease-out, background 7s ease-in;
	transition: color .5s ease-out, background 7s ease-in;
	text-decoration: none;
}
a:hover {
	color: #FFF;
	background: none;
}

.credits {
	text-align: center;
	font-family: 'Crushed';
	font-size: 1.5vw;
	color: #FFF;
}
.stars {
	color: #f43a2f;
	padding: 0 .5vw 0 .5vw;
	font-size: 1.6vw;
}
            
          
!
            
              // wait until DOM is ready
document.addEventListener("DOMContentLoaded", function(event) {

  function ground() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#ground", 35, {
      backgroundPosition: "1301px 0px",
      force3D: true,
      rotation: -0.32,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function clouds() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#clouds", 17, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.01,
      z: 0.01,
      //autoRound:false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function fence() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#fence", 20, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function plants() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#plants", 20, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function graveyard() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#graveyard", 20, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function trees() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#trees", 27, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function balloon() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#balloon", 12, {
      backgroundPosition: "-2247px bottom",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function balloon() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#balloon", 10, {
      backgroundPosition: "1301px 0px",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  function moon() {

    var tl = new TimelineMax({
      repeat: -1
    });

    tl.to("#moon", 22, {
      backgroundPosition: "-2247px top",
      force3D: true,
      rotation: 0.09,
      z: 0.01,
      autoRound: false,
      ease: Linear.easeNone
    });

    return tl;
  }

  var masterTL = new TimelineMax({
    repeat: -1
  });

  // window load event makes sure image is 
  // loaded before running animation
  window.onload = function() {

    masterTL
      .add(plants(), 0)
      .add(ground(), 0)
      .add(clouds(), 0)
      .add(fence(), 0)
      .add(balloon(), 0)
      .add(trees(), 0)
      .add(graveyard(), 0)
      .add(moon(), 0)
      .timeScale(0.7)
      .progress(1).progress(0)
      .play();

  };

});
            
          
!
999px
Loading ..................

Console