简体   繁体   English

与 Angularjs 一起使用的 Polymer 动画页面

[英]Polymer's Animated Pages used with Angularjs

I would like to ask if there are any examples related to Polymer's animated pages ( http://www.polymer-project.org/docs/elements/core-elements.html#core-animated-pages ) and how we can build a similar demo using the resources provided in the Angular/material repo ( https://github.com/angular/material ).我想问一下是否有任何与Polymer 的动画页面相关的示例( http://www.polymer-project.org/docs/elements/core-elements.html#core-animated-pages )以及我们如何构建一个使用 Angular/material 存储库 ( https://github.com/angular/material ) 中提供的资源的类似演示。

I would like to achieve http://www.polymer-project.org/components/core-animated-pages/demos/music.html but I don't want to use Polymer since I would like to use Angular.我想实现http://www.polymer-project.org/components/core-animated-pages/demos/music.html但我不想使用 Polymer,因为我想使用 Angular。

Can you please provide me some directions in order to start?你能给我一些指导以便开始吗?

What they typically do with Polymer is have two connected elements which shows only one and when you perform some action, the other gets shown (from display: none ) and animates from certain dimentions to its final form.他们通常对 Polymer 做的是有两个连接的元素,它们只显示一个,当您执行某些操作时,另一个会显示(来自display: none )并从某些维度动画到其最终形式。 Sometimes elements also shift but it depends on whether the content is able to move to its new position or not.有时元素也会移动,但这取决于内容是否能够移动到新位置。

You have to work with css transition , transform and display .您必须使用 css transitiontransformdisplay Sometimes even custom animations.有时甚至是自定义动画。 And you are mostly changing multiple divs to their final form.而且您主要是将多个 div 更改为它们的最终形式。 I think the most difficult would be animating colors (from white to pink or from yellow to green for example) as those are most difficult to do (performance-wise).我认为最困难的是动画颜色(例如从白色到粉红色或从黄色到绿色),因为这些是最难做到的(性能方面)。

If you look at the example you've set (final link) you see there's a list of items with a detail div and once you click the item you show the detail and transform the contents to its final dimentions.如果您查看您设置的示例(最终链接),您会看到一个带有详细信息 div 的项目列表,一旦您单击该项目,您就会显示详细信息并将内容转换为其最终尺寸。

Just know that these things are pretty hard if you aren't very much into Angular or HTML/CSS/Javascript.如果您对 Angular 或 HTML/CSS/Javascript 不是很了解,请知道这些事情是非常困难的。

The framework of Polymer for Web is very much a work in progress and i wouldn't be surprised if it took a few months to get similar results for both native and web. Polymer for Web 的框架在很大程度上是一项正在进行的工作,如果花费几个月的时间才能在本机和 Web 上获得类似的结果,我不会感到惊讶。

You can take example from things like this: https://medium.com/tictail-makers/giving-animations-life-8b20165224c5 or https://www.polymer-project.org/apps/topeka/ or http://codepen.io/collection/amheq/ .你可以用这样的例子: https : //medium.com/tictail-makers/giving-animations-life-8b20165224c5https://www.polymer-project.org/apps/topeka/http:// codepen.io/collection/amheq/ And don't forget to speed it up by using some bootstrap theme like this http://fezvrasta.github.io/bootstrap-material-design/ or something.并且不要忘记使用一些引导主题来加速它,比如http://fezvrasta.github.io/bootstrap-material-design/或其他东西。

I've been struggling with the same problem as there isn't much to go from right now.我一直在为同样的问题苦苦挣扎,因为现在没有什么可做的了。 You stated the Angular project but that will take time.您提到了 Angular 项目,但这需要时间。 If you want to do it now, you have to do quite some work (if you do, share it with us), but you might be better of with postponing this until most of the bugs and problems have been solved.如果您现在想这样做,您必须做一些工作(如果您这样做了,请与我们分享),但是最好将其推迟到大多数错误和问题都已解决。 Thats what i'm doing now.这就是我现在正在做的。

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

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