CSS3动画-表盘
2016-01-29 10:57
706 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style> body,html{ color: #fff; font-family: 'Source Sans Pro', sans-serif; background-color: #3399FF; } .time{ position: absolute; top: 50%; left: 50%; margin: -50px 0 0 -50px; width: 100px; height: 100px; border-radius: 50%; box-shadow: inset 0px 0px 0px 2px #fff; } .time:before,.time:after{ position: absolute; content: ""; background-color: #fff; } .time:before{ width: 45px; height: 2px; top: 50px; left: 50px; -webkit-animation: timeabefor 2s linear infinite; -moz-animation: timeabefor 2s linear infinite; animation: timeabefor 2s linear infinite; } .time:after{ width: 35px; height: 2px; top: 50px; left: 50px; -webkit-animation: timeafter 8s linear infinite; -moz-animation: timeafter 8s linear infinite; animation: timeafter 8s linear infinite; } @keyframes timeafter { 0% { transform:rotate(0deg); -ms-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); -o-transform:rotate(0deg); -webkit-transform-origin:0 0; transform-origin:0px 1px; } 0% { transform:rotate(-360deg); -ms-transform:rotate(-360deg); -moz-transform:rotate(-360deg); -webkit-transform:rotate(-360deg); -o-transform:rotate(-360deg); -webkit-transform-origin:0 0; transform-origin:0px 1px; } 100% { transform:rotate(0deg); -ms-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); -o-transform:rotate(0deg); -webkit-transform-origin:0 0; transform-origin:0px 1px; } } @keyframes timeabefor { 0% { transform:rotate(0deg); -ms-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); -o-transform:rotate(0deg); -webkit-transform-origin:0 0; transform-origin:0px 1px; } 0% { transform:rotate(-360deg); -ms-transform:rotate(-360deg); -moz-transform:rotate(-360deg); -webkit-transform:rotate(-360deg); -o-transform:rotate(-360deg); -webkit-transform-origin:0 0; transform-origin:0px 1px } 100% { transform:rotate(0deg); -ms-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); -o-transform:rotate(0deg); -webkit-transform-origin:0 0; transform-origin:0px 1px } } </style> </head> <body> <div class="time"></div> </body> </html>
相关文章推荐
- CSS3属性教程与案例分享
- CSS3属性教程与案例分享
- CSS3的calc()使用
- 使用CSS3的appearance属性改变元素的外观
- CSS3美化图片
- CSS3质感分析——表面线性渐变
- 分析选项卡底部内凹圆角制作
- 细说百度图片栏目——图片展示效果
- 8个实用的响应式设计框架
- 20+ Animation Scripts, Libraries and Plugins
- 如何使用CSS3画出一个叮当猫
- 基于Jquery和CSS3制作数字时钟附源码下载(CSS3篇)
- jQuery CSS3相结合实现时钟插件
- CSS3实例分享之多重背景的实现(Multiple backgrounds)
- 低版本IE正常运行HTML5+CSS3网站的3种解决方案
- CSS3中Transition属性详解以及示例分享
- 基于jQuery和CSS3制作响应式水平时间轴附源码下载
- jquery+CSS3模拟Path2.0动画菜单效果代码
- jquery+css3实现会动的小圆圈效果
- 分享33个jQuery与CSS3实现的绚丽鼠标悬停效果