b.mouseenter(function () {
b.stop().animate({ left: 100 }, 500);
});
b.mouseleave(function () {
b.stop().animate({ left: 0 }, 500);
});
Не работают без расширений:
slider.animate({ left: -950 })
.page { width: 950px }
if app.media('transform-3d')
opensource.addClass('animated3d')
transform = app.css3prop('transform')
light = $$('.light')
shadow = $$('.shadow')
corner = $$('.corner')
animation = $({ i: 0 })
link.hover ->
back = !link.is(':hover')
link.removeClass('bended') if back
animation.stop().animate { i: (if back then 0 else 1) },
duration: 600
easing: 'easeInOutQuad'
step: (i) ->
angle = Math.round(180 * i)
corner.css(transform, "rotate3d(1, 1, 0, #{angle}deg)")
if i < 0.5
light.css(opacity: 2 * i)
shadow.css(opacity: 0)
else
light.css(opacity: 0)
shadow.css(opacity: (1 - i) / 6)
if i > 0.85 and not back
link.addClass('bended')
link.mousedown ->
corner.css(transform, 'rotate3d(1, 1, 0, 190deg)')
link.removeClass('bended')
link.mouseup ->
corner.css(transform, 'rotate3d(1, 1, 0, 180deg)')
link.addClass('bended')
else
link.addClass('animated2d')
Количество кадров в секунду:
Лень, нетерпимость и гордыня
div {
background: blue;
transition: background 500ms
}
div:hover {
background: red
}
Анимирует изменения указанных полей при:
div:hover
div.addClass('rotated')
div.css({ left: 100 })
div {
transition: transform 1s }
div:hover {
transition-property: left, transform, margin-left;
transition-delay: 0, 1s 2s }
@keyframes backgrounding {
0% { background: blue }
100% { background: red }
}
div {
background: gray }
div:hover {
background: green;
animation: backgrounding 1s;
animation-delay: 0.5s;
animation-iteration-count: 3 }
animation-fill-mode:
backwards
forwards
both
@keyframes {
0% { transform: rotate(0) }
100% { transform: rotate(360deg) }
}
.loader {
animation: rotation 2s linear;
animation-iteration-count: infinite; }
$('a.signin').click(function () {
signinPopup.show().addClass('animated-show');
});
$('a.close-popup').click(function () {
signinPopup.removeClass('animated-show').
afterTransition(function () { signinPopup.hide() });
});
github.com/ai/transition-eventssigninPopup.removeClass('animated-show').
afterTransition(function () { signinPopup.hide() });
linear
easeOutQuint
easeOutBack
transition-timing-function: cubic‑bezier(0.175, 0.885, 0.32, 1.275)
animation-timing-function: cubic‑bezier(0.175, 0.885, 0.32, 1.275)
+transition(all 1s)
+transition(all 1s ceaser('easeInBack'))
+keyframes(animation-name)
0%
…