Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <main class="phone">
      <h1 class="title">Animatioland</h1>
      <div class="lawn__container">
      <div class="lawn lawn__one"></div>
      <div class="lawn lawn__two"></div>
      <div class="lawn lawn__three"></div>
    </div>
        <!-- Fruit 1 -->
        <div class="layers layer-1 fruit">
            <input type="checkbox">
            <div class="container__carrot">
                <div class="carrot">
                    <div class="eye-left">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div>
                    </div>
                    <div class="eye-right">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div> 
                    </div>
                    <div class="mouth__outer">
                      <div class="mouth__inner"></div>
                    </div>
                </div>
                <div class="sheets"></div>
                <div class="bow"></div>
                <div class="lines">
                   <span class="l1"></span>
                   <span class="l2"></span>  
                   <span class="l3"></span>
                   <span class="l4"></span>
                   <span class="l5"></span>
                </div>
                <div class="heart"></div>
            </div>

          </div>
      
         <!-- Fruit 2 -->
        <div class="layers layer-2 fruit">
          <input type="checkbox">
            <div class="container__carrot">
                <div class="carrot">
                    <div class="eye-left">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div>
                    </div>
                    <div class="eye-right">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div> 
                    </div>
                    <div class="mouth__outer">
                      <div class="mouth__inner"></div>
                    </div>
                </div>
                <div class="sheets"></div>
                <div class="bow"></div>
                <div class="lines">
                   <span class="l1"></span>
                   <span class="l2"></span>  
                   <span class="l3"></span>
                   <span class="l4"></span>
                   <span class="l5"></span>
                </div>
                <div class="heart"></div> 
            </div>

        </div>

        <!-- Wall 1 -->
        <div class="layers layer-3 wall">
            <div class="grass grass-one"></div>
            <div class="grass grass-two"></div>
        </div>

        <!-- Fruit 3-->
        <div class="layers layer-4 fruit">
           <input type="checkbox">           
            <div class="container__carrot">
                <div class="carrot">
                    <div class="eye-left">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div>
                    </div>
                    <div class="eye-right">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div> 
                    </div>
                    <div class="mouth__outer">
                      <div class="mouth__inner"></div>
                    </div>
                </div>
                <div class="sheets"></div>
                <div class="bow"></div>
                <div class="lines">
                   <span class="l1"></span>
                   <span class="l2"></span>  
                   <span class="l3"></span>
                   <span class="l4"></span>
                   <span class="l5"></span>
                </div>
                <div class="heart"></div> 
            </div>

        </div>

        <!-- Wall 2 -->
        <div class="layers layer-5 wall">
            <div class="grass grass-one"></div>
            <div class="grass grass-two"></div>
        </div>

        <!-- Fruit 4 -->
        <div class="layers layer-6 fruit">
            <input type="checkbox">            
            <div class="container__carrot">
                <div class="carrot">
                    <div class="eye-left">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div>
                    </div>
                    <div class="eye-right">
                      <div class="iris-medium"></div>
                      <div class="iris-small"></div> 
                    </div>
                    <div class="mouth__outer">
                      <div class="mouth__inner"></div>
                    </div>
                </div>
                <div class="sheets"></div>
                <div class="bow"></div>
                <div class="lines">
                   <span class="l1"></span>
                   <span class="l2"></span>  
                   <span class="l3"></span>
                   <span class="l4"></span>
                   <span class="l5"></span>
                </div>
                <div class="heart"></div> 
            </div>

        </div>

        <!-- Wall 3 -->
        <div class="layers layer-7 wall">
            <div class="grass grass-one"></div>
            <div class="grass grass-two"></div>
        </div>

        <!-- Bush-->
        <div class="layers layer-8 bush"></div>
        

        <!-- Bunny -->
        <div class="layers layer-11 bunny__one">
            <div class="head__one">
              <div class="ear"></div>
              <div class="tail__one"></div>
            </div>
          </div>
          <div class="layers layer-12 bunny__two">
            <div class="head__two">
              <div class="ear"></div>
              <div class="tail__two"></div>
            </div>
          </div>

          <h3 class="score">Score: </h3>

    </main>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');


:root {
    --background-walls: rgb(126, 113, 70);
    --background-bush: rgb(78, 70, 43);
    --grass-one:rgb(199, 188, 153);
    --grass-two: rgb(168, 152, 98);
    --shadow-primary: 12px 10px 8px -5px #4d2b2bd5;
    --shadow-secondary: 5px 5px 6px 0px rgba(38,38,38,0.99), inset -10px -10px 15px 0px #262626;
    
}

body {
    margin: 0;
    height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
}
.phone {
    position: relative;
    border: 8px solid black;
    border-radius: 40px;
    height: 600px;
    width: 300px;
    overflow: hidden;
    box-shadow: var(--shadow-primary);
	background: -webkit-linear-gradient(top, #c9dbe9 0%, #fff 100%);
    counter-reset: game;
}
.title {
    margin-top: 30px;
    text-align: center;
    letter-spacing: 2.2px;
    font-size: 25px;
    font-family: 'ZCOOL KuaiLe', cursive;    
    opacity: 80%;
}

input[type=checkbox] {
    appearance: none;
    cursor: pointer;
    position: relative;
    width: 80px;
    height: 130px;
    top: 0;
    z-index: 2;

}
input[type=checkbox]:focus {
    appearance: none;
    outline: none;    
}
input:checked {
    counter-increment: game;
}
.score {
    position: absolute;
    letter-spacing: 2.5px;
    top: 65px;
    left: 110px;
}
.score:after {
    content: counter(game);
}




.layers {
    position: absolute;
    bottom: 0;
}
/* Fruit 1 */
.layer-1 {
    z-index: 10;
    height: 445px;
    right: 60px;

    animation: carrot-one 3.2s ease-in-out alternate infinite;
}
    @keyframes carrot-one {
        0% {transform: translateY(-30px);}
        25% {transform: translateY(80px);}
        50% {transform: translateY(-80px);}
        75% {transform: translateY(80px);} 
        100% {transform: translateY(0);}
       
    }
    

/* Fruit 2 */
.layer-2 {
    z-index: 20;
    height: 445px;
    left: 60px;
    animation: carrot-two 2.2s ease-in-out alternate infinite;
}
    @keyframes carrot-two {
        0% {transform: translateY(-80px);}
        50% {transform: translateY(80px);}
        100% {transform: translateY(0);}

    }
    

/* wall 1 */
.layer-3 {
    z-index: 30;
    height: 400px;
    left: 0;
    right: 0;
    margin: 0 auto;   
}
/* Fruit 3 */
.layer-4 {
    z-index: 40;
    height: 345px;
    left: 30px;
    animation: carrot-three 4.5s linear alternate infinite;

}
    @keyframes carrot-three {
        0% {transform: translateY(-80px);}
        25% {transform: translateY(80px);}
        50% {transform: translateY(-80px);}
        60% {transform: translateY(60px);}
        80% {transform: translateY(-80px);}
        100% {transform: translateY(0);}
    }
  
/* wall 2 */
.layer-5 {
    z-index: 50;
    height: 300px;
    left: 0;    
}
/* Fruit 4 */
.layer-6 {
    z-index: 60;
    height: 245px;
    right: 30px;
    animation: carrot-four 3s ease-in alternate infinite;

}
    @keyframes carrot-four {
        0% {transform: translateY(80px);}
        25% {transform: translateY(-20px);}
        50% {transform: translateY(80px);}
        100% {transform: translateY(-80px);} 
        
    }
   

/* wall 3 */
.layer-7 {
    z-index: 70;
    height: 200px;
    right: 0;
}
/* Lawn  */
.layer-8 {
    z-index: 80;
    left: 145px;
    bottom: -170px;

}

  
/* Bunny Left */
.layer-11 {
    z-index: 71;
    bottom: 30px;
    left: 10px;
}
/* Bunny Right */
.layer-12 {
    z-index: 72;
    bottom: 95px;
    right: 130px;
}




/* Lawn */

.lawn__container {
	transform: scale(65%);
}
 .lawn {
	width: 200px; height: 60px;
	background: #fff;
	border-radius: 200px;
	position: relative; 
  	opacity: 70%;
}

.lawn:before, .lawn:after {
	content: '';
	position: absolute; 
	background: #fff;
	width: 100px; height: 80px;
	position: absolute; top: -15px; left: 10px;
	
	border-radius: 100px;
	

}

.lawn:after {
	width: 120px; height: 120px;
	top: -55px; left: auto; right: 15px;
}
.lawn__one {
	top: 10px;
	left: 30px;
	animation: moveclouds 65s linear infinite;
}
.lawn__two {
	top: 70px;
  	left: 160px;
	animation: moveclouds 28s linear infinite;
}
.lawn__three {
  	top: 145px;
  	right: 75px;
	animation: moveclouds 58s linear infinite;
}
@keyframes moveclouds {
	0% {transform: translateX(450px);}
	100% { transform: translateX(-450px);}
}


/* Fruit */
 /* Drawing Bunny */

 .fruit {
    width: 80px;
/*  background-color: rgb(183, 240, 172); */
}


    .container__carrot {
        position:absolute;
        top: 25px;
        width: 100%;
        transform: scale(75%);
    }
    .carrot{
      
        width: 100%;
        position:absolute;
        height:160px;
        border-radius: 55%  50%  50%  55%  / 60%   60%   40%  40%;
        background:#e76d2b;
        transform:rotate(180deg);
        box-shadow: -5px -5px 6px -1px rgba(38,38,38,0.99), inset 6px -5px 19px -2px rgba(38,38,38,0.99);
    }

  /* Lines */
    .l1, .l2, .l3, .l4, .l5{
        position:absolute;
        border-radius:3px;
        background:#662601;
        height: 2px;
    }
    .l1{
      width:35px;
      top: 28px;
      left: 15px;
    }
    .l2{
      width:20px;
      top: 40px;
      left: 45px;
    }
    .l3{
      width:20px;
      top: 110px;
      left: 40px; 
    }
    .l4{
      width:25px;
      top: 120px;
      left: 10px; 
    }
    .l5{
      width:12px;
      top: 135px;
      left: 35px;  
    }
    .eye-left,.eye-right{
      position:absolute;
      width:25px;
      height:25px;
      border-radius:100%;
      background:black;
      animation: blink 2s alternate infinite;
      }

        @keyframes blink {
          0%,25%{opacity:1}
          35%{opacity: 0}
          50%{opacity:1;}
          100%{opacity:1}       
        }
  
        .eye-left{margin:80px 45px}
    .eye-right{margin:80px 0}
    .iris-medium{
      position:absolute;
      width:8px;
      height:8px;
      border-radius:100%;
      background:white;
      margin:17px 5px;
      animation:shake .21s alternate infinite;
    }
    .iris-small{
      position:absolute;
      width:4px;
      height:4px;
      border-radius:100%;
      background:white;
      margin: 8px 22px;
      animation:shake .21s alternate infinite;
    }
    .mouth__outer{
      position:absolute;
      width:20px;
      height:12px;
      border-radius:50px 50px 0 0;
      background:black;
      margin:65px 25px;
    }
    .mouth__inner{
      position:absolute;
      width:15px;
      height:7px;
      border-radius: 50px 50px 0 0;
      background:#E00B44; 
      margin: 3px 3px;
      animation: go3 3s alternate infinite;
    }
    .sheets{
      position:absolute;
      width:20px;
      height:50px;
      border-radius:100%;
      background: #027a30;
      left: 32px;
      bottom: -15px;
      }
    .sheets::before{
  content:"";
  position:absolute;
  width:20px;
  height:50px;
  border-radius:100%;
  background: #0e853f;
  margin:9px -12px;
  transform:rotate(-30deg)
    }
    .sheets::after{
      content:"";
      position:absolute;
      width:20px;
      height:50px;
      border-radius:100%;
      background: #0e853f;
      margin:9px 12px;
      transform:rotate(30deg)
    }
    .bow{
      position:absolute;
      width: 40px;
      height: 40px;
      border-top: 3px solid white;
      border-left: 3px solid transparent;
      border-right: 3px solid transparent;
       border-radius: 100px / 50px;
      transform:rotate(-60deg);
      left: 8px;
      top: 18px;
    }
    .heart {
      position: absolute;
      width: 50px;
      height: 40px;
      transform:scale(.5);
      top: 95px;
      left: 25px; 
     
    }
    .heart:before,
    .heart:after {
      position: absolute;
      content: "";
      left: 16px;
      top: 0;
      width: 15px;
      height: 25px;
      background: #9B0473;
      border-radius: 50px 50px 0 0;
      transform: rotate(-45deg);
      transform-origin: 0 100%;
    }
    .heart:after {
      left: 0;
      transform: rotate(45deg);
      transform-origin :100% 100%;
      border-right:3px solid #6B0358
    }




/* Wall */

 .wall {
    width: 250px;
    background-color: var(--background-walls);
    box-shadow: var(--shadow-primary);
    border-radius: 50px 50px 0 0;
    overflow: hidden;
}
    .grass {
        position: absolute;
        width: 100%;
        height: 100px;
       
    }
    .grass-one {
        z-index: 2;
        top: 0;
        background: linear-gradient(135deg, var(--grass-one) 25%, transparent 25%) -50px 0,
        linear-gradient(-135deg, var(--grass-one)  25%, transparent 25%) -50px 0;
        background-size: 20px 200px;

    }
    .grass-two {
        z-index: 1;
        top: 10px;
        background: linear-gradient(135deg, var(--grass-two) 25%, transparent 25%) -50px 0,
        linear-gradient(-135deg, var(--grass-two)  25%, transparent 25%) -50px 0;
        background-size: 20px 220px;
    }




/* Bunny */

    :root {
      --bunny: rgb(2, 24, 31);
    }
    
    
    .bunny__one, 
    .bunny__two{
        position:absolute;
        width:50px;
        height:45px;
        border-radius:100%;
        background:var(--bunny);
        filter: blur(.8px);
        
        }
     
      .head__one,
      .head__two{
        position:absolute;
        width:35px;
        height:35px;
        border-radius:100%;
        background: var(--bunny);
        
      }
        .head__one{
          margin:-21px 21px;
        }
        .head__two{
          margin:-21px -12px;
        }
      .tail__one,
      .tail__two{
        position:absolute;
        width:21px;
        height:21px;
        border-radius:100%;
        background:rgb(112, 26, 75);
      }
      .tail__one{margin:33px -30px}
      .tail__two{margin:33px 45px}
      .ear{
        position:absolute;
        width:17px;
        height:50px;
        border-radius:100%;
        background: var(--bunny);
        margin:-30px 0px;
        
      }
      .ear::before{
        content:"";
        position:absolute;
        width:17px;
        height:50px;
        border-radius:100%;
        background: var(--bunny);
        margin:0px 21px
      }

      .bunny__one {
        animation: increase 5s alternate infinite;
      }
      .bunny__two {
        animation: increase 8s alternate infinite;
      }
    
   
      @keyframes increase {
        0% {transform: translateY(0);}
        50%,100% {transform: translateY(95px);}
      }



/* Bush */

.bush {
    position: relative;
    background: var(--background-bush);
    border-radius: 50%;
    width: 180px;
    height: 200px;
    filter: blur(1.2px);
    animation: vibration 5s alternate infinite;
    
  }
  .bush:before,
  .bush:after {
    content: "";
    position: absolute;
    background: var(--background-bush);
    border-radius: 50%;
    bottom: 0;
  }
  .bush:before{
    z-index: 30;
    width: 150px; 
    height: 150px; 
    right: 115px;
    animation: vibration 5.2s alternate infinite;
    
  }
  .bush:after {
    z-index: 20;
    width: 140px; 
    height: 100px; 
    right: 200px;
    animation: vibration 5.6s alternate infinite;
    
  }
  @keyframes vibration {
    0% {transform: translateY(0);}
    30% {transform: translateY(-3px);}
    60% {transform: translateY(-5px);}
    0% {transform: translateY(0);}
  }

              
            
!

JS

              
                
              
            
!
999px

Console