简体   繁体   English

如何在Angular.JS中创建icloud.com缩放效果

[英]How to create icloud.com scale effect in Angular.JS

The new icloud.com site was recently released and there is a neat effect that I would like to try and imitate on a project I'm working on. 新的icloud.com网站是最近发布的,它具有很好的效果,我想尝试模仿我正在从事的项目。

If you visit https://www.icloud.com/#calendar and login, you will see a loading gif for a brief moment and then the calendar app scale outwards to the edge of the screen. 如果您访问https://www.icloud.com/#calendar并登录,您会在短时间内看到加载的gif,然后日历应用程序向外扩展到屏幕边缘。

Here's what I'm interested in learning: 这是我对学习感兴趣的内容:

  • What would you call this effect? 您怎么称这种效果?
  • Can someone discuss the mechanics of how this might be implemented in AngularJS (or a similar framework), more specifically, the page structure, how the new content is being loaded, how the transition is being applied, etc 有人可以讨论如何在AngularJS(或类似框架)中实现这一机制,更具体地说,页面结构,如何加载新内容,如何应用过渡等。
  • Examples, links, or other resources would be much appreciated 示例,链接或其他资源将不胜感激

Not quite sure how to call this effect (enter the scene or scale maybe) but after a quick look it appears that the website is using a mix of absolute positioning, opacity and -webkit-transform. 不太确定如何调用此效果(可能输入场景或比例),但快速浏览后,似乎该网站使用的是绝对定位,不透明度和-webkit-transform的混合。

If you inspect the page you will see that both opacity and -webkit-transform:scale() are incremented with some javascript function (appears to be done by the _calculateTransforms function of javascript-packed.js). 如果您查看页面,您会发现不透明度和-webkit-transform:scale()都通过某些javascript函数增加了(似乎由javascript-packed.js的_calculateTransforms函数完成)。 At the beginning of the effect opacity starts at 0 and end at 1. webkit-transform starts with scale(0.9) and end at scale(1). 在效果开始时,不透明度从0开始,以1结束。webkit-transform以scale(0.9)开始,以scale(1)结束。 Please note that the animated div is already present in the DOM but invisble when the effect start. 请注意,动画div已存在于DOM中,但在效果开始时不可见。

Finally I think ngAnimate could be a good candidate to mimic this effect (see here for more details) 最后,我认为ngAnimate可能是模仿此效果的不错选择(有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM