最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

基于HTML5的齿轮动画特效_html5教程技巧

来源:动视网 责编:小采 时间:2020-11-27 15:19:41
文档

基于HTML5的齿轮动画特效_html5教程技巧

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

HTML代码

XML/HTML Code复制内容到剪贴板

  • CSS代码

    CSS Code复制内容到剪贴板
    
    
    1. #level{
    2. width:100%;
    3. height:1px;
    4. position:absolute;
    5. top:50%;
    6. }
    7. #content{
    8. text-align:center;
    9. margin-top:-327px;
    10. }
    11. #gears{
    12. width:478px;
    13. height:655px;
    14. position:relative;
    15. display:inline-block;
    16. vertical-align:middle;
    17. }
    18. #gears-static{
    19. background:url(FgFnjks.png) no-repeat -363px -903px;
    20. width:329px;
    21. height:602px;
    22. position:absolute;
    23. bottombottom:5px;
    24. rightright:0px;
    25. opacity:0.4;
    26. }
    27. #title{
    28. vertical-align:middle;
    29. color:#9EB7B5;
    30. width:43%;
    31. display:inline-block;
    32. }
    33. #title h1{
    34. font-family: 'PTSansNarrowBold', sans-serif;
    35. font-size:3.6em;
    36. text-shadow:rgba(0, 0, 0, 0.36) 7px 7px 10px;
    37. }
    38. #title p{
    39. font-family: sans-serif;
    40. font-size:1.2em;
    41. line-height:148%;
    42. text-shadow:rgba(0, 0, 0, 0.36) 1px 1px 0px;
    43. }
    44. .shadow{
    45. -webkit-box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
    46. -moz-box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
    47. box-shadow: 4px 7px 25px 10px rgba(43, 36, 0, 0.36);
    48. }
    49. /*gear-system-1*/
    50. #gear15{
    51. background: url(FgFnjks.png) no-repeat 0 -993px;
    52. width: 321px;
    53. height: 321px;
    54. position:absolute;
    55. left:45px;
    56. top:179px;
    57. -webkit-animation: rotate-back 24000ms linear infinite;
    58. -moz-animation: rotate-back 24000ms linear infinite;
    59. -ms-animation: rotate-back 24000ms linear infinite;
    60. animation: rotate-back 24000ms linear infinite;
    61. }
    62. #shadow15{
    63. width:306px;
    64. height:306px;
    65. -webkit-border-radius:153px;
    66. -moz-border-radius:153px;
    67. border-radius:153px;
    68. position:absolute;
    69. left:52px;
    70. top:186px;
    71. }
    72. #gear14{
    73. background: url(FgFnjks.png) no-repeat 0 -856px;
    74. width: 87px;
    75. height: 87px;
    76. position:absolute;
    77. left:162px;
    78. top:296px;
    79. }
    80. #shadow14{
    81. width:70px;
    82. height:70px;
    83. -webkit-border-radius:35px;
    84. -moz-border-radius:35px;
    85. border-radius:35px;
    86. position:absolute;
    87. left:171px;
    88. top:304px;
    89. }
    90. #gear13{
    91. background: url(FgFnjks.png) no-repeat 0 -744px;
    92. width: 62px;
    93. height: 62px;
    94. position:absolute;
    95. left:174px;
    96. top:309px;
    97. -webkit-animation: rotate 8000ms linear infinite;
    98. -moz-animation: rotate 8000ms linear infinite;
    99. -ms-animation: rotate 8000ms linear infinite;
    100. animation: rotate 8000ms linear infinite;
    101. }
    102. #shadow13{
    103. width:36px;
    104. height:36px;
    105. -webkit-border-radius:18px;
    106. -moz-border-radius:18px;
    107. border-radius:18px;
    108. position:absolute;
    109. left:187px;
    110. top:322px;
    111. }
    112. /*gear-system-2*/
    113. #gear10{
    114. background: url(FgFnjks.png) no-repeat 0 -184px;
    115. width: 122px;
    116. height: 122px;
    117. position:absolute;
    118. left:175px;
    119. top:0;
    120. -webkit-animation: rotate-back 8000ms linear infinite;
    121. -moz-animation: rotate-back 8000ms linear infinite;
    122. -ms-animation: rotate-back 8000ms linear infinite;
    123. animation: rotate-back 8000ms linear infinite;
    124. }
    125. #shadow10{
    126. width:86px;
    127. height:86px;
    128. -webkit-border-radius:43px;
    129. -moz-border-radius:43px;
    130. border-radius:43px;
    131. position:absolute;
    132. left:193px;
    133. top:18px;
    134. }
    135. #gear3{
    136. background: url(FgFnjks.png) no-repeat 0 -1493px;
    137. width: 85px;
    138. height: 84px;
    139. position:absolute;
    140. left:194px;
    141. top:19px;
    142. -webkit-animation: rotate 10000ms linear infinite;
    143. -moz-animation: rotate 10000ms linear infinite;
    144. -ms-animation: rotate 10000ms linear infinite;
    145. animation: rotate 10000ms linear infinite;
    146. }
    147. #shadow3{
    148. width:60px;
    149. height:60px;
    150. -webkit-border-radius:30px;
    151. -moz-border-radius:30px;
    152. border-radius:30px;
    153. position:absolute;
    154. left:206px;
    155. top:31px;
    156. }
    157. /*gear-system-3*/
    158. #gear9{
    159. background: url(FgFnjks.png) no-repeat -371px -280px;
    160. width: 234px;
    161. height: 234px;
    162. position:absolute;
    163. left:197px;
    164. top:96px;
    165. -webkit-animation: rotate 12000ms linear infinite;
    166. -moz-animation: rotate 12000ms linear infinite;
    167. -ms-animation: rotate 12000ms linear infinite;
    168. animation: rotate 12000ms linear infinite;
    169. }
    170. #shadow9{
    171. width:200px;
    172. height:200px;
    173. -webkit-border-radius:100px;
    174. -moz-border-radius:100px;
    175. border-radius:100px;
    176. position:absolute;
    177. left:214px;
    178. top:113px;
    179. }
    180. #gear7{
    181. background: url(FgFnjks.png) no-repeat -371px 0;
    182. width: 108px;
    183. height: 108px;
    184. position:absolute;
    185. left:260px;
    186. top:159px;
    187. -webkit-animation: rotate-back 10000ms linear infinite;
    188. -moz-animation: rotate-back 10000ms linear infinite;
    189. -ms-animation: rotate-back 10000ms linear infinite;
    190. animation: rotate-back 10000ms linear infinite;
    191. }
    192. #shadow7{
    193. width:76px;
    194. height:76px;
    195. -webkit-border-radius:38px;
    196. -moz-border-radius: 38px;
    197. border-radius: 38px;
    198. position:absolute;
    199. left:276px;
    200. top:175px;
    201. }
    202. /*gear-system-4*/
    203. #gear6{
    204. background: url(FgFnjks.png) no-repeat 0 -1931px;
    205. width: 134px;
    206. height: 134px;
    207. position:absolute;
    208. left:305px;
    209. bottombottom:212px;
    210. -webkit-animation: rotate-back 10000ms linear infinite;
    211. -moz-animation: rotate-back 10000ms linear infinite;
    212. -ms-animation: rotate-back 10000ms linear infinite;
    213. animation: rotate-back 10000ms linear infinite;
    214. }
    215. #shadow6{
    216. width:98px;
    217. height:98px;
    218. -webkit-border-radius:49px;
    219. -moz-border-radius: 49px;
    220. border-radius: 49px;
    221. position:absolute;
    222. left:323px;
    223. bottombottom:230px;
    224. }
    225. #gear4{
    226. background: url(FgFnjks.png) no-repeat 0 -1627px;
    227. width: 69px;
    228. height: 69px;
    229. position:absolute;
    230. left:337px;
    231. bottombottom:245px;
    232. -webkit-animation: rotate-back 10000ms linear infinite;
    233. -moz-animation: rotate-back 10000ms linear infinite;
    234. -ms-animation: rotate-back 10000ms linear infinite;
    235. animation: rotate-back 10000ms linear infinite;
    236. }
    237. /*gear-system-5*/
    238. #gear12{
    239. background: url(FgFnjks.png) no-repeat 0 -530px;
    240. width: 164px;
    241. height: 164px;
    242. position:absolute;
    243. left:208px;
    244. bottombottom:85px;
    245. -webkit-animation: rotate 8000ms linear infinite;
    246. -moz-animation: rotate 8000ms linear infinite;
    247. -ms-animation: rotate 8000ms linear infinite;
    248. animation: rotate 8000ms linear infinite;
    249. }
    250. #shadow12{
    251. width:124px;
    252. height:124px;
    253. -webkit-border-radius:62px;
    254. -moz-border-radius:62px;
    255. border-radius:62px;
    256. position:absolute;
    257. left:225px;
    258. bottombottom:107px;
    259. }
    260. #gear11{
    261. background: url(FgFnjks.png) no-repeat 0 -356px;
    262. width: 125px;
    263. height: 124px;
    264. position:absolute;
    265. left:228px;
    266. bottombottom:105px;
    267. -webkit-animation: rotate-back 10000ms linear infinite;
    268. -moz-animation: rotate-back 10000ms linear infinite;
    269. -ms-animation: rotate-back 10000ms linear infinite;
    270. animation: rotate-back 10000ms linear infinite;
    271. }
    272. #shadow11{
    273. width:88px;
    274. height:88px;
    275. -webkit-border-radius:44px;
    276. -moz-border-radius:44px;
    277. border-radius:44px;
    278. position:absolute;
    279. left:247px;
    280. bottombottom:123px;
    281. }
    282. #gear8{
    283. background: url(FgFnjks.png) no-repeat -371px -158px;
    284. width: 72px;
    285. height: 72px;
    286. position:absolute;
    287. left:254px;
    288. bottombottom:131px;
    289. -webkit-animation: rotate 6000ms linear infinite;
    290. -moz-animation: rotate 6000ms linear infinite;
    291. -ms-animation: rotate 6000ms linear infinite;
    292. animation: rotate 6000ms linear infinite;
    293. }
    294. #shadow8{
    295. width:42px;
    296. height:42px;
    297. -webkit-border-radius:21px;
    298. -moz-border-radius: 21px;
    299. border-radius: 21px;
    300. position:absolute;
    301. left:269px;
    302. bottombottom:146px;
    303. }
    304. /*gear1*/
    305. #gear1{
    306. background: url(FgFnjks.png) no-repeat 0 0;
    307. width: 135px;
    308. height: 134px;
    309. position:absolute;
    310. left:83px;
    311. bottombottom:111px;
    312. -webkit-animation: rotate-back 10000ms linear infinite;
    313. -moz-animation: rotate-back 10000ms linear infinite;
    314. -ms-animation: rotate-back 10000ms linear infinite;
    315. animation: rotate-back 10000ms linear infinite;
    316. }
    317. #shadow1{
    318. width:96px;
    319. height:96px;
    320. -webkit-border-radius:48px;
    321. -moz-border-radius:48px;
    322. border-radius:48px;

      文档

      基于HTML5的齿轮动画特效_html5教程技巧

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

      最新推荐

      猜你喜欢

      热门推荐

      专题
      Top