Animation Playground

In this example below you will see how to do a Animation Playground with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by pouliens, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright pouliens ©
  • HTML
  • CSS
  • JavaScript
    #square
a.button(onclick="move()") Mega

/*Downloaded from https://www.codeseek.co/pouliens/animation-playground-wggdNy */
    #square {
  width: 100px;
  height: 100px;
  background-color: red; 
}

.animator {
  position: relative;
  animation-name: example;
  animation-duration: 4s;
}



@keyframes example {
  from {
    background-color: red;
    left: 0px;    
  }
  to {
    background-color: blue;
    left: 50px;
  }
}


/*Downloaded from https://www.codeseek.co/pouliens/animation-playground-wggdNy */
    function move() {
  console.log("veikia");
  document.getElementById("square").classList.toggle('animator');
}

Comments