一款利用纯css3实现的win8加载动画的实例分析


Posted in HTML / CSS onDecember 11, 2014

今天给大家分享一款纯css3实现的win8加载动画。在这款实例中动画效果完全由css3实现。一起看下效果图:

一款利用纯css3实现的win8加载动画的实例分析

实现的代码。

html代码:

XML/HTML Code复制内容到剪贴板
  1. <div class="wrapp">  
  2.         <div class="text">  
  3.             <h1>  
  4.                 Windows 8</h1>  
  5.         </div>  
  6.         <div class="logo">  
  7.             <span class="top-left"></span><span class="bottom-right"></span>  
  8.         </div>  
  9.     </div>  

css3代码:

CSS Code复制内容到剪贴板
  1. body{   
  2.     margin: 0;   
  3.     padding: 0;   
  4.     background-color#90da15;   
  5. }   
  6. .wrapp{   
  7.     positionabsolute;   
  8.     top: 50%;   
  9.     left: 50%;   
  10.     width600px;   
  11.     height300px;   
  12.     margin: -150px 0 0 -300px;   
  13.     -webkit-perspective: 30px;   
  14.     -webkit-transform: translateX(0px);   
  15.     -webkit-animation: wrapp 400ms 800ms ease-in forwards;   
  16.   
  17.     -moz-perspective: 30px;   
  18.     -moz-transform: translateX(0px);   
  19.     -moz-animation: wrapp 400ms 800ms ease-in forwards;   
  20.   
  21.     -ms-perspective: 30px;   
  22.     -ms-transform: translateX(0px);   
  23.     -ms-animation: wrapp 400ms 800ms ease-in forwards;   
  24.   
  25.     perspective: 30px;   
  26.     transform: translateX(0px);   
  27.     animation: wrapp 400ms 800ms ease-in forwards;   
  28. }   
  29. .text{   
  30.     positionabsolute;   
  31.     top: 50%;   
  32.     left: 50%;   
  33.     width0px;   
  34.     height60px;   
  35.     margin: -30px 0 0 -160px;   
  36.     overflowhidden;   
  37.     -webkit-transform: translateX(0px);   
  38.     -webkit-animation: text 400ms 800ms linear forwards;   
  39.   
  40.     -moz-transform: translateX(0px);   
  41.     -moz-animation: text 400ms 800ms linear forwards;   
  42.   
  43.     -ms-transform: translateX(0px);   
  44.     -ms-animation: text 400ms 800ms linear forwards;   
  45.   
  46.     transform: translateX(0px);   
  47.     animation: text 400ms 800ms linear forwards;   
  48. }   
  49. h1{   
  50.     floatrightright;   
  51.     font-family"Segoe UI", Frutiger, "Frutiger Linotype""Dejavu Sans""Helvetica Neue"Arialsans-serif;   
  52.     font-weightnormal;   
  53.     color#fff;   
  54.     padding: 0;   
  55.     margin: 0;   
  56.     width320px;   
  57.     height60px;   
  58.     font-size60px;   
  59.     line-height60px;   
  60. }   
  61. .logo{   
  62.     positionabsolute;   
  63.     top: 50%;   
  64.     left: 50%;   
  65.     width90px;   
  66.     height90px;   
  67.     margin: -45px 0 0 -45px;   
  68.     background-color#fff;   
  69.     -webkit-transform: translateX(0px) rotateY(10deg);   
  70.     -webkit-animation: logo 500ms 300ms ease-out forwards;   
  71.   
  72.     -moz-transform: translateX(0px) rotateY(10deg);   
  73.     -moz-animation: logo 500ms 300ms ease-out forwards;   
  74.   
  75.     -ms-transform: translateX(0px) rotateY(10deg);   
  76.     -ms-animation: logo 500ms 300ms ease-out forwards;   
  77.   
  78.     transform: translateX(0px) rotateY(10deg);   
  79.     animation: logo 500ms 300ms ease-out forwards;   
  80. }   
  81. .logo .top-left{   
  82.     positionabsolute;   
  83.     top: 0;   
  84.     left: 0;   
  85.     width44px;   
  86.     height44px;   
  87.     border-rightsolid 2px #90da15;   
  88.     border-bottomsolid 2px #90da15;   
  89. }   
  90. .logo .bottombottom-rightright{   
  91.     positionabsolute;   
  92.     bottombottom: 0;   
  93.     rightright: 0;   
  94.     width44px;   
  95.     height44px;   
  96.     border-leftsolid 2px #90da15;   
  97.     border-topsolid 2px #90da15;   
  98. }   
  99.   
  100. @-webkit-keyframes logo {   
  101.     from {   
  102.         -webkit-transform:  translateX(0px) rotateY(10deg);   
  103.     }   
  104.     to {   
  105.         -webkit-transform:  translateX(0px) rotateY(-10deg);   
  106.     }   
  107. }   
  108. @-webkit-keyframes text {   
  109.     from {   
  110.         width0px;   
  111.         -webkit-transform: translateX(0px);   
  112.     }   
  113.     60%{   
  114.         width0px;   
  115.     }   
  116.     to {   
  117.         width320px;   
  118.         -webkit-transform: translateX(240px);   
  119.     }   
  120. }   
  121. @-webkit-keyframes wrapp {   
  122.     from {   
  123.         -webkit-transform: translateX(0px);   
  124.     }   
  125.     to {   
  126.         -webkit-transform: translateX(-200px);   
  127.     }   
  128. }   
  129. @-moz-keyframes logo {   
  130.     from {   
  131.         -moz-transform:  translateX(0px) rotateY(10deg);   
  132.     }   
  133.     to {   
  134.         -moz-transform:  translateX(0px) rotateY(-10deg);   
  135.     }   
  136. }   
  137. @-moz-keyframes text {   
  138.     from {   
  139.         width0px;   
  140.         -moz-transform: translateX(0px);   
  141.     }   
  142.     60%{   
  143.         width0px;   
  144.     }   
  145.     to {   
  146.         width320px;   
  147.         -moz-transform: translateX(240px);   
  148.     }   
  149. }   
  150. @-moz-keyframes wrapp {   
  151.     from {   
  152.         -moz-transform: translateX(0px);   
  153.     }   
  154.     to {   
  155.         -moz-transform: translateX(-200px);   
  156.     }   
  157. }   
  158.   
  159. @-ms-keyframes logo {   
  160.     from {   
  161.         -ms-transform:  translateX(0px) rotateY(10deg);   
  162.     }   
  163.     to {   
  164.         -ms-transform:  translateX(0px) rotateY(-10deg);   
  165.     }   
  166. }   
  167. @-ms-keyframes text {   
  168.     from {   
  169.         width0px;   
  170.         -ms-transform: translateX(0px);   
  171.     }   
  172.     60%{   
  173.         width0px;   
  174.     }   
  175.     to {   
  176.         width320px;   
  177.         -ms-transform: translateX(240px);   
  178.     }   
  179. }   
  180. @-ms-keyframes wrapp {   
  181.     from {   
  182.         -ms-transform: translateX(0px);   
  183.     }   
  184.     to {   
  185.         -ms-transform: translateX(-200px);   
  186.     }   
  187. }   
  188. @keyframes logo {   
  189.     from {   
  190.         transform:  translateX(0px) rotateY(10deg);   
  191.     }   
  192.     to {   
  193.         transform:  translateX(0px) rotateY(-10deg);   
  194.     }   
  195. }   
  196. @keyframes text {   
  197.     from {   
  198.         width0px;   
  199.         transform: translateX(0px);   
  200.     }   
  201.     60%{   
  202.         width0px;   
  203.     }   
  204.     to {   
  205.         width320px;   
  206.         transform: translateX(240px);   
  207.     }   
  208. }   
  209. @keyframes wrapp {   
  210.     from {   
  211.         transform: translateX(0px);   
  212.     }   
  213.     to {   
  214.         transform: translateX(-200px);   
  215.     }   
  216. }  
HTML / CSS 相关文章推荐
CSS3之多背景background使用示例
Oct 18 HTML / CSS
css3实例教程 一款纯css3实现的环形导航菜单
Oct 20 HTML / CSS
详解CSS3 rem(设置字体大小) 教程
Nov 21 HTML / CSS
HTML5如何实现元素拖拽
Mar 11 HTML / CSS
html5新增的定时器requestAnimationFrame实现进度条功能
Dec 13 HTML / CSS
基于HTML5 audio元素播放声音jQuery小插件
May 11 HTML / CSS
HTML5离线缓存在tomcat下部署可实现图片flash等离线浏览
Dec 13 HTML / CSS
HTML5 表单验证失败的提示语问题
Jul 13 HTML / CSS
canvas之自定义头像功能实现代码示例
Sep 29 HTML / CSS
canvas实现按住鼠标移动绘制出轨迹的示例代码
Feb 05 HTML / CSS
canvas离屏技术与放大镜实现代码示例
Aug 31 HTML / CSS
html2canvas生成的图片偏移不完整的解决方法
May 19 HTML / CSS
一款纯css3实现的tab选项卡的实列教程
Dec 11 #HTML / CSS
纯css3实现的竖形无限级导航
Dec 10 #HTML / CSS
CSS3动画效果回调处理详解
Dec 10 #HTML / CSS
CSS3属性background-size使用指南
Dec 09 #HTML / CSS
CSS3属性box-shadow使用指南
Dec 09 #HTML / CSS
CSS3属性box-sizing使用指南
Dec 09 #HTML / CSS
使用css3实现的tab选项卡代码分享
Dec 09 #HTML / CSS
You might like
最简单的PHP程序--记数器
2006/10/09 PHP
PHP 作用域解析运算符(::)
2010/07/27 PHP
ThinkPHP的MVC开发机制实例解析
2014/08/23 PHP
全面解析PHP操作Memcache基本函数
2016/07/14 PHP
thinkphp 中的volist标签在ajax操作中的特殊性(推荐)
2018/01/15 PHP
ThinkPHP5.1框架页面跳转及修改跳转页面模版示例
2019/05/06 PHP
javascript 隐藏/显示指定的区域附HTML元素【legend】用法
2010/03/05 Javascript
Javascript实现DIV滚动自动滚动到底部的代码
2012/03/01 Javascript
实现js保留小数点后N位的代码
2014/11/13 Javascript
jquery实现的横向二级导航效果代码
2015/08/26 Javascript
input点击后placeholder中的提示消息消失
2016/01/15 Javascript
js改变透明度实现轮播图的算法
2020/08/24 Javascript
js中scrollTop()方法和scroll()方法用法示例
2016/10/03 Javascript
详解微信小程序开发之下拉刷新 上拉加载
2016/11/24 Javascript
JavaScript中捕获与冒泡详解及实例
2017/02/03 Javascript
原生JS实现跑马灯效果
2017/02/20 Javascript
Bootstrap模态框插入视频的实现代码
2017/06/25 Javascript
js链表操作(实例讲解)
2017/08/29 Javascript
js实现搜索栏效果
2018/11/16 Javascript
实例分析编写vue组件方法
2019/02/12 Javascript
详解React项目如何修改打包地址(编译输出文件地址)
2019/03/21 Javascript
为什么Vue3.0使用Proxy实现数据监听(defineProperty表示不背这个锅)
2019/10/14 Javascript
vue element自定义表单验证请求后端接口验证
2019/12/11 Javascript
python 域名分析工具实现代码
2009/07/15 Python
Python 安装第三方库 pip install 安装慢安装不上的解决办法
2019/06/18 Python
Python利用PyPDF2库获取PDF文件总页码实例
2020/04/03 Python
python3中for循环踩过的坑记录
2020/12/14 Python
全网最全python库selenium自动化使用详细教程
2021/01/12 Python
环法自行车赛官方商店:Le Tour de France
2017/08/27 全球购物
Sephora丝芙兰马来西亚官方网站:国际化妆品购物
2018/03/15 全球购物
医务人员竞聘职务自我评价分享
2013/11/08 职场文书
高中自我评价分享
2013/12/05 职场文书
酒店中秋节促销方案
2014/01/30 职场文书
生产助理岗位职责
2014/06/18 职场文书
Python 语言实现六大查找算法
2021/06/30 Python
Python&Matlab实现灰狼优化算法的示例代码
2022/03/21 Python