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

              
                <div id="face-wrap">
  <svg version="1.1" id="face" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve" data-llp-composed="true"> 
  <g id="eyes">
  <circle data-llp-id="llpface-0"  class="st0" cx="50" cy="49.7" r="48" data-llp-duration="1000" data-llp-ease="easeExpoOut"/>
  <path data-llp-id="llpface-1"  d="M19.8,32.9c0,0,1.9,4.4,6.1,4.4c4.2,0,6.1-4.4,6.1-4.4s1.7,4.4,6.1,4.4c4.4,0,6.1-4.4,6.1-4.4s2,4.4,6.1,4.4
    s6.1-4.4,6.1-4.4s1.8,4.4,6.1,4.4c4.3,0,6.1-4.4,6.1-4.4s2.5,4.4,6.1,4.4c3.6,0,6.1-4.4,6.1-4.4" data-llp-duration="1000" data-llp-delay="1000"  />
  </g>
    <path data-llp-id="llpface-2" d="M40.2,57.2c0,0-1.6-6.2-7.7-6.2c-5.2,0-7.7,6.2-7.7,6.2" data-llp-duration="800" data-llp-ease="easeExpoInOut" data-llp-delay="1200" />
    <path data-llp-id="llpface-3" d="M75.3,56.8c0,0-2.2-5.8-7.2-5.8c-5,0-7.2,5.8-7.2,5.8" data-llp-duration="800" data-llp-delay="1200" />
  
  <path data-llp-id="llpface-4" d="M32.9,67.1c0,0,3.9,13.5,16.9,13.5c13.8,0,16.9-13.5,16.9-13.5" data-llp-duration="800" data-llp-delay="1200" />
  </svg>
</div>
              
            
!

CSS

              
                $easeBackOut: cubic-bezier(0.175, 0.885, 0.32, 1.275)

body
  width: 100%
  height: 100vh
  background-color: #f7f3ed

#face-wrap
  display: flex
  align-items: center
  justify-content: center
  width: 100%
  height: 100%
  transform: translate3d(0, 0, 0)
  transition: transform 0s $easeBackOut
  
  &.tl-complete
    transition-duration: 1s
    transform: translate3d(0, -20px, 0)
    
    #face
      animation: levitate 3s $easeBackOut infinite
      
      path
        animation: levitate 3s ease-in-out infinite
        
      #eyes
        animation: levitate 3s $easeBackOut infinite

      @keyframes levitate
        0%
          transform: translate3d(0, 0, 0)
        50%
          transform: translate3d(0, -3%, 0)
        100%
          transform: translate3d(0, 0, 0)

        
#face
  overflow: visible
  position: relative
  display: block
  width: 300px
  cursor: pointer
    
  path
    stroke: #f7f3ed
    fill: none
    stroke-width: 3
    stroke-linecap: round
    stroke-linejoin: round
    
  circle
    stroke: #CC2D8A
    stroke-width: 0.5
    fill: #CC2D8A
    fill-opacity: 0
    transition: fill-opacity 0s ease-in-out
    
    &.path-complete
      transition-duration: 0.5s
      fill-opacity: 1
              
            
!

JS

              
                // svg prepared using Lazy Line Composer
// http://lazylinepainter.info/#composer

let wrap = document.querySelector("#face-wrap");
let el = document.querySelector("#face");

let myAnimation = new LazyLinePainter(el, {
  ease: "easeInOutQuad"
});

// Timeline Events

myAnimation.on("start", event => {
  wrap.classList.remove("tl-complete");
});

myAnimation.on("complete", event => {
  wrap.classList.add("tl-complete");
});

// Path Events

myAnimation.on("start:llpface-0", event => {
  event.el.classList.remove("path-complete");
});

myAnimation.on("complete:llpface-0", event => {
  event.el.classList.add("path-complete");
});

el.addEventListener("click", paint, false);

function paint() {
  myAnimation.paint();
}

paint();

              
            
!
999px

Console