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.

            
              
<body>
    <div class="content">
    <div id="contenedor">
  	  <div id="arbol1"></div>
      <div id="lobo"></div>
      <div id="arbusto"></div>
      <div id="arbol2"></div>
    	<div id="plano2"></div>
    	<div id="plano3"></div>
      <div id="plano4"></div>
      <div id="plano5"></div>
      <div id="humo"></div>
    </div>
  </div>
  <div class="marco">
    <div id="cont-botones">
     <input type="button" id="playBtn" value="Go">
     <input type="button" id="reverseBtn" value="Back">
    </div>
  </div>

</body>

            
          
!
            
              $fondo: #0B2F3A;
$border: #E0F8F7;
@mixin boton {
  margin-left: 15px;
  border: 1px solid #dedede;
  border-radius: 3px;
  color: #555;
  display: inline-block;
  font: bold 12px/12px HelveticaNeue, Arial;
  padding: 8px 11px;
  text-decoration: none;
}
@mixin botonhover{
  background: #f4f4f4;
  border-color: #c7c7c7 #c3c3c3 #bebebe;
  box-shadow: 0 1px 1px #ebebeb, inset 0 1px 0 #f3f3f3;
  text-shadow: 0 1px 0 #fdfdfd;
}
@mixin Posicion($position, $bottom, $left, $width, $height, $z-index){
  position:$position;
  bottom: $bottom;
  left: $left;
  width: $width;
  height: $height;
  z-index: $z-index;
}
@mixin flexCentrado {
  display: flex; 
  justify-content: center;
  width: 100%;
}
html, body {
  height: 100%;
}
body {
  background-color: $fondo;
  overflow: hidden;
}
.content{
  @include flexCentrado;
}
#contenedor {
  position: absolute;
  top: 50px;
  width: 60%;
  height: 390px;
  z-index: 1;
  overflow: hidden;
  border-radius: 5px;
  border: solid 3px $border;
  margin:5px;
  }
.marco{
  @include flexCentrado;
}
#cont-botones{
  padding-top: 20px;
  height: 30px;
 @include flexCentrado;
  }
    #playBtn, #reverseBtn{
    @include boton;
      &:hover{
      @include botonhover;
      }
    }

#arbusto{
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/arbusto.svg');
  @include Posicion(absolute, 0, -3%, 140%, 100%, 30);
  }
#lobo{
  @include Posicion(absolute, -45%, 10%, 140%, 100%, 20);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/lobo.svg');
  }
#arbol1 {
  @include Posicion(absolute, 0, -2%, 140%, 100%, 11);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/arbol1.svg');
  }
#arbol2 {
  @include Posicion(absolute, 0, -30%, 140%, 100%, 10);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/arbol2.svg');
  }
#plano2 {
  @include Posicion(absolute, 0, 0, 140%, 100%, 9);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/plano2.svg');
  }
#plano3 {
  @include Posicion(absolute, 0, -10%, 150%, 100%, 8);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/plano3.svg');
  }
#plano4 {
  @include Posicion(absolute, 0, -10%, 170%, 100%, 7);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/plano4.svg');
  }
#plano5 {
  @include Posicion(absolute,0, -10%, 130%, 100%, 6);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/plano5.svg');
  }
#humo{
  @include Posicion(absolute, 0, -10%, 120%, 100%, 6);
  background-image: url('http://evasantos.com/ilustraciones/caperucita/img2/humo.svg');

     -webkit-animation: humo 5s 2s Ease infinite;
     }

    @-webkit-keyframes humo{
        50%{
            opacity: 0.9;
        }
        100%{
            opacity: 0;
        }
    }

            
          
!
            
                
var $arbol1 = $('#arbol1');	
var $arbol2 = $('#arbol2');	
var $plano2 = $('#plano2');	
var $plano3 = $('#plano3');	
var $plano4 = $('#plano4');	
var $plano5 = $('#plano5');
var $arbusto = $('#arbusto');
var $lobo = $('#lobo');
var $humo = $('#humo');


 window.onload = function() {

    arbol1 = document.getElementById("arbol1"),
    arbol2 = document.getElementById("arbol2"),
     plano2 = document.getElementById("plano2"),
     plano3 = document.getElementById("plano3"),
     plano4 = document.getElementById("plano4"),
     plano5 = document.getElementById("plano5"),
     lobo = document.getElementById("lobo"),
     arbusto = document.getElementById("arbusto"),
     humo = document.getElementById("humo"),


     playBtn = document.getElementById("playBtn"),
     reverseBtn = document.getElementById("reverseBtn"),

     tween1 = TweenLite.to($arbol1, 9, {left: -220, scale: 1.1});
	   tween2 = TweenLite.to($arbol2, 9, {left: 110, scale: 1.1});
	   tween3 = TweenLite.to($plano2, 9, {left: 20, scale: 1.2});
	   tween4 = TweenLite.to($plano3, 9, {left: 210,scale: 1.3});
	   tween5 = TweenLite.to($plano4, 9, {left: 50,scale: 1.1});
	   tween6 = TweenLite.to($plano5, 9, {left: 100,scale: 1.05});
     tween8 = TweenLite.to($arbusto, 9, {left: 200, scale: 1.2});
     tween7 = TweenLite.to($lobo, 5, {y: -160, delay:6});
     tween9 = TweenLite.to($humo, 9, {left: 100,scale: 1.05});


    playBtn.onclick = function() {
        tween1.play();
        tween2.play();
        tween3.play();
        tween4.play();
        tween5.play();
        tween6.play();
        tween7.play();
        tween8.play();
        tween9.play();

    };
   reverseBtn.onclick = function() {
        tween1.reverse();
        tween2.reverse();
        tween3.reverse();
        tween4.reverse();
        tween5.reverse();
        tween6.reverse();
        tween7.reverse();
        tween8.reverse();
        tween9.reverse();

    };
 
};


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console