[TypeStyle] Use TypeStyle keyframes to create CSS animations
We cover CSS keyframes and how to create them using TypeStyle. We then show how to use the keyframes function to create an animation. We also discuss a few other CSS properties in the animation namespace.
import {style, keyframes, classes} from 'typestyle';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
const fadeAnimationName = keyframes({
from: {opacity: 0},
to: {opacity: 1}
});
const fadeAnimationClassName = style({
animationName: fadeAnimationName,
animationDuration: '2s'
});
const coloringAnimationName = keyframes({
'0%': {color: 'black'},
'50%': {color: 'pink'},
'100%': {color: 'red'}
});
const fontColoringAnimationClassName = style({
fontSize: '20px',
animationName: coloringAnimationName,
animationDuration: '2s',
animationIterationCount: 'infinite'
});
const App = () => (
<div className={classes(
fadeAnimationClassName,
fontColoringAnimationClassName
)}>
Hello World!
</div>
);
ReactDOM.render(
<App />,
document.getElementById('root')
);
[TypeStyle] Use TypeStyle keyframes to create CSS animations的更多相关文章
- 【翻译】CSS Animations VS the Web Animations API:案例学习
原文地址:CSS Animations vs the Web Animations API: A Case Study May 03, 2017 css, javascript 上周我写了我如何使用C ...
- 'Attempt to create two animations for cell' iOS
我是在对一个UITableView 一起进行 reloadRows和reloadSections 的操作的时候 出现的
- 【转】Styling And Animating SVGs With CSS
原文转自:http://www.smashingmagazine.com/2014/11/03/styling-and-animating-svgs-with-css/?utm_source=CSS- ...
- AngularJS学习--- 动画操作 (Applying Animations) ngAnimate step 12
1.切换目录 git checkout step-12 npm start 2.效果图 这里在点击右边的缩略图时,会有一个很明显的从下向上的动画过程. 3.代码实现: step11和step12之间的 ...
- Styling FX Buttons with CSS
http://fxexperience.com/2011/12/styling-fx-buttons-with-css/ ——————————————————————————————————————— ...
- 动画操作 (Applying Animations) ngAnimate12
动画操作 (Applying Animations) ngAnimate step 12 1.切换目录 git checkout step-12 npm start 2.效果图 这里在点击右边的缩略图 ...
- 盒子端 CSS 动画性能提升研究
不同于传统的 PC Web 或者是移动 WEB,在腾讯视频客厅盒子端,接大屏显示器(电视)下,许多能流畅运行于 PC 端.移动端的 Web 动画,受限于硬件水平,在盒子端的表现的往往不尽如人意. 基于 ...
- 前端开发必备 40款优秀CSS代码编写工具推荐
摘要:CSS工具可以简化工作流,可以提高CSS编写速度,是开发者和设计者所不可缺少的.本文列举了40种CSS工具,功能涉及CSS菜单.动画.3D图形.响应式页面.图层.按钮等界面元素的设计与制作,你定 ...
- CSS特效汇集
http://www.lanrenzhijia.com/js/css3/ http://js.mobanwang.com/special/allcss/ 其他效果:http://www.cnblogs ...
随机推荐
- ajax事件(五)
建立和探索一个简单示例之后,现在可以深入了解XMLHttpRequest对象支持的功能,以及如何在你的请求中使用它们了.起点就是第二级规范里定义的那些额外事件.之前已经使用一个:readystatec ...
- JS错误记录 - 右侧悬浮框 - 缓冲运动
本次练习错误总结: 1. 正确: startMove( document.documentElement.clientHeight - oDiv.offsetHeight + scrollTop); ...
- RPC简易学习
0.RPC简介 RPC, 英文全称:Remote Process Call. 中文全称:远程过程调用. 客户端通过网络请求调用远程服务端对外暴露服务.常用的两种RPC协议:TCP.HTTP. ...
- 【CS Round #39 (Div. 2 only) B】Circle Elimination
[Link]:https://csacademy.com/contest/round-39/task/circle-elimination/ [Description] [Solution] 把n个点 ...
- [置顶]
Docker学习总结(3)——Docker实战之入门以及Dockerfile(三)
应用镜像 csphere/wordpress:4.2 # cd docker-training/wordpress/ # ls -a . license.txt wp-config-sample.ph ...
- understand软件使用教程(转)
源代码阅读工具(Scientific Toolworks Understand)的特色 1.支持多语言:Ada, C, C++, C#, Java, FORTRAN, Delphi, Jovial, ...
- 注意string的insert函数的几种形式
string (1) string& insert (size_t pos, const string& str); substring (2) string& insert ...
- RecyclerView下拉刷新和载入很多其它
之前一直写的是ListVIew下拉刷新,可是好多朋友都说要RecycleView的下拉刷新和滑动载入.事实上,这个原理都是几乎相同.抽出时间,我就写了下RecycleView的下拉刷新和滑动载入很多其 ...
- Onvif开发之Linux下gsoap的使用及移植
一直以来都是在CSDN上面学习别人的东西,很多次想写点什么但是又无从写起.由于公司项目需要,最近一段时间在研究onvif,在网上找了很多资料,发现资料是非常多,但是很少有比较全的资料,或者资料太多无从 ...
- sql查看依赖关系
select OBJECT_NAME(object_id) as name,object_NAME(referenced_major_id) as ref from sys.sql_dependenc ...