--- id: 587d78a9367417b2b2512aea title: Make Motion More Natural Using a Bezier Curve challengeType: 0 videoUrl: '' localeTitle: 使用贝塞尔曲线使运动更自然 --- ## Description
这一挑战激发了一个元素来复制被玩杂耍的球的运动。先前的挑战涵盖了linearease-out三次贝塞尔曲线,但两者都没有准确描述杂耍运动。您需要为此自定义Bezier曲线。当animation-iteration-count设置为无限时, animation-timing-function在每个关键帧处自动循环。由于在动画持续时间的中间设置了关键帧规则( 50% ),因此在球的向上和向下移动时会产生两个相同的动画进度。下面的三次贝塞尔曲线模拟了一个杂耍运动: cubic-bezier(0.3, 0.4, 0.5, 1.6);请注意,y2的值大于1.虽然三次贝塞尔曲线映射在1乘1坐标系上,并且它只能接受0到1的x值,但y值可以设置为大于1的数字。这导致弹跳运动,非常适合模拟杂耍球。
## Instructions
将id为green的元素的animation-timing-function的值更改为cubic-bezier函数,x1,y1,x2,y2值分别设置为0.311,0.441,0.444,1.648。
## Tests
```yml tests: - text: 具有id green的元素的animation-timing-function属性的值应该是具有指定的x1,y1,x2,y2值的cubic-bezier函数。 testString: 'assert($("#green").css("animation-timing-function") == "cubic-bezier(0.311, 0.441, 0.444, 1.649)", "The value of the animation-timing-function property for the element with the id green should be a cubic-bezier function with x1, y1, x2, y2 values as specified.' ```
## Challenge Seed
```html
```
## Solution
```js // solution required ```