Liquid FireEmber 应用动画支持

联合创作 · 2023-10-02 15:36

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]});
    });
});
浏览 2
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报