Skip to content

Instantly share code, notes, and snippets.

@tjwudi
Created June 19, 2014 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjwudi/5d62e1cbd027e9e02ebe to your computer and use it in GitHub Desktop.
Save tjwudi/5d62e1cbd027e9e02ebe to your computer and use it in GitHub Desktop.
A Pen by John Wu.
<div class="box"></div>
var box = document.querySelector('.box');
box.animate([
{ transform: 'scaleX(1)', offset: 0 },
{ transform: 'scaleX(2)', offset: 0.3 },
{ transform: 'scaleX(0.5)', offset: 0.6 },
{ transform: 'scaleX(1)', offset: 1 }
], {
duration: 1000,
iterations: 999
});
.box {
width: 50px;
height: 50px;
background-color: #fdd;
transform-origin: left top;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment