CSS代码例如以下:

  1. /* Custom Stylesheet */
  2. body, html {
  3. margin: 0;
  4. -webkit-font-smoothing: antialiased;
  5. background: #68ABAD;
  6. text-align: center;
  7. }
  8.  
  9. /* DEMO 1 */
  10. .loader1 {
  11. margin: 0 auto;
  12. height: 20px;
  13. width: 20px;
  14. position:relative;
  15. -webkit-animation:spin 1.5s linear infinite;
  16. -moz-animation:spin 1.5s linear infinite;
  17. }
  18. .loader1 i{
  19. height: 20px;
  20. width: 20px;
  21. border-radius: 25px;
  22. display: block;
  23. position:absolute;
  24. }
  25. .loader1 i:before, .loader1 i:after{
  26. content:'';
  27. display:block;
  28. position:absolute;
  29. height:inherit;
  30. width:inherit;
  31. border-radius: inherit;
  32. }
  33. .loader1 i:first-child:before {
  34. background:rgba(52, 149, 221, 0.9);
  35. -webkit-animation:rotate-top-left 1.5s linear infinite;
  36. -moz-animation:rotate-top-left 1.5s linear infinite;
  37. }
  38. .loader1 i:first-child:after {
  39. background:rgba(225, 73, 44, 0.9);
  40. -webkit-animation:rotate-top-right 1.5s linear infinite;
  41. -moz-animation:rotate-top-right 1.5s linear infinite;
  42. }
  43. .loader1 i:last-child:before {
  44. background:rgba(249, 206, 43, 0.9);
  45. -webkit-animation:rotate-bottom-left 1.5s linear infinite;
  46. -moz-animation:rotate-bottom-left 1.5s linear infinite;
  47. }
  48. .loader1 i:last-child:after {
  49. background:rgba(0, 153, 117, 0.9);
  50. -webkit-animation:rotate-bottom-right 1.5s linear infinite;
  51. -moz-animation:rotate-bottom-right 1.5s linear infinite;
  52. }
  53. @-webkit-keyframes spin{
  54. 0%{
  55. -webkit-transform:rotate(0deg);
  56. }
  57. 50%{
  58. -webkit-transform:rotate(-180deg);
  59. }
  60. 100%{
  61. -webkit-transform:rotate(-360deg);
  62. }
  63. }
  64. @-webkit-keyframes rotate-top-right{
  65. 0%{
  66. -webkit-transform:rotate(0deg);
  67. }
  68. 50%{
  69. -webkit-transform:rotate(-180deg);
  70. -webkit-transform-origin: 20% 20%;
  71. }
  72. 100%{
  73. -webkit-transform:rotate(-360deg);
  74. }
  75. }
  76. @-webkit-keyframes rotate-top-left{
  77. 0%{
  78. -webkit-transform:rotate(0deg);
  79. }
  80. 50%{
  81. -webkit-transform:rotate(180deg);
  82. -webkit-transform-origin: 80% 20%;
  83. }
  84. 100%{
  85. -webkit-transform:rotate(360deg);
  86. }
  87. }
  88. @-webkit-keyframes rotate-bottom-right{
  89. 0%{
  90. -webkit-transform:rotate(0deg);
  91. }
  92. 50%{
  93. -webkit-transform:rotate(-180deg);
  94. -webkit-transform-origin: 80% 80%;
  95. }
  96. 100%{
  97. -webkit-transform:rotate(-360deg);
  98. }
  99. }
  100. @-webkit-keyframes rotate-bottom-left{
  101. 0%{
  102. -webkit-transform:rotate(0deg);
  103. }
  104. 50%{
  105. -webkit-transform:rotate(180deg);
  106. -webkit-transform-origin: 20% 80%;
  107. }
  108. 100%{
  109. -webkit-transform:rotate(360deg);
  110. }
  111. }
  112.  
  113. @-moz-keyframes spin{
  114. 0%{
  115. -moz-transform:rotate(0deg);
  116. }
  117. 50%{
  118. -moz-transform:rotate(-180deg);
  119. }
  120. 100%{
  121. -moz-transform:rotate(-360deg);
  122. }
  123. }
  124. @-moz-keyframes rotate-top-right{
  125. 0%{
  126. -moz-transform:rotate(0deg);
  127. }
  128. 50%{
  129. -moz-transform:rotate(-180deg);
  130. -moz-transform-origin: 20% 20%;
  131. }
  132. 100%{
  133. -moz-transform:rotate(-360deg);
  134. }
  135. }
  136. @-moz-keyframes rotate-top-left{
  137. 0%{
  138. -moz-transform:rotate(0deg);
  139. }
  140. 50%{
  141. -moz-transform:rotate(180deg);
  142. -moz-transform-origin: 80% 20%;
  143. }
  144. 100%{
  145. -moz-transform:rotate(360deg);
  146. }
  147. }
  148. @-moz-keyframes rotate-bottom-right{
  149. 0%{
  150. -moz-transform:rotate(0deg);
  151. }
  152. 50%{
  153. -moz-transform:rotate(-180deg);
  154. -moz-transform-origin: 80% 80%;
  155. }
  156. 100%{
  157. -moz-transform:rotate(-360deg);
  158. }
  159. }
  160. @-moz-keyframes rotate-bottom-left{
  161. 0%{
  162. -moz-transform:rotate(0deg);
  163. }
  164. 50%{
  165. -moz-transform:rotate(180deg);
  166. -moz-transform-origin: 20% 80%;
  167. }
  168. 100%{
  169. -moz-transform:rotate(360deg);
  170. }
  171. }
  172.  
  173. /* DEMO 2 */
  174.  
  175. .loader2 {
  176. margin: 0 auto;
  177. position:relative;
  178. width: 100px;
  179. height: 100px;
  180. }
  181. .loader2 i {
  182. border-style:solid;
  183. display:inline-block;
  184. box-sizing:border-box;
  185. -moz-box-sizing:border-box;
  186. border-width:50px;
  187. border-color:rgba(255,255,255,1);
  188. border-radius: 50px;
  189. -moz-animation:blink 1.5s infinite ease-in-out;
  190. -webkit-animation:blink 1.5s infinite ease-in-out;
  191. height: 100px;
  192. width: 100px;
  193. }
  194. @-webkit-keyframes blink{
  195. 50%{
  196. border-width:0;
  197. border-color:rgba(255,255,255,0.5);
  198. }
  199. 100%{
  200. border-width:0;
  201. border-color:rgba(255,255,255,0.5);
  202. }
  203. }
  204. @-moz-keyframes blink{
  205. 50%{
  206. border-width:0;
  207. border-color:rgba(255,255,255,0.5);
  208. }
  209. 100%{
  210. border-width:0;
  211. border-color:rgba(255,255,255,0.5);
  212. }
  213. }
  214.  
  215. /* DEMO 3 */
  216. .loader3 {
  217. margin: 0 auto;
  218. position:relative;
  219. width: 50px;
  220. height: 50px;
  221. -webkit-animation:spin 4s infinite ease;
  222. -moz-animation:spin 4s infinite ease;
  223. }
  224. .loader3 i {
  225. border-style:solid;
  226. display:inline-block;
  227. box-sizing: border-box;
  228. -moz-box-sizing: border-box;
  229. border:2px dashed rgba(0,0,0,0.7);
  230. border-radius: 50px;
  231. -webkit-animation:scale 4s infinite linear;
  232. -moz-animation:scale 4s infinite linear;
  233. height: 50px;
  234. width: 50px;
  235. }
  236. @-webkit-keyframes spin{
  237. 0%{
  238. -webkit-transform:rotate(0deg);
  239. }
  240. 25%{
  241. -webkit-transform:rotate(90deg);
  242. }
  243. 50%{
  244. -webkit-transform:rotate(-90deg);
  245. }
  246. 75%{
  247. -webkit-transform:rotate(180deg);
  248. }
  249. 100%{
  250. -webkit-transform:rotate(-180deg);
  251. }
  252. }
  253. @-webkit-keyframes scale{
  254. 0%{
  255. -webkit-transform:scale(1);
  256. }
  257. 25%{
  258. -webkit-transform:scale(0.5);
  259. }
  260. 50%{
  261. -webkit-transform:scale(1);
  262. }
  263. 75%{
  264. -webkit-transform:scale(0.5);
  265. }
  266. 100%{
  267. -webkit-transform:scale(1);
  268. }
  269. }
  270. @-moz-keyframes spin{
  271. 0%{
  272. -moz-transform:rotate(0deg);
  273. }
  274. 25%{
  275. -moz-transform:rotate(90deg);
  276. }
  277. 50%{
  278. -moz-transform:rotate(-90deg);
  279. }
  280. 75%{
  281. -moz-transform:rotate(180deg);
  282. }
  283. 100%{
  284. -moz-transform:rotate(-180deg);
  285. }
  286. }
  287. @-moz-keyframes scale{
  288. 0%{
  289. -moz-transform:scale(1);
  290. }
  291. 25%{
  292. -moz-transform:scale(0.5);
  293. }
  294. 50%{
  295. -moz-transform:scale(1);
  296. }
  297. 75%{
  298. -moz-transform:scale(0.5);
  299. }
  300. 100%{
  301. -moz-transform:scale(1);
  302. }
  303. }
  304.  
  305. /* DEMO 4 */
  306. .loader4 {
  307. margin: 0 auto;
  308. position:relative;
  309. text-align: center;
  310. border-bottom: 70px solid rgba(255,255,255,0.5);
  311. border-left: 10px solid transparent;
  312. border-right: 10px solid transparent;
  313. height: 0;
  314. width: 20px
  315. }
  316. .loader4:before{
  317. content:'';
  318. top: -15px;
  319. left: -28px;
  320. display:block;
  321. position:absolute;
  322. height:70px;
  323. width:70px;
  324. border-radius: 50px;
  325. border: 5px dashed rgba(255,255,255,0.5);
  326. -webkit-animation:wind .25s linear infinite;
  327. -moz-animation:wind .25s linear infinite;
  328. }
  329. .loader4 i{
  330. height: 40px;
  331. width: 5px;
  332. margin-left: -1.5px;
  333. display: inline-block;
  334. position:absolute;
  335. -webkit-animation:spin 1.5s linear infinite;
  336. -moz-animation:spin 1.5s linear infinite;
  337. }
  338. .loader4 i:before, .loader4 i:after{
  339. content:'';
  340. display:block;
  341. position:absolute;
  342. height:inherit;
  343. width:inherit;
  344. border-radius: inherit;
  345. background: white;
  346. }
  347. .loader4 i:first-child:before {
  348. top: -53%;
  349. -webkit-transform:rotate(-45deg);
  350. -webkit-transform-origin: 100% 100%;
  351. -moz-transform:rotate(-45deg);
  352. -moz-transform-origin: 100% 100%;
  353. }
  354. .loader4 i:first-child:after {
  355. top: -53%;
  356. -webkit-transform-origin: 0 100%;
  357. -webkit-transform:rotate(45deg);
  358. -moz-transform-origin: 0 100%;
  359. -moz-transform:rotate(45deg);
  360. }
  361. .loader4 i:last-child:before {
  362. top: 45%;
  363. -webkit-transform-origin: 100% 0;
  364. -webkit-transform:rotate(-45deg);
  365. -moz-transform-origin: 100% 0;
  366. -moz-transform:rotate(-45deg);
  367. }
  368. .loader4 i:last-child:after {
  369. -webkit-transform-origin: 0 0;
  370. -webkit-transform: rotate(45deg);
  371. -moz-transform-origin: 0 0;
  372. -moz-transform: rotate(45deg);
  373. top: 45%;
  374. }
  375. @-webkit-keyframes spin{
  376. 0%{
  377. -webkit-transform:rotate(0deg);
  378. }
  379. 50%{
  380. -webkit-transform:rotate(-180deg);
  381. }
  382. 100%{
  383. -webkit-transform:rotate(-360deg);
  384. }
  385. }
  386. @-webkit-keyframes wind{
  387. 100%{
  388. -webkit-transform:scale(2);
  389. border-width: 0;
  390. }
  391. }
  392. @-moz-keyframes spin{
  393. 0%{
  394. -moz-transform:rotate(0deg);
  395. }
  396. 50%{
  397. -moz-transform:rotate(-180deg);
  398. }
  399. 100%{
  400. -moz-transform:rotate(-360deg);
  401. }
  402. }
  403. @-moz-keyframes wind{
  404. 100%{
  405. -moz-transform:scale(2);
  406. border-width: 0;
  407. }
  408. }
  409.  
  410. /* DEMO 5 */
  411. .solar {
  412. margin: 250px auto 350px;
  413. height: 50px;
  414. width: 50px;
  415. background: orange;
  416. border-radius: 25px;
  417. position:relative;
  418. -webkit-animation:glow 1.5s linear infinite;
  419. -moz-animation:glow 1.5s linear infinite;
  420. }
  421. .solar i{
  422. border-radius: 250px;
  423. display:block;
  424. position:absolute;
  425. border: 1px solid rgba(255,255,255, 0.15);
  426. box-sizing: border-box;
  427. -moz-box-sizing: border-box;
  428. -webkit-transform-origin: 50% 50%;
  429. -moz-transform-origin: 50% 50%;
  430. }
  431. .solar i:before {
  432. content:'';
  433. border-radius: 25px;
  434. background: black;
  435. display: block;
  436. position:absolute;
  437. top: -5px;
  438. right: 45%;
  439. }
  440. .solar i.mercury {
  441. width: 80px;
  442. height: 80px;
  443. margin-left: -40px;
  444. left: 50%;
  445. top: 50%;
  446. margin-top: -40px;
  447. -webkit-animation:orbit .5s linear infinite;
  448. -moz-animation:orbit .5s linear infinite;
  449. }
  450. .solar i.mercury:before {
  451. background: #6F5F5F;
  452. height: 7px;
  453. width: 7px;
  454. }
  455. .solar i.venus {
  456. width: 110px;
  457. height: 110px;
  458. margin-left: -55px;
  459. left: 50%;
  460. top: 50%;
  461. margin-top: -55px;
  462. -webkit-animation:orbit 1s linear infinite;
  463. -moz-animation:orbit 1s linear infinite;
  464. }
  465. .solar i.venus:before {
  466. background: #E7A71F;
  467. height: 10px;
  468. width: 10px;
  469. }
  470. .solar i.earth {
  471. width: 140px;
  472. height: 140px;
  473. margin-left: -70px;
  474. left: 50%;
  475. top: 50%;
  476. margin-top: -70px;
  477. -webkit-animation:orbit 1.5s linear infinite;
  478. -moz-animation:orbit 1.5s linear infinite;
  479. }
  480. .solar i.earth:before {
  481. background: #63BEE2;
  482. height: 10px;
  483. width: 10px;
  484. }
  485. .solar i.mars {
  486. width: 170px;
  487. height: 170px;
  488. margin-left: -85px;
  489. left: 50%;
  490. top: 50%;
  491. margin-top: -85px;
  492. -webkit-animation:orbit 2s linear infinite;
  493. -moz-animation:orbit 2s linear infinite;
  494. }
  495. .solar i.mars:before {
  496. background: red;
  497. height: 10px;
  498. width: 10px;
  499. }
  500. .solar i.belt {
  501. box-sizing: border-box;
  502. -moz-box-sizing: border-box;
  503. border-width: 25px;
  504. width: 240px;
  505. height: 240px;
  506. margin-left: -120px;
  507. border-color: rgba(36, 35, 35, 0.21);
  508. left: 50%;
  509. top: 50%;
  510. margin-top: -120px;
  511. }
  512. .solar i.jupiter {
  513. width: 260px;
  514. height: 260px;
  515. margin-left: -130px;
  516. left: 50%;
  517. top: 50%;
  518. margin-top: -130px;
  519. -webkit-animation:orbit 2.5s linear infinite;
  520. -moz-animation:orbit 2.5s linear infinite;
  521. }
  522. .solar i.jupiter:before {
  523. background: #CF9B2B;
  524. top: -15px;
  525. height: 30px;
  526. width: 30px;
  527. }
  528. .solar i.saturn {
  529. width: 320px;
  530. height: 320px;
  531. margin-left: -160px;
  532. left: 50%;
  533. top: 50%;
  534. margin-top: -160px;
  535. -webkit-animation:orbit 3s linear infinite;
  536. -moz-animation:orbit 3s linear infinite;
  537. }
  538. .solar i.saturn:before {
  539. background: #CF7A2B;
  540. top: -10px;
  541. height: 20px;
  542. width: 20px;
  543. }
  544. .solar i.saturn:after {
  545. background: #fff;
  546. width: 30px;
  547. height: 1px;
  548. content: '';
  549. position: absolute;
  550. display: block;
  551. background: #FFF;
  552. width: 30px;
  553. height: 1px;
  554. content: '';
  555. right: 43.5%;
  556. -webkit-transform:rotate(20deg);
  557. -moz-transform:rotate(20deg);
  558. }
  559. .solar i.uranus {
  560. width: 360px;
  561. height: 360px;
  562. margin-left: -180px;
  563. left: 50%;
  564. top: 50%;
  565. margin-top: -180px;
  566. -webkit-animation:orbit 3.5s linear infinite;
  567. -moz-animation:orbit 3.5s linear infinite;
  568. }
  569. .solar i.uranus:before {
  570. background: #10C593;
  571. top: -8px;
  572. height: 15px;
  573. width: 15px;
  574. }
  575. .solar i.neptune {
  576. width: 400px;
  577. height: 400px;
  578. margin-left: -200px;
  579. left: 50%;
  580. top: 50%;
  581. margin-top: -200px;
  582. -webkit-animation:orbit 4s linear infinite;
  583. -moz-animation:orbit 4s linear infinite;
  584. }
  585. .solar i.neptune:before {
  586. background: #1470E4;
  587. top: -8px;
  588. height: 15px;
  589. width: 15px;
  590. }
  591. @-webkit-keyframes orbit{
  592. 0%{
  593. -webkit-transform:rotate(0deg);
  594. }
  595. 50%{
  596. -webkit-transform:rotate(-180deg);
  597. }
  598. 100%{
  599. -webkit-transform:rotate(-360deg);
  600. }
  601. }
  602. @-webkit-keyframes glow{
  603. 0%{
  604. box-shadow: none;
  605. }
  606. 50%{
  607. background: #FFEB00;
  608. box-shadow: 0 0 20px orange;
  609. }
  610. 100%{
  611. box-shadow: none;
  612. }
  613. }
  614. @-moz-keyframes orbit{
  615. 0%{
  616. -moz-transform:rotate(0deg);
  617. }
  618. 50%{
  619. -moz-transform:rotate(-180deg);
  620. }
  621. 100%{
  622. -moz-transform:rotate(-360deg);
  623. }
  624. }
  625. @-moz-keyframes glow{
  626. 0%{
  627. box-shadow: none;
  628. }
  629. 50%{
  630. background: #FFEB00;
  631. box-shadow: 0 0 20px orange;
  632. }
  633. 100%{
  634. box-shadow: none;
  635. }
  636. }

效果如图:看来博客不能引用jsfiddle

查看demo

分享一个纯css制作的动画化,在网页(手机)载入等的时候能够引用!的更多相关文章

  1. 一个纯CSS DIV天气动画图标【转扒的】

    <p> </p> <style><!-- /* SUNNY */ .sunny { -webkit-animation: sunny 15s linear i ...

  2. 如何使用纯 CSS 制作四子连珠游戏

    序言:你是否想过单纯使用 CSS 也可以制作一款游戏?甚至可以双人对决!这是一篇非常有趣的文章,作者详细讲解了使用纯 CSS 制作四子连珠游戏的思路以及使用奇淫巧技解决困难问题的方法.因为案例本身比较 ...

  3. 8个纯CSS3制作的动画应用及源码

    对于一个复杂的图形或者动画来说,之前我们的处理方式是图片叠加或者利用CSS+JavaScript的方法,然而随着CSS3标准的不断成熟,我们甚至完全可以利用CSS3来绘制一些图片和制作丰富的动画特效. ...

  4. 如何使用纯CSS制作特效导航条?

    先上张图,如何使用纯 CSS 制作如下效果? 在继续阅读下文之前,你可以先缓一缓.尝试思考一下上面的效果或者动手尝试一下,不借助 JS ,能否巧妙的实现上述效果. OK,继续.这个效果是我在业务开发的 ...

  5. 每日CSS_纯CSS制作进度条

    每日CSS_纯CSS制作进度条 2020_12_26 源码 1. 代码解析 1.1 html 代码解析 设置整个容器 <div class="container"> . ...

  6. 纯CSS制作水平垂直居中“十字架”

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. No.5 - 纯 CSS 制作绕中轴旋转的立方体

    body{ background-color: #000; margin:; padding:; } main{ perspective: 800px; } .cube{ transform-styl ...

  8. 纯CSS制作空心三角形和实心三角形及其实现原理

    纯CSS制作空心三角形和实心三角形及其实现原理 在一次项目中需要使用到空心三角形,我瞬间懵逼了.查阅了一些资料加上自己的分析思考,终于是达到了效果,个人感觉制作三角形是使用频率很高的,因此记录下来,供 ...

  9. 纯CSS制作三角(转)

    原原文地址:http://www.w3cplus.com/code/303.html 原文地址:http://blog.csdn.net/dyllove98/article/details/89670 ...

随机推荐

  1. Mac 安装Fiddler 抓包工具

    官方安装文档https://www.telerik.com/download/fiddler/fiddler-osx-beta 如果输入mono Fiddler.exe报下面这个错误 WARNING: ...

  2. 2012 noip提高 Vigenère 密码

    P1079 Vigenère 密码 题目描述 16 世纪法国外交家 Blaise de VigenèreBlaisedeVigene`re 设计了一种多表密码加密算法―― VigenèreVigene ...

  3. linux shell 自动判断操作系统release 然后连接FTP yum源的脚本

    如何搭建本地yum源见附录① 如何搭建FTP yum源见附录② 脚本正文: #!/bin/sh# CenterOS config yumOSV=`rpm -q --qf %{version} cent ...

  4. webpack 之 缓存处理

    针对 这里 的所提到的观点,如果webpack每次都生成相同名字的bundle.js,会导致问题.这里使用webpack的文件hash功能来解决,简简单单地为输出文件添加一个“[hash]”即可. / ...

  5. 高可用技术之keepalived原理简单了解

    Keepalived 工作原理 keepalived是以VRRP协议为实现基础的,VRRP全称Virtual Router Redundancy Protocol,即虚拟路由冗余协议. 虚拟路由冗余协 ...

  6. pygame试水,写一个贪吃蛇

    最近学完python基础知识,就想着做一个游戏玩玩,于是就在https://www.pygame.org/docs/学着做了个贪吃蛇游戏. 首先要导入模块. import pygame import ...

  7. 数据结构实验1:C++实现静态顺序表类

    写了3个多小时,还是太慢了.太菜了! 图1 程序运行演示截图1 实验1 1.1 实验目的 熟练掌握线性表的顺序存储结构. 熟练掌握顺序表的有关算法设计. 根据具体问题的需要,设计出合理的表示数据的顺序 ...

  8. netcore使用AutoMapper

    说明:以下是使用过程中看到的其他博主写的,地址如下: 地址一:https://cloud.tencent.com/developer/article/1395155 地址二:https://www.c ...

  9. 【07】QQ群管理公告小结:

    [07]QQ群管理公告小结:   01,请看公告遵守相关规定. 02,群内除QQ自带的缺省表情外(不是QQ的VIP或大图表情),禁止发送大表情,大图片(展示问题的屏幕截图除外),   03,修改群名片 ...

  10. python3--shelve 模块

    shelve模块是一个简单的k,v将内存数据通过文件持久化的模块,可以持久化任何pickle可支持的python数据格式 import shelve d = shelve.open('shelve_t ...