Liquid FireEmber 应用动画支持
Liquid Fire 为 Ember 应用提供了完整的动画支持。
示例代码:
import { animate, stop } from "vendor/liquid-fire"; export function crossFade(oldView, insertNewView, opts) { stop(oldView); return insertNewView().then(function(newView) { return Promise.all([ animate(oldView, {opacity: 0}, opts), animate(newView, {opacity: [1, 0]}, opts) ]); }); }); export function fade(oldView, insertNewView) { stop(oldView); return animate(oldView, {opacity: 0}) .then(insertNewView) .then(function(newView){ return animate(newView, {opacity: [1, 0]}); }); });
评论