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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="icon-wrapper">
  <svg class="icon check-circle" id="check-circle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/></svg>
  <svg class="icon heart" id="heart"  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"/></svg>


  <svg class="icon bambu" id="bambu" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>bambu-icon</title><g id="Layer_2" data-name="Layer 2"><g id="Bambu"><path d="M1,0H3A1,1,0,0,1,4,1V5A0,0,0,0,1,4,5H0A0,0,0,0,1,0,5V1A1,1,0,0,1,1,0Z"/><path d="M0,6H4A0,0,0,0,1,4,6v9a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V6A0,0,0,0,1,0,6Z"/><path d="M13,0h2a1,1,0,0,1,1,1V5a0,0,0,0,1,0,0H12a0,0,0,0,1,0,0V1A1,1,0,0,1,13,0Z"/><path d="M12,6h4a0,0,0,0,1,0,0v9a1,1,0,0,1-1,1H13a1,1,0,0,1-1-1V6A0,0,0,0,1,12,6Z"/><path d="M7,11H9a1,1,0,0,1,1,1v4a0,0,0,0,1,0,0H6a0,0,0,0,1,0,0V12A1,1,0,0,1,7,11Z" transform="translate(16 27) rotate(180)"/><path d="M6,0h4a0,0,0,0,1,0,0V9a1,1,0,0,1-1,1H7A1,1,0,0,1,6,9V0A0,0,0,0,1,6,0Z" transform="translate(16 10) rotate(180)"/></g></g></svg>

  <svg class="icon approval" id="approval" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 16"><title>approval-indicator</title><g id="Layer_2" data-name="Layer 2"><g id="Approval"><path d="M0,15H14a0,0,0,0,1,0,0v0a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1v0a0,0,0,0,1,0,0Z"/><path d="M1,10H13a1,1,0,0,1,1,1v3a0,0,0,0,1,0,0H0a0,0,0,0,1,0,0V11A1,1,0,0,1,1,10Z"/><rect x="6" y="4" width="2" height="7"/><path d="M5,0H9a1,1,0,0,1,1,1V4a0,0,0,0,1,0,0H4A0,0,0,0,1,4,4V1A1,1,0,0,1,5,0Z"/><path d="M6,3A1,1,0,0,0,5,4,1,1,0,0,1,6,5,1,1,0,0,0,6,3Z"/><path d="M8,3A1,1,0,0,1,9,4,1,1,0,0,0,8,5,1,1,0,0,1,8,3Z"/></g></g></svg>


  <svg class="icon plane" id="paperplane" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"/></svg>


  <svg class="icon like" id="like"  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M104 224H24c-13.255 0-24 10.745-24 24v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V248c0-13.255-10.745-24-24-24zM64 472c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zM384 81.452c0 42.416-25.97 66.208-33.277 94.548h101.723c33.397 0 59.397 27.746 59.553 58.098.084 17.938-7.546 37.249-19.439 49.197l-.11.11c9.836 23.337 8.237 56.037-9.308 79.469 8.681 25.895-.069 57.704-16.382 74.757 4.298 17.598 2.244 32.575-6.148 44.632C440.202 511.587 389.616 512 346.839 512l-2.845-.001c-48.287-.017-87.806-17.598-119.56-31.725-15.957-7.099-36.821-15.887-52.651-16.178-6.54-.12-11.783-5.457-11.783-11.998v-213.77c0-3.2 1.282-6.271 3.558-8.521 39.614-39.144 56.648-80.587 89.117-113.111 14.804-14.832 20.188-37.236 25.393-58.902C282.515 39.293 291.817 0 312 0c24 0 72 8 72 81.452z"/></svg>
</div>
            
          
!
            
              body {
  margin: 0;
}
h3 {
  font-family: "Proxima Nova", "Helvetica Neue", "Helvetica";
  margin: 0 0 20px;
  font-size: 32px;
  
}
.icon-wrapper {
  margin: 40px auto;
  width: 360px;
}
.icon {
  width: 40px;
  height: 40px;
  display: inline-block;
  margin: 0 auto;
  fill: #6e797a;
  cursor: pointer;
  vertical-align: middle;
  transition: fill 200ms;
  margin-right: 20px;
  &:last-child {
    margin-right: 0;
  }
  
  &:hover {
    fill: #364141;
  }
  &:active, &._active {
    fill: #2079c3;
  }
}

//Check Circle Animation
.check-circle._active {
  animation: checkAnimation 1s 1 cubic-bezier(.11, 0, .67, 1);
}

//Heart Animation
.heart._active {
  animation: heartAnimation 1s 1 cubic-bezier(.11, 0, .67, 1);
}

//Bambu Animation
.bambu._active {
  animation: bambuAnimation 1s 1 cubic-bezier(.11, 0, .67, 1);
}

//Approval Animation
.approval._active {
  animation: approvalAnimation 1s 1 cubic-bezier(.31, 0, 0, 1);
}

//Plane Animation
.plane._active {
  animation: planeAnimation 1s 1 cubic-bezier(.31, 0, 0, 1);
}

//Like Animation
.like._active {
  animation: likeAnimation 1s 100 cubic-bezier(.33, 0, .67, 1);
  transform: rotate(12deg);
}

@keyframes checkAnimation {
  0% {
    transform: scale(1) rotate(0);
  }
  10% {
    transform: scale(.77) rotate(10deg);
  }
  30% {
    transform: scale(1.2) rotate(-30deg);
  }
  50% {
    transform: scale(.9) rotate(15deg);
  }
  73% {
    transform: scale(1.05) rotate(-7.5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes approvalAnimation {
  0% {
    transform: scale(1) rotate(0);
  }
  10% {
    transform: scale(.77) rotate(10deg);
  }
  30% {
    transform: scale(1.2) rotate(-30deg);
  }
  50% {
    transform: scale(.9) rotate(15deg);
  }
  73% {
    transform: scale(1.05) rotate(-7.5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes heartAnimation {
  0% {
    transform: scale(1) ;
  }
  10% {
    transform: scale(.77);
  }
  30% {
    transform: scale(1.198);
  }
  50% {
    transform: scale(.98);
  }
  73% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bambuAnimation {
  0% {
    transform: scale(1) ;
  }
  10% {
    transform: scale(.77);
  }
  30% {
    transform: scale(1.198);
  }
  50% {
    transform: scale(.98);
  }
  73% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}


@keyframes approvalAnimation {
  0% {
    transform: translateY(0);
  }
  57% {
    transform: translateY(-7px);
  }
  77% {
    transform: translateY(7px);
  }
  86% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(1px);
  }
}

@keyframes planeAnimation {
  0% {
    opacity: 1;
  }
  46% {
    transform: translateY(-14px) translateX(5px); 
    opacity: 0;
  }
  50% {
    transform: translateY(0) translateX(0) scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(0);
    opacity: 1;
  }
  96% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
  }
}


@keyframes likeAnimation {
  0% {  
    transform: rotate(0); 
  }
  26% {
    transform: rotate(12deg) translateY(5px);
  }
  46% {
    transform: rotate(-7deg) translate(-2px, -4px);
  }
  50% { 
     transform: rotate(-7deg) translateY(0,-3px);
  }
  100% {
      transform: translate(0,0) rotate(0);
  }
}
            
          
!
            
              const circleCheck = document.getElementsByClassName('check-circle')[0];
const circleCheckClick = function() {

  circleCheck.classList.add('_active');
  window.setTimeout(() => { 
    circleCheck.style.animationTimingFunction = ".33, 0, .67, 1";
  }, 100); 
  
  window.setTimeout(() => { 
    circleCheck.style.animationTimingFunction = ".17, 0, .67, 1";
  }, 730); 

  window.setTimeout(() => { 
    circleCheck.style.animationTimingFunction = ".33, 0, .67, 1";
    circleCheck.classList.remove('_active');
  }, 1001);
}

circleCheck.addEventListener('click', circleCheckClick, false);

const heart = document.getElementsByClassName('heart')[0];
const heartClick = function() {
  
  heart.classList.add('_active');
  window.setTimeout(() => { 
    heart.style.animationTimingFunction = ".33, 0, .67, 1";
  }, 100); 
  
  window.setTimeout(() => { 
    heart.style.animationTimingFunction = ".17, 0, .67, 1";
  }, 730); 

  window.setTimeout(() => { 
    heart.style.animationTimingFunction = ".33, 0, .67, 1";
    heart.classList.remove('_active');
  }, 1001);
}
heart.addEventListener('click', heartClick, false);


const bambu = document.getElementsByClassName('bambu')[0];
const bambuClick = function() {
  
  bambu.classList.add('_active');
  window.setTimeout(() => { 
    bambu.style.animationTimingFunction = ".33, 0, .67, 1";
  }, 100); 
  
  window.setTimeout(() => { 
    bambu.style.animationTimingFunction = ".17, 0, .67, 1";
  }, 730); 

  window.setTimeout(() => { 
    bambu.style.animationTimingFunction = ".33, 0, .67, 1";
    bambu.classList.remove('_active');
  }, 1001);
}
bambu.addEventListener('click', bambuClick, false);


const approvalClick = function() {
  const approval = document.getElementsByClassName('approval')[0];
  
  approval.classList.add('_active');
  window.setTimeout(() => { 
    approval.style.animationTimingFunction = "1, 0, .95, .6";
  }, 570); 
  
  window.setTimeout(() => { 
    approval.style.animationTimingFunction = ".1, .72, .55, 1";
  }, 770); 

  window.setTimeout(() => { 
    approval.style.animationTimingFunction = ".45, 0, .9, .38";
  }, 860); 

  window.setTimeout(() => { 
    approval.classList.remove('_active');
  }, 1001);
}
approval.addEventListener('click', approvalClick, false);

const plane = document.getElementsByClassName('plane')[0];
const planeClick = function() {
  
  plane.classList.add('_active');
  window.setTimeout(() => { 
    plane.style.animationTimingFunction = "1, 0, .95, .6";
  }, 460); 
  
  window.setTimeout(() => { 
    plane.style.animationTimingFunction = ".1, .72, .55, 1";
  }, 500); 

  window.setTimeout(() => { 
    plane.style.animationTimingFunction = ".39, 0, .35, 1";
  }, 960); 

  window.setTimeout(() => { 
    plane.classList.remove('_active');
  }, 1001);
}
plane.addEventListener('click', planeClick, false);

const like = document.getElementsByClassName('like')[0];

const likeClick = function() {
  
  like.classList.add('_active');
  window.setTimeout(() => { 
    like.classList.remove('_active');
  }, 1001);
}
like.addEventListener('click', likeClick, false);

// Cycle each animation on a day
const cycle = function() {
      window.setTimeout(() => { 
      circleCheckClick();
    }, 1500); 

    window.setTimeout(() => { 
       heartClick();
    }, 3000); 

    window.setTimeout(() => { 
      bambuClick();
    }, 5000);

    window.setTimeout(() => { 
      approvalClick();
    }, 7000);

    window.setTimeout(() => { 
      planeClick();
    }, 9000);

    window.setTimeout(() => { 
      likeClick();
    }, 10000);
}

document.addEventListener("DOMContentLoaded", () => {
  //Cycle through animatons on page load  
  cycle();
  
  //Repeat animation cycle every 9.5 seconds
  window. setInterval(() => {
   cycle();
  }, 11000);

});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console