您好,登錄后才能下訂單哦!
這篇文章主要介紹了CSS怎么實(shí)現(xiàn)loading動(dòng)畫效果的相關(guān)知識(shí),內(nèi)容詳細(xì)易懂,操作簡(jiǎn)單快捷,具有一定借鑒價(jià)值,相信大家閱讀完這篇CSS怎么實(shí)現(xiàn)loading動(dòng)畫效果文章都會(huì)有所收獲,下面我們一起來(lái)看看吧。
預(yù)覽
代碼
使用了CSS的keyframes自定義關(guān)鍵幀動(dòng)畫
<!DOCTYPE html> <html lang="en"> <head> <title>Loading</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> div#preload { margin: auto; position: fixed; width: 100%; height: 100%; background-color: #fff; z-index: 9999999 } div#preload>img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); -moz-transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); -o-transform: translate(-50%,-50%) } div#preload .cssload-loader { position: absolute; left: 0; right: 0; margin: auto; width: 62px; height: 62px; top: 50%; margin-top: -31px; border-radius: 50%; -o-border-radius: 50%; -ms-border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%; perspective: 780px } div#preload .cssload-inner { position: absolute; width: 100%; height: 100%; box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; border-radius: 50%; -o-border-radius: 50%; -ms-border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50% } div#preload .cssload-inner.cssload-one { left: 0; top: 0; animation: cssload-rotate-one 1.15s linear infinite; -o-animation: cssload-rotate-one 1.15s linear infinite; -ms-animation: cssload-rotate-one 1.15s linear infinite; -webkit-animation: cssload-rotate-one 1.15s linear infinite; -moz-animation: cssload-rotate-one 1.15s linear infinite; border-bottom: 3px solid #000 } div#preload .cssload-inner.cssload-two { right: 0; top: 0; animation: cssload-rotate-two 1.15s linear infinite; -o-animation: cssload-rotate-two 1.15s linear infinite; -ms-animation: cssload-rotate-two 1.15s linear infinite; -webkit-animation: cssload-rotate-two 1.15s linear infinite; -moz-animation: cssload-rotate-two 1.15s linear infinite; border-right: 3px solid #000 } div#preload .cssload-inner.cssload-three { right: 0; bottom: 0; animation: cssload-rotate-three 1.15s linear infinite; -o-animation: cssload-rotate-three 1.15s linear infinite; -ms-animation: cssload-rotate-three 1.15s linear infinite; -webkit-animation: cssload-rotate-three 1.15s linear infinite; -moz-animation: cssload-rotate-three 1.15s linear infinite; border-top: 3px solid #000 } @keyframes cssload-rotate-one { 0% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg) } 100% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg) } } @-o-keyframes cssload-rotate-one { 0% { -o-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg) } 100% { -o-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg) } } @-ms-keyframes cssload-rotate-one { 0% { -ms-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg) } 100% { -ms-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg) } } @-webkit-keyframes cssload-rotate-one { 0% { -webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg) } 100% { -webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg) } } @-moz-keyframes cssload-rotate-one { 0% { -moz-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg) } 100% { -moz-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg) } } @keyframes cssload-rotate-two { 0% { transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg) } 100% { transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg) } } @-o-keyframes cssload-rotate-two { 0% { -o-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg) } 100% { -o-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg) } } @-ms-keyframes cssload-rotate-two { 0% { -ms-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg) } 100% { -ms-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg) } } @-webkit-keyframes cssload-rotate-two { 0% { -webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg) } 100% { -webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg) } } @-moz-keyframes cssload-rotate-two { 0% { -moz-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg) } 100% { -moz-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg) } } @keyframes cssload-rotate-three { 0% { transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg) } 100% { transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg) } } @-o-keyframes cssload-rotate-three { 0% { -o-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg) } 100% { -o-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg) } } @-ms-keyframes cssload-rotate-three { 0% { -ms-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg) } 100% { -ms-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg) } } @-webkit-keyframes cssload-rotate-three { 0% { -webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg) } 100% { -webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg) } } @-moz-keyframes cssload-rotate-three { 0% { -moz-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg) } 100% { -moz-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg) } } </style> </head> <body> <div id="preload"> <div class="cssload-loader"> <div class="cssload-inner cssload-one"></div> <div class="cssload-inner cssload-two"></div> <div class="cssload-inner cssload-three"></div> </div> </div> </body> </html>
關(guān)于“CSS怎么實(shí)現(xiàn)loading動(dòng)畫效果”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對(duì)“CSS怎么實(shí)現(xiàn)loading動(dòng)畫效果”知識(shí)都有一定的了解,大家如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。