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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <!-- DO NOT REMOVE: imports current just-animate version -->
[[[https://codepen.io/notoriousb1t/pen/bwqqoB]]]
<!-- DO NOT REMOVE: imports current just-animate version -->

<div class="container text-center">
   <div class="green pixl">
      <div class="eye left">
         <div class="pupil">
            <div class="reflection"></div>
         </div>
      </div>
      <div class="eye right">
         <div class="pupil">
            <div class="reflection"></div>
         </div>
      </div>
      <div class="tongue"></div>
   </div>
</div>


              
            
!

CSS

              
                .green.pixl {
   border: solid 2px darkgreen;
   background-color: green;
}

.pixl {
   cursor: pointer;
   border-radius: 30% 30% 20% 20%;
   height: 80px;
   width: 80px;
   text-align: center;
   line-height: 175px;
   margin-top: 50px;
   margin-left: auto;
   margin-right: auto;
   transform-origin: center center;
   font-weight: bold;
   font-size: 24pt;
   padding: 1em;
   position: relative;
   .eye {
      position: absolute;
      width: 27%;
      height: 40%;
      background-color: white;
      border: solid thin black;
      border-radius: 45%;
      &.left {
         left: 28%;
         bottom: 17.5%;
         border-top-left-radius: 60%;
         border-bottom-right-radius: 60%;
      }
      &.right {
         right: 20%;
         bottom: 18%;
         border-top-right-radius: 60%;
         border-bottom-left-radius: 60%;
         transform: scale(.65);
      }
      .pupil {
         position: absolute;
         right: 10%;
         bottom: 20%;
         width: 40%;
         height: 50%;
         background-color: black;
         border-radius: 50%;
         animation: pixlSlightEyeMovement 2.2s Infinite alternate ease-out;
         .reflection {
            position: absolute;
            left: 30%;
            bottom: 10%;
            border-radius: 50%;
            width: 20%;
            height: 20%;
            background-color: white;
         }
      }
   }
   .tongue {
      position: absolute;
      background-color: maroon;
      height: 15%;
      width: 30%;
      border-radius: 20% 30% 50% 50%;
      border: solid 1px black;
      bottom: 0;
      right: 35%;
   }
}

@keyframes pixlSlightEyeMovement {
   from {
      transform: none;
   }
   to {
      transform: translate(-5px, -2px);
   }
}
              
            
!

JS

              
                function animate() {
   just.animate({
      targets: '.pixl',
      from: 0,
      to: '1.5s',
      fill: 'forwards',
      easing: 'ease-in-out',
      css: {
         rotate: [0, '360deg']
      }
   })
}

document.querySelector('.pixl').addEventListener('click', animate);
animate();
              
            
!
999px

Console