当前位置:网站首页>Animation, and basic use of animation
Animation, and basic use of animation
2022-07-20 21:10:00 【Dummerd】
One . Animation (animation) yes CSS3 One of the subversive features of , You can precisely control one or a group of animations by setting multiple nodes , Often used to achieve complex animation effects .
Compared with transition , Animation can make more changes , More control , Continuous automatic playback and other effects
Two . Basic use of animation
Making animation is divided into two steps :
1. Define animation first
2. Reuse ( call ) Animation
1. use keyframes Define animation ( Similar to defining class selectors )
@keyframes The name of the animation {
0%{
width:100px
}
100%{
width:200px
}
Animation sequence
0% It's animated Start ,100% It's animated complete , Such a rule is an animation sequence
stay @keyframes To stipulate in CSS style , You can create animation effects that gradually change from the current style to the new one
Animation is the effect of gradually changing elements from one style to another , You can change as many styles as you want, as many times as you want
Please use the percentage to specify when the change will occur , Or use keywords ‘form’ and ‘to’, Equate to 0% and 100%
About the example sentence, the following code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* from and to Equivalent to 0% and 100% */
div {
width: 200px;
height: 200px;
background-color: aqua;
/* The name of the animation */
animation-name: move;
/* Animation duration */
animation-duration: 4s;
}
/* Define animation The name of the animation itself */
/* @keyframes move{ */
/* Start state */
/* 0% perhaps */
/* from {
transform: translateX(0px);
}
End state 100% perhaps */
/* to {
transform: translateX(1000px);
}
} */
/* Define animation */
@keyframes move {
0% {
transform: translateX(0);
}
25% {
transform: translate(1000px, 0);
}
50% {
transform: translate(1000px, 500px);
}
75% {
transform: translate(0, 500px);
}
100% {
transform: translate(0);
}
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
3、 ... and . Commonly used attributes in animation
Four . Animation abbreviation properties
animation: The name of the animation The duration of the Motion curve When to start plays In the opposite direction Animation start or end state ;
for example : animation:myfirst 5s linear 2s infinite alternate;
1. The abbreviated attribute does not include animation-play-state
2. Pause animation :animation-play-state: puased; It is often used in conjunction with other tools such as the mouse
3. Want to come back , Instead of just jumping back :animation-direction:alternate
4. After the box animation , Stop at the end :animation-fill-mode:forwards
Speed curve details
animation-timing-function: Speed curve of specified animation , The default is “ease”
边栏推荐
- Depth traversal: count the number of nodes with the highest score
- Comment répondre aux exigences de sécurité de divers environnements en nuage à l'ère de l'économie numérique?
- Arrays. Sort() custom comparison function
- 第六届”蓝帽杯“全国大学生网络安全技能大赛WriteUp
- cookie增删改查和异常
- Introduction and use cases of iterator
- 数据分析就要用这款低代码报表工具
- 【文献笔记】PointMLP
- 《Reinforcement based mobile robot navigation in dynamic environment》翻译
- 103. (cesium chapter) cesium honeycomb diagram (square)
猜你喜欢
finance × Yuancosmos: financial system under the integration of reality and emptiness
node、nvm、nrm、npm、yarn使用教程
山西省第二届网络安全技能大赛(企业组)部分赛题WP(五)
枚举 联合
第六届”蓝帽杯“全国大学生网络安全技能大赛WriteUp
ECCV 2022 | Kuangshi proposed a semi supervised target detection model, dense teacher, which achieved SOTA performance
《Reinforcement based mobile robot navigation in dynamic environment》翻译
数据分析就要用这款低代码报表工具
手机浏览器的扫一扫功能在哪里,有什么作用
全网最强 JVM 来袭!
随机推荐
[untitled]
Node, NVM, NRM, NPM, and yarn tutorial
数字经济时代下如何满足多种云环境安全需求?
在线会议中人脸面部轮廓图像提取(三)——Dlib库人脸面部轮廓图像特征提取
NFT access tool premint was hacked, with a loss of more than 370000 US dollars
Hello, excuse me, the source system of the data integration job is SQLSEVER, and the table name is a keyword, which needs to be added in the sqlserver library
數字經濟時代下如何滿足多種雲環境安全需求?
Data distribution optimization: how to deal with data skew?
数据分析就要用这款低代码报表工具
Depth traversal: count the number of nodes with the highest score
scrapy爬虫框架基础知识
ORA-01460: 转换请求无法实施或不合理
Introduction and use cases of iterator
Getting started with kernel PWN (4)
cookie增删改查和异常
Local variables used by anonymous inner classes should be decorated with final
ThreadLocal夺命11连问
libenent 和libev
DNS principle and configuration
ICML2022 | XAI for Transformers:通过保守传播更好的解释