animation

[css]我要用css画幅画(四)

怎甘沉沦 提交于 2020-01-24 05:21:09
接着之前的 [css]我要用css画幅画(四) , 这次我给小明和静静增加了对话,用了简单的动画效果。 github: https://github.com/bee0060/Css-Paint , 完整代码在pages/sun-house-5.html和相关的css中可以找到 demo: http://bee0060.github.io/Css-Paint/pages/sun-house/sun-house-5.html 完整html如下: 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Css Paint</title> 6 <link rel="stylesheet" type="text/css" href="../css/sun.css" /> 7 <link rel="stylesheet" type="text/css" href="../css/house.css" /> 8 <link rel="stylesheet" type="text/css" href="../css/human.css" /> 9 <link rel="stylesheet" type="text/css" href="../css/cloud.css" /> 10 11

iOS Core Animation Advanced Techniques-图层性能优化

故事扮演 提交于 2020-01-24 04:11:31
上十一章节: 图层树 图层的寄宿图 图层几何学 图层视觉效果 图层变换 专用图层 隐式动画 显式动画 图层时间 图层缓冲 基于定时器的动画 这篇随笔主要介绍有关图层性能优化。 CPU VS GPU: 绘图与动画有两种方式: 1.CPU(中央处理器) 2.GPU(图形处理器) 在图像处理上,正常GPU比CPU更高效,但GPU旦资源用完的话,性能就会开始下降了(即使CPU并没有完全占用) 大多数动画性能优化都是关于智能利用GPU和CPU,使得它们都不会超出负荷。 渲染服务: 动画和屏幕上组合的图层实际上被一个单独的进程管理,而不是你的应用程序。这个进程就是所谓的渲染服务。 运行一段动画,分四大阶段: 1.布局 准备你的视图/图层的层级关系,以及设置图层属性(位置,背景色,边框等等)的阶段 2.显示 图层的寄宿图被绘制阶段,绘制有可能涉及-drawRect:和-drawLayer:inContext:方法的调用路径。 3.准备 Core Animation准备发送动画数据到渲染服务的阶段 4.提交 最后的阶段,Core Animation打包所有图层和动画属性,然后通过IPC(内部处理通信)发送到渲染服务进行显示。 一旦打包的图层和动画到达渲染服务进程,他们会被反序列化来形成另一个叫做渲染树的图层树。使用这个树状结构,渲染服务对动画的每一帧做出如下工作: 5.对所有的图层属性计算中间值

Android最佳实践之Material Design

拜拜、爱过 提交于 2020-01-24 03:52:27
Material概述及主题 学习地址: http://developer.android.com/training/material/get-started.html 使用material design创建App: 温习一下material design说明 在app中应用material 主题 创建遵循material design规则的布局 指定投射阴影的高度 使用ListView和CardView 自己定义动画 使用Material 主题 <!-- res/values/styles.xml --> <resources> <!-- your theme inherits from the material theme --> <style name="AppTheme" parent="android:Theme.Material"> <!-- theme customizations --> </style> </resources> 新的Material 主题提供了一下内容: 能够让你调色的系统组件 系统组件的触摸反馈动画 Activity的过渡动画 Material 主题有几种: @android:style/Theme.Material(黑色版本号) @android:style/Theme.Material.Light(浅色版本号) @android:style

Disabling Flutter Hero reverse animation

别来无恙 提交于 2020-01-24 03:41:06
问题 Given 2 routes, e.g. parent and a child and a Hero(..) widget with the same tag. When the user is on the "parent" screen and opens a "child" - the Hero widget is animated. When it goes back (via Navigator.pop ) it's also animated. I'm looking for a way to disable that animation when going back (from child to parent via Navigator.pop ). Is there a kind of handler which will be called on a widget before it's going to be "animated away" ? Then I probably could change Hero tag and problem solved.

Underside color of curling view using UIViewAnimationTransitionCurlUp

流过昼夜 提交于 2020-01-23 21:32:06
问题 Can one customize the underside color of curling view in a UIViewAnimationTransitionCurlUp animation. The default seems to be gray/white but i needed a different one. 回答1: Officially, no. Unofficially, you can change the color using undocumented methods – but it will cause your app to be rejected if you target for AppStore, CAFilter* trans_filter = [CAFilter filterWithName:@"pageCurl"]; [trans_filter setValue:[NSArray arrayWithObjects: [NSNumber numberWithFloat:1.0f], // Red [NSNumber

css3中的过渡效果和动画效果

我怕爱的太早我们不能终老 提交于 2020-01-23 13:29:17
一、CSS3 过渡 (一)、CSS3过渡简介 CSS3过渡是元素从一种样式逐渐改变为另一种的效果。 实现过渡效果的两个要件: 规定把效果添加到哪个 CSS 属性上 规定效果的时长 定义动画的规则 过渡transition (作用) 将元素的某个属性从“一个值”在指定的时间内过渡到“另一个值” (二)、transition属性 语法 : {transition: 属性名 持续时间 过渡方法} transition-property 属性的名字(如果是一个属性就带有这个属性的名字;如果是多个属性,属性名之间用逗号隔开;如果是所有属性,用all表示即可。)表示对哪个属性进行变化。 transition-duration 变化持续的时间长度(秒或是毫秒) transition-timing-function 过渡实现的方式(比如说,先慢后快/先快后慢),具体实现的时候是以函数来实现的。 transition-delay 过渡开始前等待的时间,单位为秒或是毫秒。 transition-timing-function 属性取值 linear 匀速(线型过渡) ease 先慢后快再慢 ease-in 先慢后快 ease-out 先快后慢 ease-in-out 开头慢结尾慢,中间快 实例 : 原有的状态是灰底红字,鼠标悬停在上面利用transition属性设置了一个3s 之内的变化

Animating the background color of an HTML table's cell (or the whole row) on an event

别等时光非礼了梦想. 提交于 2020-01-23 06:35:24
问题 I have a table with a menu (food items) with several rows and columns. The 2nd column contains a link to the food item. When the user clicks it, the item is added to a shopping cart. I'd like to give the user some visual feedback that the click and adding actually worked. I already have a click handler for the link that adds the item clicked on to the cart. A simple alert('Item successfully added'); works but is not really pretty. I'd like the table cell (or the whole row) to "flash" once. By

Animating the background color of an HTML table's cell (or the whole row) on an event

不问归期 提交于 2020-01-23 06:34:04
问题 I have a table with a menu (food items) with several rows and columns. The 2nd column contains a link to the food item. When the user clicks it, the item is added to a shopping cart. I'd like to give the user some visual feedback that the click and adding actually worked. I already have a click handler for the link that adds the item clicked on to the cart. A simple alert('Item successfully added'); works but is not really pretty. I'd like the table cell (or the whole row) to "flash" once. By

Achieve somewhat stable framerate with requestAnimationFrame?

匆匆过客 提交于 2020-01-23 05:16:41
问题 I am playing around with the requestAnimationFrame but I get very jerky animations in any other browser than Chrome. I create an object like this: var object = function() { var lastrender = (new Date()).getTime(); var delta = 0; return { update: function() { //do updates using delta value in calculations. }, loop: function() { var looptimestamp = (new Date()).getTime(); delta = looptimestamp - lastrender; lastrender = looptimestamp; this.update(); window.requestAnimationFrame(this.loop.bind