This challenge animates an element to replicate the movement of a ball being juggled. Prior challenges covered the linear and ease-out cubic Bezier curves, however neither depicts the juggling movement accurately. You need to customize a Bezier curve for this.

The animation-timing-function automatically loops at every keyframe when the animation-iteration-count is set to infinite. Since there is a keyframe rule set in the middle of the animation duration (at 50%), it results in two identical animation progressions at the upward and downward movement of the ball.

The following cubic Bezier curve simulates a juggling movement:

cubic-bezier(0.3, 0.4, 0.5, 1.6);

Notice that the value of y2 is larger than 1. Although the cubic Bezier curve is mapped on an 1 by 1 coordinate system, and it can only accept x values from 0 to 1, the y value can be set to numbers larger than one. This results in a bouncing movement that is ideal for simulating the juggling ball.

练习题目:

Change value of the animation-timing-function of the element with the id of green to a cubic-bezier function with x1, y1, x2, y2 values set respectively to 0.311, 0.441, 0.444, 1.649.

练习代码:

 <style>
.balls {
border-radius: 50%;
position: fixed;
width: 50px;
height: 50px;
top: 60%;
animation-name: jump;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#red {
background: red;
left: 25%;
animation-timing-function: linear;
}
#blue {
background: blue;
left: 50%;
animation-timing-function: cubic-bezier(0.311,0.441,0.444,1.649);
}
#green {
background: green;
left: 75%;
animation-timing-function: cubic-bezier(0.69, 0.1, 1, 0.1);
} @keyframes jump {
50% {
top: 10%;
}
}
</style>
<div class="balls" id="red"></div>
<div class="balls" id="blue"></div>
<div class="balls" id="green"></div>

效果如下:

FCC---Make Motion More Natural Using a Bezier Curve--- juggling movement的更多相关文章

  1. 插值技术之Bezier插值(1) -- Bezier Curve

    作者:i_dovelemon 来源:CSDN 日期:2015 / 7 / 11 主题:Interpolate,Bezier Curve 引言 在游戏开发中.诸如动画系统.路径计算等等操作,都会遇到对数 ...

  2. 计算机图形学:贝塞尔曲线(Bezier Curve)

    计算机图形学:贝塞尔曲线(Bezier Curve) 贝塞尔能由贝塞尔样条组合而成,也可产生更高维的贝塞尔曲面.

  3. OpenCASCADE Rational Bezier Curves

    OpenCASCADE Rational Bezier Curves eryar@163.com Abstract. Although polynomials offer many advantage ...

  4. Bezier(贝塞尔)曲线简介

    在计算机图形学中,Bezier曲线被广泛用于对平滑的曲线进行建模,对其有适当的了解是必要的.一条Bezier曲线由一系列控制点定义,称为曲线的阶数,由此可知,使用两个控制点()可以定义一条一阶Bezi ...

  5. 实验6 Bezier曲线生成

    1.实验目的: 了解曲线的生成原理,掌握几种常见的曲线生成算法,利用VC+OpenGL实现Bezier曲线生成算法. 2.实验内容: (1) 结合示范代码了解曲线生成原理与算法实现,尤其是Bezier ...

  6. 插入2D点,在WPF中使用Bezier曲线

    原文Interpolate 2D points, usign Bezier curves in WPF Interpolate 2D points, usign Bezier curves in WP ...

  7. FCC---Learn How Bezier Curves Work---定义坐标轴点的值,影响斜率,改变速度。具体调试换值既可以体会

    The last challenge introduced the animation-timing-function property and a few keywords that change ...

  8. python bezier 曲线

    1.手写bezier公式,生成bezier代码, 如果给的点数过多,则会生成一半bezier曲线,剩下的一半就需要进行拼接: import numpy as np import matplotlib. ...

  9. Framework for Graphics Animation and Compositing Operations

    FIELD OF THE DISCLOSURE The subject matter of the present disclosure relates to a framework for hand ...

随机推荐

  1. Java描述设计模式(13):迭代器模式

    本文源码:GitHub·点这里 || GitEE·点这里 一.迭代器模式 1.基础概念 迭代器模式又叫游标模式,是对象的行为模式.迭代器模式可以顺序地访问一个聚集中的元素而不必暴露聚集的内部表象. 2 ...

  2. Java题库——Chapter4 循环

    1)How many times will the following code print "Welcome to Java"? int count = 0; while (co ...

  3. 基于Spring Boot+Spring Security+JWT+Vue前后端分离的开源项目

    一.前言 最近整合Spring Boot+Spring Security+JWT+Vue 完成了一套前后端分离的基础项目,这里把它开源出来分享给有需要的小伙伴们 功能很简单,单点登录,前后端动态权限配 ...

  4. 立 Flag

    行动目标 立Flag时间 计划开始时间 开始时间 行动寄语 通关目标 打卡1 打卡2 打卡3 打卡4 打卡5 打卡6 C# 7.0 核心技术指南 2019-11-1 1号 1号 打好C#基础 看完.实 ...

  5. ios11下适配UItableView

    参考链接: https://www.cnblogs.com/spider-pei/p/7592906.html

  6. mysql-installer-community-8.0.17.0.msi安装教程

    1.官网 https://dev.mysql.com/downloads/file/?id=488055 我选择自定义安装 注意这里是可以设置路径的,否则是默认地址 然后一直下一步就好 也是一路下一步 ...

  7. MarkDown使用小技巧

    写作目的 笔者看完一些MarkDown入门文字后,发现很多文档对一些容易遇到的细微问题缺少解释.本文意欲稍作补充. 目标读者 使用MarkDown仅为了排版出更好看的文章,而不关注技术细节,不懂HTM ...

  8. mysql五大引擎的区别和优劣之分

    数据库引擎介绍 MySQL数据库引擎取决于MySQL在安装的时候是如何被编译的.要添加一个新的引擎,就必须重新编译MYSQL.在缺省情况下,MYSQL支持三个引擎:ISAM.MYISAM和HEAP.另 ...

  9. mysql导出数据的几种形式-待更新

    1.导出某个数据库的某张表,添加where条件 mysqldump -u [用户名] -p  -h [ip地址]  --default-character-set=utf8 [数据库名] [表名] - ...

  10. 剑指Offer-28.数组中出现次数超过一半的数字(C++/Java)

    题目: 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字.例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}.由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2.如 ...