Skip to content

Instantly share code, notes, and snippets.

@paulfarino
Created November 6, 2017 02:48
Show Gist options
  • Save paulfarino/7faed91be017a8e194c625e9c106ed13 to your computer and use it in GitHub Desktop.
Save paulfarino/7faed91be017a8e194c625e9c106ed13 to your computer and use it in GitHub Desktop.
Web Animation API Example
#thing {
height: 200px;
width: 200px;
background: grey;
}
<div id="thing">Hello</div>
const el = document.getElementById('thing');
const player = el.animate([
{
width: '300px',
opacity: 0.2
},
{
width: '200px',
opacity: 1,
}
], {
duration: 1000,
iterations: 2,
direction: 'alternate',
easing: "cubic-bezier(0.4, 0.0, 1, 1)"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment