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的更多相关文章

  1. 【翻译】CSS Animations VS the Web Animations API:案例学习

    原文地址:CSS Animations vs the Web Animations API: A Case Study May 03, 2017 css, javascript 上周我写了我如何使用C ...

  2. 'Attempt to create two animations for cell' iOS

    我是在对一个UITableView 一起进行 reloadRows和reloadSections 的操作的时候 出现的

  3. 【转】Styling And Animating SVGs With CSS

    原文转自:http://www.smashingmagazine.com/2014/11/03/styling-and-animating-svgs-with-css/?utm_source=CSS- ...

  4. AngularJS学习--- 动画操作 (Applying Animations) ngAnimate step 12

    1.切换目录 git checkout step-12 npm start 2.效果图 这里在点击右边的缩略图时,会有一个很明显的从下向上的动画过程. 3.代码实现: step11和step12之间的 ...

  5. Styling FX Buttons with CSS

    http://fxexperience.com/2011/12/styling-fx-buttons-with-css/ ——————————————————————————————————————— ...

  6. 动画操作 (Applying Animations) ngAnimate12

    动画操作 (Applying Animations) ngAnimate step 12 1.切换目录 git checkout step-12 npm start 2.效果图 这里在点击右边的缩略图 ...

  7. 盒子端 CSS 动画性能提升研究

    不同于传统的 PC Web 或者是移动 WEB,在腾讯视频客厅盒子端,接大屏显示器(电视)下,许多能流畅运行于 PC 端.移动端的 Web 动画,受限于硬件水平,在盒子端的表现的往往不尽如人意. 基于 ...

  8. 前端开发必备 40款优秀CSS代码编写工具推荐

    摘要:CSS工具可以简化工作流,可以提高CSS编写速度,是开发者和设计者所不可缺少的.本文列举了40种CSS工具,功能涉及CSS菜单.动画.3D图形.响应式页面.图层.按钮等界面元素的设计与制作,你定 ...

  9. CSS特效汇集

    http://www.lanrenzhijia.com/js/css3/ http://js.mobanwang.com/special/allcss/ 其他效果:http://www.cnblogs ...

随机推荐

  1. C# 将引用的DLL文件放到指定的目录下

    原文:C# 将引用的DLL文件放到指定的目录下 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/sweety820/article/details/2 ...

  2. cron 简单任务调度 go

    package main import ( "github.com/robfig/cron" "log" ) func main() { i := 0 c := ...

  3. poj3244(公式题)

    Difference between Triplets Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 2476   Acce ...

  4. IK分词器插件elasticsearch-analysis-ik 6.1.1

    http://88250.b3log.org/full-text-search-elasticsearch#b3_solo_h3_0 IK分词器插件 (1)源码 https://github.com/ ...

  5. 杠杆(leverage)就是支付保证金借钱进行交易,以小博大

    杠杆(leverage)就是支付保证金借钱进行交易,以小博大: 比如你自己有100块,在向券商借100块,这就是杠杆交易了,杠杆简单地说来就是一个乘号,使用这个工具,可以放大投资的结果,无论最终的结果 ...

  6. CISP/CISA 每日一题 16

    CISA 每日一题(答) 作业调度软件的优点: 1.作业信息仅需建立一次,减少错误发生概率: 2.可定义作业间的依赖关系,当某一项作业失败时,依赖于该作业的后续作业就不会被执行: 3.所有成功或失败的 ...

  7. install-软件安装跟push的区别

    今天在做项目的时候,需要往一个user版本的手机中安装一个应用,就在网上查了相应的方法,可以使用如下命令 adb install -r out/target/product/vanzo6752_lwt ...

  8. 90.#define高级用法

    define把参数变成字符串 #define f(x) printf("%s",#x); define连接两个字符串 #define a(x) a##x define把参数变成字符 ...

  9. import 与export详解

    ES6 1.export default 其他模块加载该模块时,import命令可以为该匿名函数指定任意名字. 如: import Vue from 'vue' vue里面的第三方模块都是用了这个 使 ...

  10. Android车载导航的一些困境

    车载导航从最初的用解码芯片,过渡到用WinCE系统,已经形成了一个较大的产业.车载导航使用上的一些大原则,基本上被固定了下来.如今WinCE走到了尽头,Android车载导航開始发力,但由于Andro ...