纯CSS3实现3D跳动小球
请使用Chrome,火狐的浏览器查看本页面,使用IE将看不到效果。如果在本页看不到一个跳动的小球,请确定您的浏览器支持CSS3,或者访问http://keleyi.com/a/bjac/iphgrtqm.htm 看看。
以下是源代码:
 <!--[if IE]><style>.main-keleyi-com{display:none;}#ballWrapper_keleyi_com{display:none;}</style><![endif]-->
 <style type="text/css">/* 代码整理:柯乐义 keleyi.com */
 * {
 margin:0;
 padding:0;
 }
 #ballWrapper_keleyi_com {
 width: 140px;
 height: 300px;
 position: fixed;
 left: 50%;
 top: 35%;
 margin-left: -70px;
 z-index: 100;
 -webkit-transform: scale(1);
 -moz-transform: scale(1);
 -ms-transform: scale(1);
 -o-transform: scale(1);
 transform: scale(1);
 -webkit-transition: all 5s linear 0s;
 -moz-transition: all 5s linear 0s;
 transition: all 5s linear 0s;
 cursor: pointer;
 }
 #ballWrapper_keleyi_com:active {
 -webkit-transform: scale(0);
 -moz-transform: scale(0);
 -ms-transform: scale(0);
 -o-transform: scale(0);
 transform: scale(0);
 cursor: pointer;
 }
 #ball {
 width: 140px;
 height: 140px;
 border-radius: 70px;
 background: rgb(187,187,187);
 background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk5JSIgc3RvcC1jb2xvcj0iIzc3Nzc3NyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
 background: -moz-linear-gradient(top, rgba(187, 187, 187, 1) 0%, rgba(119, 119, 119, 1) 99%);
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(187, 187, 187, 1)), color-stop(99%, rgba(119, 119, 119, 1)));
 background: -webkit-linear-gradient(top, rgba(187, 187, 187, 1) 0%, rgba(119, 119, 119, 1) 99%);
 background: -o-linear-gradient(top, rgba(187, 187, 187, 1) 0%, rgba(119, 119, 119, 1) 99%);
 background: -ms-linear-gradient(top, rgba(187, 187, 187, 1) 0%, rgba(119, 119, 119, 1) 99%);
 background: linear-gradient(top, rgba(187, 187, 187, 1) 0%, rgba(119, 119, 119, 1) 99%);
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bbbbbb', endColorstr='#777777', GradientType=0 );
 box-shadow: inset 0 -5px 15px rgba(255, 255, 255, 0.4), inset -2px -1px 40px rgba(0, 0, 0, 0.4), 0 0 1px #000;
 position: absolute;
 top: 0;
 z-index: 11;
 -webkit-animation: jump 1s infinite;
 -moz-animation: jump 1s infinite;
 -o-animation: jump 1s infinite;
 -ms-animation: jump 1s infinite;
 animation: jump 1s infinite;
 cursor: pointer;
 }/* 代码整理:柯 乐 义 k e l e y i.com */
 #ball::after {
 content: "";
 width: 80px;
 height: 40px;
 position: absolute;
 left: 30px;
 top: 10px;
 z-index: 10;
 background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2U4ZThlOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjElIiBzdG9wLWNvbG9yPSIjZThlOGU4IiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
 background: -moz-linear-gradient(top, rgba(232, 232, 232, 1) 0%, rgba(232, 232, 232, 1) 1%, rgba(255, 255, 255, 0) 100%);
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(232, 232, 232, 1)), color-stop(1%, rgba(232, 232, 232, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
 background: -webkit-linear-gradient(top, rgba(232, 232, 232, 1) 0%, rgba(232, 232, 232, 1) 1%, rgba(255, 255, 255, 0) 100%);
 background: -o-linear-gradient(top, rgba(232, 232, 232, 1) 0%, rgba(232, 232, 232, 1) 1%, rgba(255, 255, 255, 0) 100%);
 background: -ms-linear-gradient(top, rgba(232, 232, 232, 1) 0%, rgba(232, 232, 232, 1) 1%, rgba(255, 255, 255, 0) 100%);
 background: linear-gradient(top, rgba(232, 232, 232, 1) 0%, rgba(232, 232, 232, 1) 1%, rgba(255, 255, 255, 0) 100%);
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e8e8e8', endColorstr='#00ffffff', GradientType=0 );
 border-radius: 40px / 20px;
 }
 #ballShadow {
 position: absolute;
 left: 50%;
 bottom: 0;
 z-index: 10;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -webkit-transform: scaleY(.3);
 -moz-transform: scaleY(.3);
 -ms-transform: scaleY(.3);
 -o-transform: scaleY(.3);
 transform: scaleY(.3);
 -webkit-animation: shrink 1s infinite;
 -moz-animation: shrink 1s infinite;
 -o-animation: shrink 1s infinite;
 -ms-animation: shrink 1s infinite;
 animation: shrink 1s infinite;
 }
 /* Animations */
 @-webkit-keyframes jump {
 0% {
 top: 0;
 -webkit-animation-timing-function: ease-in;
 }
 40% {
 }
 50% {
 top: 140px;
 height: 140px;
 -webkit-animation-timing-function: ease-out;
 }
 55% {
 top: 160px;
 height: 120px;
 border-radius: 70px / 60px;
 -webkit-animation-timing-function: ease-in;
 }
 65% {
 top: 120px;
 height: 140px;
 border-radius: 70px;
 -webkit-animation-timing-function: ease-out;
 }
 95% {
 top: 0;
 -webkit-animation-timing-function: ease-in;
 }
 100% {
 top: 0;
 -webkit-animation-timing-function: ease-in;
 }
 }
 @-moz-keyframes jump {
 0% {
 top: 0;
 -moz-animation-timing-function: ease-in;
 }
 40% {
 }
 50% {
 top: 140px;
 height: 140px;
 -moz-animation-timing-function: ease-out;
 }
 55% {
 top: 160px;
 height: 120px;
 border-radius: 70px / 60px;
 -moz-animation-timing-function: ease-in;
 }
 65% {
 top: 120px;
 height: 140px;
 border-radius: 70px;
 -moz-animation-timing-function: ease-out;
 }
 95% {
 top: 0;
 -moz-animation-timing-function: ease-in;
 }
 100% {
 top: 0;
 -moz-animation-timing-function: ease-in;
 }
 }
 @-o-keyframes jump {
 0% {
 top: 0;
 -o-animation-timing-function: ease-in;
 }
 40% {
 }
 50% {
 top: 140px;
 height: 140px;
 -o-animation-timing-function: ease-out;
 }
 55% {
 top: 160px;
 height: 120px;
 border-radius: 70px / 60px;
 -o-animation-timing-function: ease-in;
 }
 65% {
 top: 120px;
 height: 140px;
 border-radius: 70px;
 -o-animation-timing-function: ease-out;
 }
 95% {
 top: 0;
 -o-animation-timing-function: ease-in;
 }
 100% {
 top: 0;
 -o-animation-timing-function: ease-in;
 }
 }
 @-ms-keyframes jump {
 0% {
 top: 0;
 -ms-animation-timing-function: ease-in;
 }
 40% {
 }
 50% {
 top: 140px;
 height: 140px;
 -ms-animation-timing-function: ease-out;
 }
 55% {
 top: 160px;
 height: 120px;
 border-radius: 70px / 60px;
 -ms-animation-timing-function: ease-in;
 }
 65% {
 top: 120px;
 height: 140px;
 border-radius: 70px;
 -ms-animation-timing-function: ease-out;
 }
 95% {
 top: 0;
 -ms-animation-timing-function: ease-in;
 }
 100% {
 top: 0;
 -ms-animation-timing-function: ease-in;
 }
 }
 @keyframes jump {
 0% {
 top: 0;
 animation-timing-function: ease-in;
 }
 50% {
 top: 140px;
 height: 140px;
 animation-timing-function: ease-out;
 }
 55% {
 top: 160px;
 height: 120px;
 border-radius: 70px / 60px;
 animation-timing-function: ease-in;
 }
 65% {
 top: 120px;
 height: 140px;
 border-radius: 70px;
 animation-timing-function: ease-out;
 }
 95% {
 top: 0;
 animation-timing-function: ease-in;
 }
 100% {
 top: 0;
 animation-timing-function: ease-in;
 }
 }
 @-webkit-keyframes shrink {
 0% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -webkit-animation-timing-function: ease-in;
 }
 50% {
 bottom: 30px;
 margin-left: -10px;
 width: 20px;
 height: 5px;
 background: rgba(20, 20, 20, .3);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .3);
 border-radius: 20px / 20px;
 -webkit-animation-timing-function: ease-out;
 }
 100% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -webkit-animation-timing-function: ease-in;
 }
 }
 @-moz-keyframes shrink {
 0% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -moz-animation-timing-function: ease-in;
 }
 50% {
 bottom: 30px;
 margin-left: -10px;
 width: 20px;
 height: 5px;
 background: rgba(20, 20, 20, .3);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .3);
 border-radius: 20px / 20px;
 -moz-animation-timing-function: ease-out;
 }
 100% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -moz-animation-timing-function: ease-in;
 }
 }
 @-o-keyframes shrink {
 0% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -o-animation-timing-function: ease-in;
 }
 50% {
 bottom: 30px;
 margin-left: -10px;
 width: 20px;
 height: 5px;
 background: rgba(20, 20, 20, .3);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .3);
 border-radius: 20px / 20px;
 -o-animation-timing-function: ease-out;
 }
 100% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -o-animation-timing-function: ease-in;
 }
 }
 @-ms-keyframes shrink {
 0% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -ms-animation-timing-function: ease-in;
 }
 50% {
 bottom: 30px;
 margin-left: -10px;
 width: 20px;
 height: 5px;
 background: rgba(20, 20, 20, .3);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .3);
 border-radius: 20px / 20px;
 -ms-animation-timing-function: ease-out;
 }
 100% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 -ms-animation-timing-function: ease-in;
 }
 }
 @keyframes shrink {
 0% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 animation-timing-function: ease-in;
 }
 50% {
 bottom: 30px;
 margin-left: -10px;
 width: 20px;
 height: 5px;
 background: rgba(20, 20, 20, .3);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .3);
 border-radius: 20px / 20px;
 animation-timing-function: ease-out;
 }
 100% {
 bottom: 0;
 margin-left: -30px;
 width: 60px;
 height: 75px;
 background: rgba(20, 20, 20, .1);
 box-shadow: 0px 0 20px 35px rgba(20, 20, 20, .1);
 border-radius: 30px / 40px;
 animation-timing-function: ease-in;
 }
 }
 /* 代码整理:柯乐义 keleyi.com */</style>
 <div style="width:600px;margin:10px auto 20px auto; padding:0 0 0 10px;overflow:hidden">
 <section class="main-keleyi-com">
 <div id="ballWrapper_keleyi_com">
 <div id="ball"></div>
 <div id="ballShadow"></div>
 </div>
 </section>
 </div>
另一个css3动画:http://keleyi.com/a/bjac/nmwpqgag.htm
更多:http://www.cnblogs.com/jihua/p/webfront.html
原文:http://keleyi.com/a/bjac/iphgrtqm.htm
纯CSS3实现3D跳动小球的更多相关文章
- 纯CSS3实现3D特效的iPhone 6动画
		iPhone 6发布不久,屌丝怎能买得起,不过作为程序员,今天看到一个用纯CSS3绘制的iPhone 6,由于CSS3特性的运用,带有点3D的动画特效,大家可以先来看看在线演示效果. 在线演示 ... 
- 纯CSS3实现3D动画导航,html5 webRTC技术实现免费网页电话拨打
		花了一周的时间完成了 说吧 (免费网页电话) 的前端开发工作,先将技术点总结如下: 免费电话采用最新的html5 webRTC 技术 实现互联网和电信MIS网互通实现网页电话,目前只有 google ... 
- 纯css3 transforms 3D文字翻开翻转3D开放式效果
		详细内容请点击 在线预览立即下载 在本教程中,将基于CSS3创建的一个实现一个有趣的3D开放式效果.教程的目的是展示我们如何能带来一些生活上使用CSS3 . html: <ul class=&q ... 
- 简单几步用纯CSS3实现3D翻转效果
		作为前端开发人员的必修课,CSS3翻转能带我们完成许多基本动效,本期我们将用CSS3实现hover翻转效果~ 第一步非常简单,我们简单画1个演示方块,为其 添加transition和transform ... 
- 8个纯CSS3制作的动画应用及源码
		对于一个复杂的图形或者动画来说,之前我们的处理方式是图片叠加或者利用CSS+JavaScript的方法,然而随着CSS3标准的不断成熟,我们甚至完全可以利用CSS3来绘制一些图片和制作丰富的动画特效. ... 
- 8个超震撼的HTML5和纯CSS3动画源码
		HTML5和CSS3之所以强大,不仅因为现在大量的浏览器的支持,更是因为它们已经越来越能满足现代开发的需要.Flash在几年之后肯定会消亡,那么HTML5和CSS3将会替代Flash.今天我们要给大家 ... 
- 纯css3 3D图片立方体旋转动画特效
		纯css3 3D立方体模块,鼠标触碰,模块炸开,大立方体中套小立方体 效果展示 手机扫描二维码体验效果: 效果图如下: 源码下载:http://hovertree.com/h/bjaf/0qmul8g ... 
- [原创]纯CSS3打造的3D翻页翻转特效
		刚接触CSS3动画,心血来潮实现了一个心目中自己设计的翻页效果的3D动画,页面纯CSS3,目前只能在Chrome中玩,理论上可以支持Safari. 1. 新建HTML,代码如下(数据和翻页后的数据都是 ... 
- 利用纯CSS3实现超立体的3D图片侧翻倾斜效果
		原文:利用纯CSS3实现超立体的3D图片侧翻倾斜效果 上午的时候我在jQuery论坛上看到网友分享的一款CSS3 3D图片侧翻倾斜特效,觉得效果非常棒,其实话说回来,这玩意儿的实现真的非常简单,主要是 ... 
随机推荐
- ComboTree 的json格式和引用
			在easyui内,用 <select>实现combotree. <td ><select class="easyui-combotree" url=& ... 
- Azure Service Febric 笔记:Web API应用
			1.什么是Service Febric 贴一段微软官方的介绍 Service Fabric 是一种分布式系统平台,可让你轻松打包.部署和管理可缩放.可靠的微服务.Service Fabric 还解决了 ... 
- [CentOs7]搭建ftp服务器(3)——上传,下载,删除,重命名,新建文件夹
			摘要 上篇文章介绍了如何为ftp添加虚拟用户,本篇将继续实践如何上传,下载文件. 上传 使用xftp客户端上传文件,如图所示 此时上传状态报错,查看详情 从错误看出是应为无法创建文件造成的.那么我们就 ... 
- MongoDB 内嵌文档
			MongoDB是文档型的数据库系统,doc是MongoDB的数据单位,每个doc相当于关系型数据库的数据行(row),doc和row的区别在于field的原子性:row中的column是不和分割的原子 ... 
- 群福利:百度云管家-本地SVIP
			效果 如果不想登录破解版的百度云(防止泄密)==>复制AppSettingApp.dat和users文件夹,这样你就可以免登录了 最稳定版本:https://yunpan.cn/cBTQc9Iu ... 
- 吐槽:基于PhoneGap开发移动项目
			目前,随着Google的Android手机和苹果的iphone手机的逐渐普及,越来越多开发者加入到移动应用开发的大军当中.其中,Android应用是基于Java语言基础上进行开发的,而苹果公司的iph ... 
- Android实现不重复启动APP的方法
			转载博客:http://blog.sina.cn/dpool/blog/s/blog_5de73d0b0102vpai.html?utm_source=bshare&utm_campaign= ... 
- Android音频开发之MediaRecorder/MediaPlayer
			前言: 上次我们介绍了实时采集音频数据以及播放,今天我们来认识一下直接录制文件的方式. 直接上代码:录制管理类 public class MediaRecorderManager { public s ... 
- Ubuntu杂记——Ubuntu下Eclipse搭建Maven、SVN环境
			正在实习的公司项目是使用Maven+SVN管理的,所以转到Ubuntu下也要靠自己搭环境,自己动手,丰衣足食.步骤有点简略,但还是能理解的. 一.安装JDK7 打开终端(Ctrl+Alt+T),输入 ... 
- 【记录】JS toUpperCase toLowerCase 大写字母/小写字母转换
			小写:toLowerCase() 大写:toUpperCase() 示例代码: <script type="text/javascript" language="j ... 
