这是一个基于HTML5的齿轮动画特效,我们将齿轮转动的物理学原理,转换为HTML5代码,在网页上实现了模拟齿轮转动的动画效果。该齿轮动画的最大特点是它由好多个齿轮组成,这对齿轮传动的算法要求就大大提高了,而且我们并没有用JavaScript,而是纯CSS3实现的。

HTML代码
XML/HTML Code复制内容到剪贴板
- <div id="level">
- <div id="content">
- <div id="gears">
- <div id="gears-static"></div>
- <div id="gear-system-1">
- <div class="shadow" id="shadow15"></div>
- <div id="gear15"></div>
- <div class="shadow" id="shadow14"></div>
- <div id="gear14"></div>
- <div class="shadow" id="shadow13"></div>
- <div id="gear13"></div>
- </div>
- <div id="gear-system-2">
- <div class="shadow" id="shadow10"></div>
- <div id="gear10"></div>
- <div class="shadow" id="shadow3"></div>
- <div id="gear3"></div>
- </div>
- <div id="gear-system-3">
- <div class="shadow" id="shadow9"></div>
- <div id="gear9"></div>
- <div class="shadow" id="shadow7"></div>
- <div id="gear7"></div>
- </div>
- <div id="gear-system-4">
- <div class="shadow" id="shadow6"></div>
- <div id="gear6"></div>
- <div id="gear4"></div>
- </div>
- <div id="gear-system-5">
- <div class="shadow" id="shadow12"></div>
- <div id="gear12"></div>
- <div class="shadow" id="shadow11"></div>
- <div id="gear11"></div>
- <div class="shadow" id="shadow8"></div>
- <div id="gear8"></div>
- </div>
- <div class="shadow" id="shadow1"></div>
- <div id="gear1"></div>
- <div id="gear-system-6">
- <div class="shadow" id="shadow5"></div>
- <div id="gear5"></div>
- <div id="gear2"></div>
- </div>
- <div class="shadow" id="shadowweight"></div>
- <div id="chain-circle"></div>
- <div id="chain"></div>
- <div id="weight"></div>
- </div>
- </div>
- </div>
CSS代码
CSS Code复制内容到剪贴板
- #level{
- width:100%;
- height:1px;
- position:absolute;
- top:50%;
- }
- #content{
- text-align:center;
- margin-top:-327px;
- }
- #gears{
- width:478px;
- height:655px;
- position:relative;
- display:inline-block;
- vertical-align:middle;
- }
- #gears-static{
- background:url(FgFnjks.png) no-repeat -363px -903px;
- width:329px;
- height:602px;
- position:absolute;
- bottombottom:5px;
- rightright:0px;
- opacity:0.4;
- }
- #title{
- vertical-align:middle;
- color:#9EB7B5;
- width:43%;
- display:inline-block;
- }
- #title h1{
- font-family: 'PTSansNarrowBold', sans-serif;
- font-size:3.6em;
- text-shadow:rgba(0, 0, 0, 0.36) 7px 7px 10px;
- }
- #title p{
- font-family: sans-serif;
- font-size:1.2em;
- line-height:148%;
- text-shadow:rgba(0, 0, 0, 0.36) 1px 1px 0px;
- }
-
- .shadow{
- -webkit-box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
- -moz-box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
- box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
- }
-
-
- #gear15{
- background: url(FgFnjks.png) no-repeat 0 -993px;
- width: 321px;
- height: 321px;
- position:absolute;
- left:45px;
- top:179px;
-
- -webkit-animation: rotate-back 24000ms linear infinite;
- -moz-animation: rotate-back 24000ms linear infinite;
- -ms-animation: rotate-back 24000ms linear infinite;
- animation: rotate-back 24000ms linear infinite;
- }
- #shadow15{
- width:306px;
- height:306px;
- -webkit-border-radius:153px;
- -moz-border-radius:153px;
- border-radius:153px;
- position:absolute;
- left:52px;
- top:186px;
- }
- #gear14{
- background: url(FgFnjks.png) no-repeat 0 -856px;
- width: 87px;
- height: 87px;
- position:absolute;
- left:162px;
- top:296px;
- }
- #shadow14{
- width:70px;
- height:70px;
- -webkit-border-radius:35px;
- -moz-border-radius:35px;
- border-radius:35px;
- position:absolute;
- left:171px;
- top:304px;
- }
- #gear13{
- background: url(FgFnjks.png) no-repeat 0 -744px;
- width: 62px;
- height: 62px;
- position:absolute;
- left:174px;
- top:309px;
-
- -webkit-animation: rotate 8000ms linear infinite;
- -moz-animation: rotate 8000ms linear infinite;
- -ms-animation: rotate 8000ms linear infinite;
- animation: rotate 8000ms linear infinite;
- }
- #shadow13{
- width:36px;
- height:36px;
- -webkit-border-radius:18px;
- -moz-border-radius:18px;
- border-radius:18px;
- position:absolute;
- left:187px;
- top:322px;
- }
-
-
- #gear10{
- background: url(FgFnjks.png) no-repeat 0 -184px;
- width: 122px;
- height: 122px;
- position:absolute;
- left:175px;
- top:0;
-
- -webkit-animation: rotate-back 8000ms linear infinite;
- -moz-animation: rotate-back 8000ms linear infinite;
- -ms-animation: rotate-back 8000ms linear infinite;
- animation: rotate-back 8000ms linear infinite;
- }
- #shadow10{
- width:86px;
- height:86px;
- -webkit-border-radius:43px;
- -moz-border-radius:43px;
- border-radius:43px;
- position:absolute;
- left:193px;
- top:18px;
- }
- #gear3{
- background: url(FgFnjks.png) no-repeat 0 -1493px;
- width: 85px;
- height: 84px;
- position:absolute;
- left:194px;
- top:19px;
-
- -webkit-animation: rotate 10000ms linear infinite;
- -moz-animation: rotate 10000ms linear infinite;
- -ms-animation: rotate 10000ms linear infinite;
- animation: rotate 10000ms linear infinite;
- }
- #shadow3{
- width:60px;
- height:60px;
- -webkit-border-radius:30px;
- -moz-border-radius:30px;
- border-radius:30px;
- position:absolute;
- left:206px;
- top:31px;
- }
-
-
- #gear9{
- background: url(FgFnjks.png) no-repeat -371px -280px;
- width: 234px;
- height: 234px;
- position:absolute;
- left:197px;
- top:96px;
-
- -webkit-animation: rotate 12000ms linear infinite;
- -moz-animation: rotate 12000ms linear infinite;
- -ms-animation: rotate 12000ms linear infinite;
- animation: rotate 12000ms linear infinite;
- }
- #shadow9{
- width:200px;
- height:200px;
- -webkit-border-radius:100px;
- -moz-border-radius:100px;
- border-radius:100px;
- position:absolute;
- left:214px;
- top:113px;
- }
- #gear7{
- background: url(FgFnjks.png) no-repeat -371px 0;
- width: 108px;
- height: 108px;
- position:absolute;
- left:260px;
- top:159px;
-
- -webkit-animation: rotate-back 10000ms linear infinite;
- -moz-animation: rotate-back 10000ms linear infinite;
- -ms-animation: rotate-back 10000ms linear infinite;
- animation: rotate-back 10000ms linear infinite;
- }
- #shadow7{
- width:76px;
- height:76px;
- -webkit-border-radius:38px;
- -moz-border-radius: 38px;
- border-radius: 38px;
- position:absolute;
- left:276px;
- top:175px;
- }
-
-
- #gear6{
- background: url(FgFnjks.png) no-repeat 0 -1931px;
- width: 134px;
- height: 134px;
- position:absolute;
- left:305px;
- bottombottom:212px;
-
- -webkit-animation: rotate-back 10000ms linear infinite;
- -moz-animation: rotate-back 10000ms linear infinite;
- -ms-animation: rotate-back 10000ms linear infinite;
- animation: rotate-back 10000ms linear infinite;
- }
- #shadow6{
- width:98px;
- height:98px;
- -webkit-border-radius:49px;
- -moz-border-radius: 49px;
- border-radius: 49px;
- position:absolute;
- left:323px;
- bottombottom:230px;
- }
- #gear4{
- background: url(FgFnjks.png) no-repeat 0 -1627px;
- width: 69px;
- height: 69px;
- position:absolute;
- left:337px;
- bottombottom:245px;
-
- -webkit-animation: rotate-back 10000ms linear infinite;
- -moz-animation: rotate-back 10000ms linear infinite;
- -ms-animation: rotate-back 10000ms linear infinite;
- animation: rotate-back 10000ms linear infinite;
- }
-
-
- #gear12{
- background: url(FgFnjks.png) no-repeat 0 -530px;
- width: 164px;
- height: 164px;
- position:absolute;
- left:208px;
- bottombottom:85px;
-
- -webkit-animation: rotate 8000ms linear infinite;
- -moz-animation: rotate 8000ms linear infinite;
- -ms-animation: rotate 8000ms linear infinite;
- animation: rotate 8000ms linear infinite;
- }
- #shadow12{
- width:124px;
- height:124px;
- -webkit-border-radius:62px;
- -moz-border-radius:62px;
- border-radius:62px;
- position:absolute;
- left:225px;
- bottombottom:107px;
- }
- #gear11{
- background: url(FgFnjks.png) no-repeat 0 -356px;
- width: 125px;
- height: 124px;
- position:absolute;
- left:228px;
- bottombottom:105px;
-
- -webkit-animation: rotate-back 10000ms linear infinite;
- -moz-animation: rotate-back 10000ms linear infinite;
- -ms-animation: rotate-back 10000ms linear infinite;
- animation: rotate-back 10000ms linear infinite;
- }
- #shadow11{
- width:88px;
- height:88px;
- -webkit-border-radius:44px;
- -moz-border-radius:44px;
- border-radius:44px;
- position:absolute;
- left:247px;
- bottombottom:123px;
- }
- #gear8{
- background: url(FgFnjks.png) no-repeat -371px -158px;
- width: 72px;
- height: 72px;
- position:absolute;
- left:254px;
- bottombottom:131px;
-
- -webkit-animation: rotate 6000ms linear infinite;
- -moz-animation: rotate 6000ms linear infinite;
- -ms-animation: rotate 6000ms linear infinite;
- animation: rotate 6000ms linear infinite;
- }
- #shadow8{
- width:42px;
- height:42px;
- -webkit-border-radius:21px;
- -moz-border-radius: 21px;
- border-radius: 21px;
- position:absolute;
- left:269px;
- bottombottom:146px;
- }
-
-
- #gear1{
- background: url(FgFnjks.png) no-repeat 0 0;
- width: 135px;
- height: 134px;
- position:absolute;
- left:83px;
- bottombottom:111px;
-
- -webkit-animation: rotate-back 10000ms linear infinite;
- -moz-animation: rotate-back 10000ms linear infinite;
- -ms-animation: rotate-back 10000ms linear infinite;
- animation: rotate-back 10000ms linear infinite;
- }
- #shadow1{
- width:96px;
- height:96px;
- -webkit-border
HTML5之HTML元素扩展(上)—新增加的元素及使用概述
HTML5中加入了全新的结构型元素,例如页眉header,页脚footer,导航nav,内容article,章节section等除了这种整个页面的结构型元素,html5也加入了块级别的语义元素,感兴趣的朋友可以了解下,或许对你有所帮助
收藏 0赞 0分享
HTML5之WebGL 3D概述(下)—借助类库开发及框架介绍
前面我们看到了使用原生的WebGL API开发是多么的累,只因如此大量的WebGL框架被开发出来,这些框架不同程度的封装了创建3D场景的各种要素你可以快速创建需要的3D场景,感兴趣的朋友可以了解下,或许本文对你有所帮助
收藏 0赞 0分享
HTML中fieldset标签概述及使用方法
之前HTML没有好好学,导致以前看到控件组样式感觉很新奇,fieldset> 标签将表单内容的一部分打包,生成一组相关表单的字段,接下来对HTML中fieldset标签的使用进行详细解读,感兴趣的朋友可以了解下,或许对你有所帮助
收藏 0赞 0分享
HTML5中微数据概述及在搜索引擎中的使用举例
HTML5微数据规范是标记内容的一种方式,用于描述特定的信息类型,例如评论、人物信息或活动。微数据使用 HTML 标记(常为 span>或 div)中的简单属性为项和属性指定简要的描述性名称
收藏 0赞 0分享
html5新增的属性和废除的属性简要概述
HTML5中,在新增加和废除很多元素的同时,也增加和废除了很多属性比如表单相关的属性/链接相关属性是新增的而HTML4中一些属性就被废除掉了,感兴趣的你可以了解下,或许对你学习html5有所帮助
收藏 0赞 0分享
html5的新增的标签和废除的标签简要概述
HTML5中在新增加和废除很多标签的同时,也增加和废除了很多标签比如新增的结构标签:section元素/video元素等等,感兴趣的朋友可以了解下,希望本文的知识点对你有所帮助
收藏 0赞 0分享
html5配合css3实现带提示文字的输入框(摆脱js)
webkit特有的一个css,可以控制里面的文字样式,配合css3的动画效果和伪类,我们就可以很容易做出一个带动画的输入框,在系统登录、搜索等位置很适合,感兴趣的你可以参考下本文或许可以帮助到你
收藏 0赞 0分享
查看更多