css - CSS3 动画计时函数 cubic-bezier() 的参数是什么意思?

标签 css math css-transitions css-animations

您将 cubic-bezier 传递给四个不同的实数值,它会创建一条贝塞尔曲线。

例如,cubic-bezier(0,0,1,1) 创建一条线性 曲线。 cubic-bezier(0.25,0.1,0.25,1) 创建一个ease 曲线。

但是a cubic bezier curve is defined by four points on a plane ,我们只有四个实际值,只能描述两个点。

那么这些数字是什么意思呢?

最佳答案

来自MDN :

A cubic Bézier curve is defined by four points P0, P1, P2, and P3. P0 and P3 are the start and the end of the curve and, in CSS these points are fixed as the coordinates are ratios (the abscissa the ratio of time, the ordinate the ratio of the output range). P0 is (0, 0) and represents the initial time and the initial state, P3 is (1, 1) and represents the final time and the final state.

因此起点和终点自动固定在 (0, 0) 和 (1, 1) - 您实际上是在设置内部两个点(P1 和 P2)。

关于css - CSS3 动画计时函数 cubic-bezier() 的参数是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38898668/

相关文章:

html - 如何集中左侧导航

python - Python 两点中间的垂直线

java - 如何显示用户插入的指数函数的展开形式?

c# - 如何四舍五入到一半,总是朝正方向?

css - 左边距过渡不动画

css - 使用可以平滑中断的延迟或关键帧的排队 CSS 动画

css - <!--[if !IE]><!--> 不工作

css - Cakephp 添加样式到 h($product ['Product' ] ['name' ]);

css - 当父位置是相对的时,文本显示在 <div> 之外

javascript - 在添加和删除两个类之间添加动画