FCC---Make Motion More Natural Using a Bezier Curve--- juggling movement
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的更多相关文章
- 插值技术之Bezier插值(1) -- Bezier Curve
作者:i_dovelemon 来源:CSDN 日期:2015 / 7 / 11 主题:Interpolate,Bezier Curve 引言 在游戏开发中.诸如动画系统.路径计算等等操作,都会遇到对数 ...
- 计算机图形学:贝塞尔曲线(Bezier Curve)
计算机图形学:贝塞尔曲线(Bezier Curve) 贝塞尔能由贝塞尔样条组合而成,也可产生更高维的贝塞尔曲面.
- OpenCASCADE Rational Bezier Curves
OpenCASCADE Rational Bezier Curves eryar@163.com Abstract. Although polynomials offer many advantage ...
- Bezier(贝塞尔)曲线简介
在计算机图形学中,Bezier曲线被广泛用于对平滑的曲线进行建模,对其有适当的了解是必要的.一条Bezier曲线由一系列控制点定义,称为曲线的阶数,由此可知,使用两个控制点()可以定义一条一阶Bezi ...
- 实验6 Bezier曲线生成
1.实验目的: 了解曲线的生成原理,掌握几种常见的曲线生成算法,利用VC+OpenGL实现Bezier曲线生成算法. 2.实验内容: (1) 结合示范代码了解曲线生成原理与算法实现,尤其是Bezier ...
- 插入2D点,在WPF中使用Bezier曲线
原文Interpolate 2D points, usign Bezier curves in WPF Interpolate 2D points, usign Bezier curves in WP ...
- FCC---Learn How Bezier Curves Work---定义坐标轴点的值,影响斜率,改变速度。具体调试换值既可以体会
The last challenge introduced the animation-timing-function property and a few keywords that change ...
- python bezier 曲线
1.手写bezier公式,生成bezier代码, 如果给的点数过多,则会生成一半bezier曲线,剩下的一半就需要进行拼接: import numpy as np import matplotlib. ...
- Framework for Graphics Animation and Compositing Operations
FIELD OF THE DISCLOSURE The subject matter of the present disclosure relates to a framework for hand ...
随机推荐
- (五十六)c#Winform自定义控件-瓶子(工业)-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- Ruby中星号打包解包操作
Ruby中可以使用一个星号*和两个星号**完成一些打包.解包操作,它们称为splat操作符: 一个星号:以数组为依据进行打包解包(参考文章) 两个星号:以hash为依据进行打包解包(参考文章) 两个星 ...
- Linux配置部署_新手向(三)——MySql安装与配置
目录 前言 安装 防火墙 小结 前言 马上就要放假了,按捺不住激动的心情(其实是实在敲不下去代码),就继续鼓捣虚拟机来做些常规的安装与使用吧,毕竟闲着也是闲着,唉,opengl还是难啊. 安装 其实网 ...
- docker: manifest for elasticsearch:latest not found
今天在docker安装es出现坑,是这样. 使用: docker pull elasticsearch 提示:manifest for elasticsearch:latest not found如图 ...
- Change Field Layout and Visibility in a List View 在列表视图中更改字段布局和可见性
This lesson will guide you through the steps needed to select columns displayed in the List View. Fo ...
- 松软科技前端课堂:JavaScript 对象
真实生活中的对象.属性和方法 在真实生活中,汽车是一个对象. 汽车有诸如车重和颜色等属性,也有诸如启动和停止的方法: 对象 属性 方法 car.name = porsche car.model = ...
- vue中使用router打开一个新的窗口
一个单页应用打开一个新的窗口不是很好控制,比如权限的处理,因为原先的页面不会自动刷新,方法很简单: let routeData = this.$router.resolve({ name: " ...
- SpringBoot高版本修改为低版本时测试类报错解决
有时在使用idea通过Spring Initailizr创建项目时,默认只能创建最近的版本的SpringBoot项目. 这是如果想要换成版本,就可以在项目创建好了之后,在pom文件中直接将版本修改过来 ...
- centos7.6使用openssl生成CA签署的证书个人实验笔记
准备:客户端centos6.10 服务端Centos7.6 实验:客户端生成证书请求,服务端颁发证书,最后吊销其中一个证书 1.先在服务端上的/etc/pki/CA/目录生成rsa的私钥: 2.在服 ...
- 苏州市java岗位的薪资状况(2)
上一篇已经统计出了起薪最高的top 10: 接着玩,把top 10 中所有职位的详细信息爬取下来.某一职位的详情是这样: 我们需要把工作经验.学历.职能.关键字爬取下来. from urllib.re ...