博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[React] Animate your user interface in React with styled-components and "keyframes"
阅读量:7233 次
发布时间:2019-06-29

本文共 707 字,大约阅读时间需要 2 分钟。

In this lesson, we learn how to handle CSS keyframe animations in styled-components, via the 'keyframes' helper.

 

import React from "react";import styled, { keyframes } from "styled-components";const morph = keyframes`  0% { border-radius: 5px; }  50% { border-radius: 50%; }  100% { border-radius: 5px; }`;const spin = keyframes`  from { transform: rotate(0deg); }  to { transform: rotate(360deg); }`;const Ball = styled.div`  width: 64px;  height: 64px;  border-radius: 50%;  margin: 0 auto;  background-color: #08aeea;  background-image: linear-gradient(0deg, #08aeea 0%, #2af598 100%);  animation: ${morph} 1s linear infinite, ${spin} 1s ease-in-out infinite;`;const App = () => 
;export default App;

 

转载地址:http://sdpfm.baihongyu.com/

你可能感兴趣的文章
rocketMq概念介绍
查看>>
Google推出iOS功能性UI测试框架EarlGrey
查看>>
busybox filesystem ts_config: No such file or directory
查看>>
Unity 3D第三人称视角、用途广泛限定角度(视角不能360度翻转)
查看>>
Spreading the Wealth uva 11300
查看>>
Eclipse 报java.lang.UnsupportedClassVersionError: ("yourclass") bad major version at offset=6
查看>>
快读快输板子
查看>>
vue中父组件给子组件额外添加参数
查看>>
分片上传
查看>>
网络编程初识和socket套接字
查看>>
什么是构造函数?它和普通函数的区别?
查看>>
mysql中key 、primary key 、unique key 与index区别
查看>>
zabbix使用企业微信发送告警信息
查看>>
zabbix4.0离线快速编译安装(编译安装方法)
查看>>
[Java开发之路](7)RandomAccessFile类详解
查看>>
Linux中的tty与pts
查看>>
Java socket示例(demo)TCP/IP
查看>>
error: WatchKit App doesn't contain any WatchKit Extensions whose WKAppBundleIdentifier matches
查看>>
计算UITextView的滑动高度
查看>>
AngularJs的UI组件ui-Bootstrap分享(四)——Datepicker Popup
查看>>