当前位置:网站首页>Page dynamics [2]keyframes
Page dynamics [2]keyframes
2022-07-03 16:09:00 【King of the devil】
CSS Dynamic effect
@keyframes yes transition Upgraded version . Compared with transition, Intermediate processes can be defined , You can also set cycle playback and so on .
For basic usage , No more narratives .
Next, we will first introduce the time function of animation .
function
General , When animating, you can choose the motion curve of the animation .
ease
ease In fact, it is the preset Bezier curve . You can define common motion curves .
ease,liner,ease-in,ease-out,ease-in-out
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-YPGFG8W7-1644808716437)(…/assets/easeCompe.gif)]
cubic-bezier()
Three Bessel curves , It is a function controlled by mathematical formula .
cubic-bezier(x1,y1,x2,y2)
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-PtDxxqYE-1644808716438)(…/assets/bezier.PNG)]
(x1,y1,x2,y2) Represents two handles , Control the animation motion curve .
The following website can adjust the appropriate Bessel curve by itself
https://cubic-bezier.com/
step
Stepping The way of is common in sequence frames ,
When playing a sequence frame , You can set the pictures of the sequence as the background , Then move the position of the background picture , Achieve an animated effect .
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-NXmz3rUq-1644808716439)(…/assets/ Sequence frame .jpg)]
Move the background image by stepping , You can make the sequence frame move .
transform
In the process of animation , The most common attribute is transform. Let's introduce transform Main points .
GPU Speed up
Optimize animation , You need to reduce page redrawing and rearrangement .
The biggest impact on performance is to change the width and height of elements without breaking away from the document flow , Animation such as position movement . This will affect most other elements .
Generally speaking , Only use on the elements that need to be transformed transform To transform, you can reduce the consumption of performance .
transform3d
transform3d The most important thing is perspective , Perspective is not set , Just like the ordinary transform There's no difference .
perspective It is used to set the viewing position of perspective .
Here are the elements rotateX(45deg) Result , One has no settings perspective, One set .
matrix(a, b, c, d, tx, ty)
stay transform in , have access to matrix To transform . Through matrix operation , To change the position and size .
$$\begin{bmatrix}
a&c&e\
b&d&f\
0&0&1\
\end{bmatrix}
.
\begin{bmatrix}
x\
y\
1\
\end{bmatrix}
\begin{bmatrix}
ax + cy + tx\
bx + dy + ty\
1\
\end{bmatrix}
$$
The formula of matrix transformation is :
x = ax + cy + tx
y = bx + dy + ty
above ;
x,y After calculation , Is the position after the transformation .
When translation is needed , You can set matrix(1, 0, 0, 1, tx, ty)
At this time , The operation becomes :
x = x + tx
y = y + ty
tx and ty Is the value of Translation .
Other rotations , The zoom , wait , Both can pass matrix To set it up . Here is just a simple operation .
The zoom
matrix(sx,0,0,sy,0,0)
rotate
matrix(cosθ,sinθ,-sinθ,cosθ,0,0)
The tensile
matrix(1,tan(θy),tan(θx),1,0,0)
边栏推荐
- Pyinstaller is not an internal or external command, nor is it a runnable program or batch file
- Redis high availability and persistence
- 切入点表达式
- Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (III)
- Stm32f103c8t6 firmware library lighting
- Nine ways to define methods in scala- Nine ways to define a method in Scala?
- Is it safe to open an account with tongdaxin?
- 突破100万,剑指200万!
- Effect of ARP package on FTP dump under vxworks-6.6 system
- Secsha system 1- login function
猜你喜欢

嵌入式开发:避免开源软件的7个理由
![App mobile terminal test [3] ADB command](/img/f1/4bff6e66b77d0f867bf7237019e982.png)
App mobile terminal test [3] ADB command

【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示

Getting started with Message Oriented Middleware
![[proteus simulation] 8 × 8LED dot matrix screen imitates elevator digital scrolling display](/img/46/c7f566f8fd46d383b055582d680bb7.png)
[proteus simulation] 8 × 8LED dot matrix screen imitates elevator digital scrolling display

Stm32f103c8t6 firmware library lighting

Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14

Microservices Seata distributed transactions

How to thicken the brush in the graphical interface

Srs4.0+obs studio+vlc3 (environment construction and basic use demonstration)
随机推荐
相同切入点的抽取
Srs4.0+obs studio+vlc3 (environment construction and basic use demonstration)
Salary 3000, monthly income 40000 by "video editing": people who can make money never rely on hard work!
Qt插件之自定义插件构建和使用
Subclass hides the function with the same name of the parent class
Initial test of scikit learn Library
近视:摘镜or配镜?这些问题必须先了解清楚
Hibernate的缓存机制/会话级缓存机制
Go语言自学系列 | golang中的if else if语句
Detailed explanation of four modes of distributed transaction (Seata)
First!! Is lancet hungry? Official documents
Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解
Large CSV split and merge
突破100万,剑指200万!
"Everyday Mathematics" serial 56: February 25
The accept attribute of the El upload upload component restricts the file type (detailed explanation of the case)
App mobile terminal test [5] file writing and reading
深度学习之三维重建