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 ...
随机推荐
- 如何使用SpringBoot封装自己的Starter
作者:Sans_ juejin.im/post/5cb880c2f265da03981fc031 一.说明 我们在使用SpringBoot的时候常常要引入一些Starter,例如spring-boot ...
- 项目部署到Linux上遇到的坑
作者:晨钟暮鼓c个人微信公众号:程序猿的月光宝盒 1.本地Navicat for MySQL无法连接至服务器(Centos 7 x86_64 bbr) 1045错误: 解决步骤: 1.查看用户名密 ...
- javaWeb核心技术第九篇之JSP
JSP:全名是Java Server Pages,它是建立在Servlet规范之上的动态网页开发技术.在JSP文件中,HTML代码与Java代码共同存在,其中,HTML代码用来实现网页中静态内容的显示 ...
- IDEA中GitLab的使用
首先安装git https://git-scm.com/downloads/ 下载对应的版本 下载好了,安装打开 Windows. 打开之后2步走,与git连接 首先选择仓库,进行git init本地 ...
- 11.JavaCC官方入门指南-例6
例6:计算器--添加括号.一元运算符和历史记录 1.calculator3.jj 我们只需要再添加一些特色,就可以得到一个可用的四则运算计算器.在这一版的修改中 ,我们将使得程序可以接收括号.负值 ...
- 利用Flask中的werkzeug.security模块加密
1.这种加密方式的原理:加密时混入一段"随机"字符串(盐值)再进行哈希加密.即使 密码相同,如果盐值不同,那么哈希值也是不一样的.现在网站开发中主要是运 用这种加密方法. 2.这个 ...
- 以太网驱动的流程浅析(五)-mii_bus初始化以及phy id的获取【原创】
以太网驱动的流程浅析(五)-mii_bus初始化以及phy id的获取 Author:张昺华 Email:920052390@qq.com Time:2019年3月23日星期六 此文也在我的个人公众号 ...
- 3-3 用户管理-新建用户useradd和passwd
3.用户管理 终端命令 提示:创建用户/删除用户/修改其他用户密码的终端命令都需要通过sudo执行 3.1创建用户/修改密码/删除用户 序号 命令 作用 说明 01 useradd -m -g 组 新 ...
- JVM java内存区域的介绍
jvm虚拟机在运行时需要用到的内存区域.广泛一点就是堆和栈,其实不然,堆和栈只是相对比较笼统的说法,真正区分有如下几个 先上图一: 总的就是 java的内存模型 内存模型又分堆内存(heap)和方法区 ...
- 题解:SPOJ1026 Favorite Dice
原题链接 题目大意 给你一个n个面的骰子,每个面朝上的几率相等,问每个面都被甩到的期望次数 题解 典型的赠券收集问题. 我们考虑当你手上已有\(i\)种不同的数,从集合中任选一个数得到新数的概率,为\ ...