Skip to content

Instantly share code, notes, and snippets.

@rusty-key
Last active August 24, 2016 15: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 rusty-key/66f26eb9ec793fad44757ae4d01c338b to your computer and use it in GitHub Desktop.
Save rusty-key/66f26eb9ec793fad44757ae4d01c338b to your computer and use it in GitHub Desktop.
widget animation
// какая-то функция, которая показывает виджет
function showWidget($widget) {
$widget.appendTo($parentElement);
setTimeout(() => {
$widget.addClass('show-widget');
}, 1);
}
.c--widget {
opacity: 0;
transform: translateY(-30px);
transition: opacity .2s ease, transform .3s ease;
&.show-widget {
opacity: 1;
transform: translateY(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment