欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

實例教程 純CSS3打造非常炫的加載動畫效果

  發(fā)布時間:2014-11-05 14:26:31   作者:佚名   我要評論
這篇文章主要為大家介紹了一款非常炫的加載圖,代碼非常簡單。沒有用任何javascript代碼。純css3實現(xiàn)。用在需要一定時間加載的地方非常合適,感興趣的可以來復(fù)制代碼學習哦

  純css3打造的一款非常炫的加載圖。用在需要一定時間加載的地方非常合適。代碼非常簡單。沒有用任何javascript代碼。純css3實現(xiàn)。先上效果圖:

  實現(xiàn)代碼如下:

  html代碼:

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. <div class="content">  
  2.        <div style="width: 970px; margin: auto">  
  3.        </div>  
  4.        <div class="rotate">  
  5.            <span class="triangle base"></span><span class="triangle no1"></span><span class="triangle no2">  
  6.            </span><span class="triangle no3"></span>  
  7.        </div>  
  8.    </div>  

  CSS代碼:

CSS Code復(fù)制內(nèi)容到剪貼板
  1. body {   
  2.     padding:0;   
  3.     margin:0;      
  4.     background-color#2a4e66;   
  5.   overflowhidden;   
  6. }   
  7.   
  8. .content {   
  9.     width:100%;   
  10.     height:100%;   
  11.     top:0;   
  12.     rightright:0;   
  13.     bottombottom:0;   
  14.     left:0;   
  15.     position:absolute;   
  16. }   
  17.   
  18. .rotate {   
  19.     positionabsolute;   
  20.     top: 50%;   
  21.     left: 50%;   
  22.     margin: -93px 0 0 -93px;   
  23.     backgroundtransparent;   
  24.     width186px;   
  25.     height186px;   
  26.     border-radius: 50%;   
  27.     z-index: 20;   
  28. }   
  29.   
  30. .rotate:after {   
  31.     content'';       
  32.     positionabsolute;   
  33.     box-shadow: 0 0 30px #ffffff, 0 0 10px #ffffff, 0 0 2px #ffffffinset 0 0 2px #ffffffinset 0 0 4px #ffffff;   
  34.     width186px;   
  35.     height186px;   
  36.     border-radius: 50%;   
  37.     z-index: 10;   
  38. }   
  39.   
  40. span.triangle.base {   
  41.     positionabsolute;   
  42.     width: 0;    
  43.     height: 0;   
  44.     margin46px 0 0 13px;   
  45.     border-left80px solid transparent;   
  46.     border-right80px solid transparent;                  
  47.     border-top140px solid #eeeeee;   
  48.     transform-origin: 50% 50%;   
  49.     z-index: 20;   
  50. }   
  51.   
  52. span.triangle.no1 {   
  53.     positionabsolute;   
  54.     margin46px 0 0 13px;   
  55.     width: 0;    
  56.     height: 0;    
  57.     border-left80px solid transparent;   
  58.     border-right80px solid transparent;                  
  59.     border-bottom140px solid #eeeeee;   
  60.     transform-origin: 0 100%;   
  61.     z-index: 20;   
  62. }   
  63.   
  64. span.triangle.no2 {   
  65.     positionabsolute;   
  66.     margin46px 0 0 13px;   
  67.     width: 0;    
  68.     height: 0;    
  69.     border-left80px solid transparent;   
  70.     border-right80px solid transparent;                  
  71.     border-bottom140px solid #eeeeee;   
  72.     transform-origin: 100% 100%;   
  73.     z-index: 20;   
  74. }   
  75.   
  76. span.triangle.no3 {   
  77.     positionabsolute;   
  78.     margin46px 0 0 13px;   
  79.     width: 0;    
  80.     height: 0;    
  81.     border-left80px solid transparent;   
  82.     border-right80px solid transparent;                  
  83.     border-bottom140px solid #eeeeee;   
  84.     transform-origin: 50% 100%;   
  85.     z-index: 20;   
  86. }   
  87.   
  88. /* Animation */  
  89.   
  90. .rotate {   
  91.     -webkit-animation: rotateTriangle 3s linear infinite;   
  92.     animation: rotateTriangle 3s linear infinite;   
  93. }   
  94.   
  95. @-webkit-keyframes rotateTriangle {   
  96.     from { -webkit-transform: rotate(0deg); }   
  97.     to { -webkit-transform: rotate(60deg); }   
  98. }   
  99. @keyframes rotateTriangle {   
  100.     from { transform: rotate(0deg); }   
  101.     to { transform: rotate(60deg); }   
  102. }   
  103.   
  104. .rotate:after {   
  105.     -webkit-animation: glowAnimation 3s ease infinite;   
  106.     animation: glowAnimation 3s ease infinite;   
  107. }   
  108.   
  109. @-webkit-keyframes glowAnimation {         
  110.     0% { box-shadow: 0 0 30px #ffffff, 0 0 10px #ffffff, 0 0 2px #ffffffinset 0 0 2px #ffffffinset 0 0 4px #ffffff; }   
  111.     10% { box-shadow: 0 0 80px #ffffff, 0 0 20px #ffffff, 0 0 2px #ffffffinset 0 0 4px #ffffffinset 0 0 8px #ffffff; }   
  112.     100% { box-shadow: 0 0 30px #ffffff, 0 0 10px #ffffff, 0 0 2px #ffffffinset 0 0 2px #ffffffinset 0 0 4px #ffffff; }   
  113. }   
  114. @keyframes glowAnimation {   
  115.     0% { box-shadow: 0 0 30px #ffffff, 0 0 10px #ffffff, 0 0 2px #ffffffinset 0 0 2px #ffffffinset 0 0 4px #ffffff; }   
  116.     10% { box-shadow: 0 0 80px #ffffff, 0 0 20px #ffffff, 0 0 2px #ffffffinset 0 0 4px #ffffffinset 0 0 8px #ffffff; }   
  117.     100% { box-shadow: 0 0 30px #ffffff, 0 0 10px #ffffff, 0 0 2px #ffffffinset 0 0 2px #ffffffinset 0 0 4px #ffffff; }   
  118. }   
  119.   
  120. span.triangle.base {   
  121.     -webkit-animation: scaleTriangleBase 3s linear infinite;   
  122.     animation: scaleTriangleBase 3s linear infinite;   
  123. }   
  124.   
  125. @-webkit-keyframes scaleTriangleBase {   
  126.     from { -webkit-transform: translate(0px,-11px) scale(0.5); }   
  127.     to { -webkit-transform: translate(0px,0px) scale(1); }   
  128.     }   
  129. @keyframes scaleTriangleBase {   
  130.     from { transform: translate(0px,-11px) scale(0.5); }   
  131.     to { transform: translate(0px,0px) scale(1); }   
  132. }   
  133.   
  134. span.triangle.no1 {   
  135.     -webkit-animation: scaleTriangleOne 3s linear infinite;   
  136.     animation: scaleTriangleOne 3s linear infinite;   
  137. }   
  138.   
  139. @-webkit-keyframes scaleTriangleOne {   
  140.     from { -webkit-transform: translate(0px,-46px) scale(0.5); }   
  141.     to { -webkit-transform: translate(-80px,0px) scale(0); }   
  142. }   
  143. @keyframes scaleTriangleOne {   
  144.     from { transform: translate(0px,-46px) scale(0.5); }   
  145.     to { transform: translate(-80px,0px) scale(0); }   
  146. }   
  147.   
  148. span.triangle.no2 {   
  149.     -webkit-animation: scaleTriangleTwo 3s linear infinite;   
  150.     animation: scaleTriangleTwo 3s linear infinite;   
  151. }   
  152.   
  153. @-webkit-keyframes scaleTriangleTwo {   
  154.     from { -webkit-transform: translate(0px,-46px) scale(0.5); }   
  155.     to { -webkit-transform: translate(80px,0px) scale(0); }   
  156. }   
  157. @keyframes scaleTriangleTwo {   
  158.     from { transform: translate(0px,-46px) scale(0.5); }   
  159.     to { transform: translate(80px,0px) scale(0); }   
  160. }   
  161.   
  162. span.triangle.no3 {   
  163.     -webkit-animation: scaleTriangleThree 3s linear infinite;   
  164.     animation: scaleTriangleThree 3s linear infinite;   
  165. }   
  166.   
  167. @-webkit-keyframes scaleTriangleThree {   
  168.     from { -webkit-transform: translate(0px,-116px) scale(0.5); }   
  169.     to { -webkit-transform: translate(0px,-280px) scale(0); }   
  170. }   
  171. @keyframes scaleTriangleThree {   
  172.     from { transform: translate(0px,-116px) scale(0.5); }   
  173.     to { transform: translate(0px,-280px) scale(0); }   
  174. }  
  175.   
  以上就是實現(xiàn)一款非常炫的加載圖的css代碼,謝謝閱讀,希望能幫到大家,請繼續(xù)關(guān)注腳本之家,我們會努力分享更多優(yōu)秀的文章。

相關(guān)文章

  • CSS3 最強二維布局系統(tǒng)之Grid 網(wǎng)格布局

    CS3的Grid網(wǎng)格布局是目前最強的二維布局系統(tǒng),可以同時對列和行進行處理,將網(wǎng)頁劃分成一個個網(wǎng)格,可以任意組合不同的網(wǎng)格,做出各種各樣的布局,本文介紹CSS3 最強二維布局系
    2025-02-27
  • 如何使用CSS3實現(xiàn)波浪式圖片墻

    本文介紹了如何使用CSS3的transform屬性和動畫技巧實現(xiàn)波浪式圖片墻,通過設(shè)置圖片的垂直偏移量,并使用動畫使其周期性地改變位置,可以創(chuàng)建出動態(tài)且具有波浪效果的圖片墻,同
    2025-02-27
  • CSS3模擬實現(xiàn)一個雷達探測掃描動畫特效(最新推薦)

    文章介紹了如何使用CSS3實現(xiàn)一個雷達探測掃描的效果,包括夜色背景、蜘蛛網(wǎng)盤、掃描體的轉(zhuǎn)動效果、尾巴陰影以及被掃描到的光點,通過HTML和CSS的配合,實現(xiàn)了豐富的動畫效果,
    2025-02-21
  • css3 display:flex 彈性盒模型的使用方法

    CSS3的Flexbox是一種強大的布局模式,通過設(shè)置display:flex可以輕松實現(xiàn)對齊、排列和分布網(wǎng)頁元素,它解決了傳統(tǒng)布局方法中的對齊、間距分配和自適應(yīng)布局等問題,接下來通過本
    2025-02-19
  • css3 實現(xiàn)icon刷新轉(zhuǎn)動效果

    本文給大家介紹css3 實現(xiàn)icon刷新轉(zhuǎn)動效果,文章開頭給大家介紹了webkit-transform、animation、@keyframes這三個屬性,結(jié)合實例代碼給大家介紹的非常詳細,感興趣的朋友一
    2025-02-19
  • CSS3動態(tài)效果之過渡屬性(最新推薦)

    CSS3過渡屬性用于實現(xiàn)元素從一種樣式平滑過渡到另一種樣式,通過設(shè)置transition-property過渡屬性、transition-duration過渡時長transition-timing-function過渡函數(shù)和trans
    2025-02-19
  • CSS3實現(xiàn)動態(tài)旋轉(zhuǎn)加載樣式的示例代碼

    本文介紹了如何使用CSS3創(chuàng)建一個簡單的動態(tài)旋轉(zhuǎn)加載樣式,通過定義一個帶有類名“l(fā)oader”的HTML元素,并使用CSS樣式和@keyframes規(guī)則來實現(xiàn)旋轉(zhuǎn)動畫,你可以根據(jù)需要調(diào)整樣式
    2025-02-19
  • 使用CSS3實現(xiàn)平滑的過渡動畫效果(實例代碼)

    這篇文章主要介紹了如何使用CSS3的transition屬性實現(xiàn)平滑的過渡動畫,本文通過實例代碼給大家介紹的非常詳細,感興趣的朋友一起看看吧
    2025-02-13
  • CSS3中使用flex和grid實現(xiàn)等高元素布局的示例代碼

    本文介紹了使用CSS3中的Flexbox和Grid布局實現(xiàn)等高元素布局的方法,通過簡單的兩列實現(xiàn)、每行放置3列以及全部代碼的展示,展示了這兩種布局方式的實現(xiàn)細節(jié)和效果,感興趣的朋
    2025-02-11
  • 使用CSS3和SVG創(chuàng)建圓形進度條動畫效果

    CSS3和SVG的結(jié)合使用為網(wǎng)頁設(shè)計帶來了創(chuàng)新的動態(tài)視覺效果,本文通過一個圓形進度條的動畫特效示例,展示了如何利用CSS3的動畫功能和SVG的矢量圖形能力來創(chuàng)建豐富的用戶交互體
    2024-10-24

最新評論