Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 日本网站免费,最近的最新的中文字幕视频,久久精品国产精品亚洲20

          整合營(yíng)銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          web前端學(xué)習(xí)-CSS3 loading示例詳細(xì)講解

          web前端學(xué)習(xí)-CSS3 loading示例詳細(xì)講解

          擊右上方紅色按鈕關(guān)注“web秀”,讓你真正秀起來

          前言

          最近公司實(shí)在是太忙了,996的日子(當(dāng)前時(shí)間凌晨2019-01-06 02:04),所以更新也少了,希望大家多體諒一下,在此對(duì)小伙伴們說聲抱歉。

          前幾天接到小伙伴投稿,希望做一個(gè)類似loading的效果,也是只要手頭有空就趕緊寫寫,今天終于給做好了,非常感謝"月球居民愛麗絲"的投稿。

          原件預(yù)覽圖:

          效果解析

          從效果而言,我們主要實(shí)現(xiàn)下列步驟: 1、讓一個(gè)圓旋轉(zhuǎn),并且是先快后慢; 2、有顏色過渡效果、并且有透明度; 3、然后就是復(fù)制上面的效果,5個(gè),然后按時(shí)間執(zhí)行動(dòng)畫

          好了,開始我們的表演

          第一步 - 一個(gè)圓旋轉(zhuǎn)

          css畫一個(gè)圓很簡(jiǎn)單,div設(shè)置寬高,用border-radius:100%就可以輕松實(shí)現(xiàn)。但是實(shí)現(xiàn)一個(gè)圓,旋轉(zhuǎn),并且不是繞自己的圓心旋轉(zhuǎn)(繞自己的圓心旋轉(zhuǎn)看不出來效果)是個(gè)問題,怎么解決了?

          看看我的解決方案:

          <div class="shadow-box box1"> 
           <div class="shadow"></div> 
          </div>
          

          用一個(gè)盒子,裝住圓,盒子比圓大。圓最水平居中,盒子頂部,然后旋轉(zhuǎn)盒子,就可以搞定圓的選擇效果。

          .shadow-box{ 
           position: absolute; 
           width: 260px; 
           height: 260px; 
           border: 1px solid; 
           left: 200px; 
          } 
           
          .shadow-box div{ 
           position: absolute; 
           background: #1199ff; 
           width: 50px; 
           height: 50px; 
           border-radius: 100%; 
           float: right; 
           left: 50%; 
           margin-left: -25px; 
          } 
          @keyframes trotate{ 
           /*動(dòng)畫開始第一幀*/ 
           from { 
           /*transform: rotate旋轉(zhuǎn),2.4s內(nèi)從0°過渡到360°*/ 
           transform: rotate(0deg); 
           } 
           /*動(dòng)畫結(jié)束最后一幀*/ 
           to { 
           transform: rotate(360deg); 
           } 
          } 
          .box1{ 
           /*動(dòng)畫:2.4s執(zhí)行完畢,cubic-bezier貝塞爾曲線(先快后慢)*/ 
           animation: trotate 2.4s cubic-bezier(.23,1.02,.44,.9); 
          }
          

          第二步 - 顏色過渡

          顏色過渡和旋轉(zhuǎn)基本一樣,不過顏色并不是作用盒子,而是圓。所以,我們操作box下面的div,添加顏色過渡動(dòng)畫,并添加透明度。

          @keyframes acolor1{ 
           from { 
           background: #1199ff; 
           opacity: 0.7; 
           } 
           to { 
           background: #c837ed; 
           opacity: 0.2; 
           } 
          } 
          .box1 div{ 
           animation: acolor1 2.4s cubic-bezier(.23,1.02,.44,.9); 
           background: #1199ff; 
           opacity: 0.7; 
          }
          

          第三步 - copy

          <div class="loading"> 
           <div class="shadow-box box1"> 
           <div class="shadow"></div> 
           </div> 
           <div class="shadow-box box2"> 
           <div class="shadow"></div> 
           </div> 
           <div class="shadow-box box3"> 
           <div class="shadow"></div> 
           </div> 
           <div class="shadow-box box4"> 
           <div class="shadow"></div> 
           </div> 
           <div class="shadow-box box5"> 
           <div class="shadow"></div> 
           </div> 
          </div>
          

          我們復(fù)制5個(gè),并用box1-box5來區(qū)分

          .shadow-box{ 
           position: absolute; 
           width: 260px; 
           height: 260px; 
           /* border: 1px solid; */ /*去掉邊框*/ 
           left: 200px; 
          } 
           
          .shadow-box div{ 
           position: absolute; 
           width: 50px; 
           height: 50px; 
           border-radius: 100%; 
           float: right; 
           left: 50%; 
           margin-left: -25px; 
          } 
           
          /*旋轉(zhuǎn)動(dòng)畫*/ 
          @keyframes trotate 
          { 
           from { 
           transform:rotate(0deg); 
           } 
           to { 
           transform:rotate(360deg); 
           } 
          } 
           
          /*box1顏色、透明度過渡動(dòng)畫*/ 
          @keyframes acolor1 
          { 
           from { 
           background: #1199ff; 
           opacity: 0.7; 
           } 
           to { 
           background: #c837ed; 
           opacity: 0.2; 
           } 
          } 
          @keyframes acolor2 
          { 
           from { 
           background: #46b0ff; 
           opacity: 0.7; 
           } 
           to { 
           background: #9e79db; 
           opacity: 0.2; 
           } 
          } 
          @keyframes acolor3 
          { 
           from { 
           background: #32bbff; 
           opacity: 0.7; 
           } 
           to { 
           background: #f577a8; 
           opacity: 0.2; 
           } 
          } 
          @keyframes acolor4 
          { 
           from { 
           background: #00dbc2; 
           opacity: 0.7; 
           } 
           to { 
           background: #ff745a; 
           opacity: 0.2; 
           } 
          } 
          @keyframes acolor5 
          { 
           from { 
           background: #00dbc2; 
           opacity: 0.7; 
           } 
           to { 
           background: #ff745a; 
           opacity: 0.2; 
           } 
          } 
           
          /*box1應(yīng)用旋轉(zhuǎn)動(dòng)畫*/ 
          /** 
          * box1 2.4s 
          * box2 2.2s完成 延時(shí)0.6s執(zhí)行 
          * box3 2s完成 延時(shí)1.2s執(zhí)行 
          * ... 
          * 時(shí)間依次減少,動(dòng)畫效果也就是越來越快 
          * 能追上上面一個(gè)動(dòng)畫 
          */ 
          .box1{ 
           animation: trotate 2.4s 
           cubic-bezier(.23,1.02,.44,.9); 
           z-index: 4; 
          } 
          .box2{ 
           /* 2s完成 */ 
           animation: trotate 2.2s 
           cubic-bezier(.23,1.02,.44,.9); 
           /* 延時(shí)1.2s執(zhí)行 */ 
           animation-delay: .6s; 
           z-index: 3; 
          } 
          .box3{ 
           animation: trotate 2s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 1.2s; 
           z-index: 2; 
          } 
          .box4{ 
           animation: trotate 1.8s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 1.8s; 
           z-index: 1; 
          } 
          .box5{ 
           animation: trotate 1.6s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 2.4s; 
           z-index: 1; 
          } 
          /*box1應(yīng)用顏色、透明度過渡動(dòng)畫*/ 
          .box1 div{ 
           animation: acolor1 2.4s 
           cubic-bezier(.23,1.02,.44,.9); 
           background: #1199ff; 
           opacity: 0.7; 
          } 
          .box2 div{ 
           animation: acolor2 2.2s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: .6s; 
           background: #46b0ff; 
           opacity: 0.7; 
          } 
          .box3 div{ 
           animation: acolor3 2s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 1.2s; 
           background: #32bbff; 
           opacity: 0.7; 
          } 
          .box4 div{ 
           animation: acolor4 1.8s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 1.8s; 
           background: #00dbc2; 
           opacity: 0.7; 
          } 
          .box5 div{ 
           animation: acolor4 1.6s 
           cubic-bezier(.23,1.02,.44,.9); 
           animation-delay: 2.4s; 
           background: #00dbc2; 
           opacity: 0.7; 
          }
          

          最終效果預(yù)覽:

          總結(jié)

          還是那句“萬丈高樓平地起”,要善于問題分解,一步一步來,不要想著一口一個(gè)胖子,飯的慢慢吃。按步驟是不是發(fā)現(xiàn)超級(jí)簡(jiǎn)單就可以搞定?

          再次感謝"月球居民愛麗絲"同學(xué),也期待更多人的投稿。

          陌生人,2019年好好加油,我看好你。

          公告

          喜歡小編的點(diǎn)擊關(guān)注,了解更多知識(shí)!

          源碼地址請(qǐng)點(diǎn)擊下方“了解更多”

          loaders.css是Github上一個(gè)使用純粹的css實(shí)現(xiàn)的開源loading動(dòng)畫庫(kù),完全用CSS編寫的加載動(dòng)畫的集合。每個(gè)動(dòng)畫僅限于CSS屬性的一小部分,以避免復(fù)雜的繪畫和布局計(jì)算。下面這張圖是在demo頁面截取的Gif效果圖,可供參考!






          Github

          就這樣一個(gè)小小的庫(kù)也收獲了9.5k的stars,以下是其倉(cāng)庫(kù)源地址

          https://github.com/ConnorAtherton/loaders.css

          安裝方式

          自由選擇安裝方式進(jìn)行安裝使用

          bower install loaders.css
          npm i --save loaders.css

          用法

          1、標(biāo)準(zhǔn)用法

          • 包括 loaders.min.css
          • 創(chuàng)建一個(gè)元素并添加動(dòng)畫類(例如<div class="loader-inner ball-pulse"></div>)
          • 將適當(dāng)數(shù)量的<div>s插入該元素

          jQuery(可選)

          • 包括loaders.min.css,jQuery和loaders.css.js
          • 創(chuàng)建一個(gè)元素并添加動(dòng)畫類(例如<div class="loader-inner ball-pulse"></div>)
          • loaders.js 是為每個(gè)動(dòng)畫注入正確數(shù)量的div元素的簡(jiǎn)單幫助庫(kù)
          • 要初始化頁面加載后添加的加載器,請(qǐng)選擇div并調(diào)用loaders它們(例如$('.loader-inner').loaders())
          • enjoy it!

          定制化

          • 更改背景顏色

          將樣式添加到正確的子div元素

          .ball-grid-pulse > div {
            background-color: orange;
          }
          • 更改尺寸大小

          使用2D比例轉(zhuǎn)換

          .loader-small .loader-inner {
            transform: scale(0.5, 0.5);
          }

          瀏覽器兼容性

          • IE11
          • Chrome 41+
          • FireFox 36+
          • Safari 8+

          衍生產(chǎn)物

          Loaders.css衍生了很多適用于其它平臺(tái)或框架的優(yōu)秀庫(kù),這些都是受Loaders.css的啟發(fā)而產(chǎn)生的

          • React

          https://github.com/jonjaques/react-loaders

          • Vue

          https://github.com/Hokid/vue-loaders

          • Angular

          https://github.com/Masadow

          • ember

          https://github.com/kaermorchen/ember-cli-loaders

          • iOS

          https://github.com/gontovnik/DGActivityIndicatorView

          • Android

          https://github.com/varunsridharan/Loaders.CSS-Android-App

          總結(jié)

          Loaders.css是一個(gè)非常出色的loading動(dòng)畫庫(kù),可以將它運(yùn)用到你任何新的或者現(xiàn)有的項(xiàng)目中,性能出眾,定制化,enjoy it!

          loaders.css是Github上一個(gè)使用純粹的css實(shí)現(xiàn)的開源loading動(dòng)畫庫(kù),完全用CSS編寫的加載動(dòng)畫的集合。每個(gè)動(dòng)畫僅限于CSS屬性的一小部分,以避免復(fù)雜的繪畫和布局計(jì)算。下面這張圖是在demo頁面截取的Gif效果圖,可供參考!






          Github

          就這樣一個(gè)小小的庫(kù)也收獲了9.5k的stars,以下是其倉(cāng)庫(kù)源地址

          https://github.com/ConnorAtherton/loaders.css

          安裝方式

          自由選擇安裝方式進(jìn)行安裝使用

          bower install loaders.css
          npm i --save loaders.css

          用法

          1、標(biāo)準(zhǔn)用法

          • 包括 loaders.min.css
          • 創(chuàng)建一個(gè)元素并添加動(dòng)畫類(例如<div class="loader-inner ball-pulse"></div>)
          • 將適當(dāng)數(shù)量的<div>s插入該元素

          jQuery(可選)

          • 包括loaders.min.css,jQuery和loaders.css.js
          • 創(chuàng)建一個(gè)元素并添加動(dòng)畫類(例如<div class="loader-inner ball-pulse"></div>)
          • loaders.js 是為每個(gè)動(dòng)畫注入正確數(shù)量的div元素的簡(jiǎn)單幫助庫(kù)
          • 要初始化頁面加載后添加的加載器,請(qǐng)選擇div并調(diào)用loaders它們(例如$('.loader-inner').loaders())
          • enjoy it!

          定制化

          • 更改背景顏色

          將樣式添加到正確的子div元素

          .ball-grid-pulse > div {
            background-color: orange;
          }
          • 更改尺寸大小

          使用2D比例轉(zhuǎn)換

          .loader-small .loader-inner {
            transform: scale(0.5, 0.5);
          }

          瀏覽器兼容性

          • IE11
          • Chrome 41+
          • FireFox 36+
          • Safari 8+

          衍生產(chǎn)物

          Loaders.css衍生了很多適用于其它平臺(tái)或框架的優(yōu)秀庫(kù),這些都是受Loaders.css的啟發(fā)而產(chǎn)生的

          • React

          https://github.com/jonjaques/react-loaders

          • Vue

          https://github.com/Hokid/vue-loaders

          • Angular

          https://github.com/Masadow

          • ember

          https://github.com/kaermorchen/ember-cli-loaders

          • iOS

          https://github.com/gontovnik/DGActivityIndicatorView

          • Android

          https://github.com/varunsridharan/Loaders.CSS-Android-App

          總結(jié)

          Loaders.css是一個(gè)非常出色的loading動(dòng)畫庫(kù),可以將它運(yùn)用到你任何新的或者現(xiàn)有的項(xiàng)目中,性能出眾,定制化,enjoy it!


          主站蜘蛛池模板: 日本人真淫视频一区二区三区| 日本一区二区视频| 久久精品国内一区二区三区 | 一区二区高清在线观看| 国产精品女同一区二区| 国产精品无码一区二区三区电影| 精品一区二区久久| 亚洲一区无码中文字幕| 亚洲一区二区三区乱码A| 精品国产日韩亚洲一区在线| 少妇无码一区二区二三区| 中文字幕永久一区二区三区在线观看 | 人妻夜夜爽天天爽一区| 国产手机精品一区二区| 中文字幕无码不卡一区二区三区| 亚洲欧洲一区二区| 精品国产一区AV天美传媒| 久久91精品国产一区二区| 中文字幕在线视频一区| 国产精品成人国产乱一区| 一区二区国产在线播放| 无码人妻精品一区二| 国产伦精品一区二区免费| 亚洲国模精品一区| 综合一区自拍亚洲综合图区| 国产在线步兵一区二区三区 | 又硬又粗又大一区二区三区视频| 国产精品亚洲一区二区三区久久 | 久久综合精品国产一区二区三区| 亚洲片一区二区三区| 日韩AV无码一区二区三区不卡毛片| 精品人妻少妇一区二区| 日本中文字幕一区二区有码在线| 免费日本一区二区| 国产精品福利一区二区| 在线观看日韩一区| 好湿好大硬得深一点动态图91精品福利一区二区 | 无码人妻精品一区二区蜜桃网站 | 国产高清在线精品一区二区| 国产内射在线激情一区| 国产精品制服丝袜一区|