您现在的位置是:网站首页> 编程资料编程资料
逼真的HTML5树叶飘落动画html5结合Canvas实现的树叶飘落动画特效源码HTML5实现的树叶飘落动画特效源码基于HTML5+Webkit实现树叶飘落动画
2021-08-31
1250人已围观
简介 这篇文章主要为大家详细介绍了一款逼真的HTML5树叶飘落动画,树叶飘落的动画效果非常真实,树叶都是图片,并非CSS3绘制,感兴趣的小伙伴们可以参考一下
这款HTML5树叶飘落动画是基于webkit内核的,也就是说要在webkit内核的浏览器上才能使用这款动画。

HTML代码
XML/HTML Code复制内容到剪贴板
- <div id="container">
- <div id="leafContainer">div>
- <div id="message">
- <em>这是基于webkit的落叶动画em>
- div>
- div>
CSS代码
CSS Code复制内容到剪贴板
- #container {
- position: relative;
- height: 700px;
- width: 500px;
- margin: 10px auto;
- overflow: hidden;
- border: 4px solid #5C090A;
- background: #4E4226 url('images/backgroundLeaves.jpg') no-repeat top left;
- }
- /* Defines the position and dimensions of the leafContainer div */
- #leafContainer
- {
- position: absolute;
- width: 100%;
- height: 100%;
- }
- /* Defines the appearance, position, and dimensions of the message div */
- #message
- {
- position: absolute;
- top: 160px;
- width: 100%;
- height: 300px;
- background:transparent url('images/textBackground.png') repeat-x center;
- color: #5C090A;
- font-size: 220%;
- font-family: 'Georgia';
- text-align: center;
- padding: 20px 10px;
- -webkit-box-sizing: border-box;
- -webkit-background-size: 100% 100%;
- z-index: 1;
- }
- p {
- margin: 15px;
- }
- a
- {
- color: #5C090A;
- text-decoration: none;
- }
- /* Sets the color of the "Dino's Gardening Service" message */
- em
- {
- font-weight: bold;
- font-style: normal;
- }
- .phone {
- font-size: 150%;
- vertical-align: middle;
- }
- /* This CSS rule is applied to all div elements in the leafContainer div.
- It styles and animates each leafDiv.
- */
- #leafContainer > div
- {
- position: absolute;
- width: 100px;
- height: 100px;
- /* We use the following properties to apply the fade and drop animations to each leaf.
- Each of these properties takes two values. These values respectively match a setting
- for fade and drop.
- */
- -webkit-animation-iteration-count: infinite, infinite;
- -webkit-animation-direction: normal, normal;
- -webkit-animation-timing-function: linear, ease-in;
- }
- /* This CSS rule is applied to all img elements directly inside div elements which are
- directly inside the leafContainer div. In other words, it matches the 'img' elements
- inside the leafDivs which are created in the createALeaf() function.
- */
- #leafContainer > div > img {
- position: absolute;
- width: 100px;
- height: 100px;
- /* We use the following properties to adjust the clockwiseSpin or counterclockwiseSpinAndFlip
- animations on each leaf.
- The createALeaf function in the Leaves.js file determines whether a leaf has the
- clockwiseSpin or counterclockwiseSpinAndFlip animation.
- */
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: ease-in-out;
- -webkit-transform-origin: 50% -100%;
- }
- /* Hides a leaf towards the very end of the animation */
- @-webkit-keyframes fade
- {
- /* Show a leaf while into or below 95 percent of the animation and hide it, otherwise */
-
相关内容
- HTML5+CSS3绘制锯齿状的矩形纯css3绘制的小黄人头像动画特效源码纯css3绘制的QQ企鹅动画特效源码纯css3绘制的精美购物优惠券样式效果源码纯css3绘制的哆啦a梦机器猫头像效果源码CSS3绘制不规则图形的一些方法示例使用HTML和CSS3绘制基本卡通图案的示例分享CSS3绘制圆角矩形的简单示例使用CSS3来绘制一个月食图案用CSS3绘制三角形的简单方法纯CSS3绘制打火机动画火焰效果
- 使用HTML5中的contentEditable来将多行文本自动增高contenteditable元素的placeholder输入提示语设置方法设置contenteditable属性可编辑HTML标签的内容(可代替textarea)当div设置contentEditable=true时,重置其内容后无法光标定位
- 解析HTML5中的新功能本地存储localStorageHTML5 LocalStorage 本地存储详细概括(多图)html5 localStorage本地存储_动力节点Java学院整理localstorage和sessionstorage使用记录(推荐)详解HTML5 LocalStorage 本地存储 html5本地存储 localStorage操作使用详解HTML5 本地存储 LocalStorage详解HTML5中Localstorage的使用教程localStorage的过期时间设置的方法详解
- 实例讲解使用SVG制作loading加载动画的方法基于SVG实现点击按钮loading加载特效源码HTML5 SVG实现的Loading动画加载特效源码
- 移动端HTML5实现文件上传功能【附代码】HTML5 文件上传下载的实例代码HTML5拖拉上传文件的简单实例HTML5应用之文件上传HTML5+WebSocket实现多文件同时上传的实例移动端HTML5实现文件上传html5实现多文件的上传示例代码HTML5拖拽文件到浏览器并实现文件上传下载功能代码HTML5 form标签之解放表单验证、增加文件上传、集成拖放的使用方法HTML5 FormData 方法介绍以及实现文件上传示例
- HTML5触摸事件演化tap事件介绍html5触摸事件判断滑动方向的实现HTML5触摸事件实现移动端简易进度条的实现方法整理HTML5移动端开发的常用触摸事件HTML5触摸事件(touchstart、touchmove和touchend)的实现
- html5生成柱状图(条形图)效果的实例代码html5中canvas图表实现柱状图的示例
- 用html5绘制折线图的实例代码移动端HTML5实现文件上传功能【附代码】深入研究HTML5实现图片压缩上传功能HTML5触摸事件演化tap事件介绍jQuery+html5实现企业年会数字抽奖特效源码html5生成柱状图(条形图)效果的实例代码详解HTML5 Canvas绘制时指定颜色与透明度的方法实例讲解使用HTML5 Canvas绘制阴影效果的方法移动web模拟客户端实现多方框输入密码效果【附代码】
- 详解HTML5 Canvas绘制时指定颜色与透明度的方法移动端HTML5实现文件上传功能【附代码】深入研究HTML5实现图片压缩上传功能HTML5触摸事件演化tap事件介绍jQuery+html5实现企业年会数字抽奖特效源码html5生成柱状图(条形图)效果的实例代码用html5绘制折线图的实例代码实例讲解使用HTML5 Canvas绘制阴影效果的方法移动web模拟客户端实现多方框输入密码效果【附代码】
- 实例讲解使用HTML5 Canvas绘制阴影效果的方法canvas 阴影和图形变换的示例代码HTML5 canvas基本绘图之绘制阴影效果html5实现canvas阴影效果示例HTML5 Canvas阴影使用方法实例演示canvas多重阴影发光效果实现
点击排行
本栏推荐
