效果圖
實(shí)現(xiàn)思路
1.首先通過(guò)HTML+CSS實(shí)現(xiàn)加載動(dòng)畫(huà)的靜態(tài)效果;
2.根據(jù)需求給每個(gè)動(dòng)畫(huà)設(shè)計(jì)不同的動(dòng)畫(huà)效果。
例如第一個(gè)加載圖標(biāo)的靜態(tài)繪制
1、首先確定動(dòng)畫(huà)的盒子寬高;
2、設(shè)置盒子中每一個(gè)長(zhǎng)方形的寬高以及定位(注意:此處需要將長(zhǎng)方形的旋轉(zhuǎn)中心點(diǎn)移動(dòng)到長(zhǎng)方形的右側(cè)邊終點(diǎn),方便后期以該點(diǎn)旋轉(zhuǎn)。);
3、通過(guò)長(zhǎng)方形盒子的偽元素,設(shè)置顯示的長(zhǎng)方形背景和寬高,同時(shí)進(jìn)行定位。
4、由于在第二步的時(shí)候,已經(jīng)將旋轉(zhuǎn)中心移動(dòng),此處我們直接對(duì)每一個(gè)盒子中長(zhǎng)方形進(jìn)行旋轉(zhuǎn)(注意:旋轉(zhuǎn)角度 = 360 / 盒子中長(zhǎng)方形個(gè)數(shù))。
.circle-line{ width: 100px; height: 100px; display: inline-block; position: relative; } .circle-line text{ display: block; width: 50%; height: 5px; opacity: .7; position: absolute; top: calc(50% - 2.5px); left: 0px; transform-origin: center right; } .circle-line text::before{ content: ''; display: block; width: 15px; height: 5px; position: absolute; top: 0; right: 10px; background-color: blue; } .circle-line text:nth-child(1){ transform: rotate(0deg); } .circle-line text:nth-child(2){ transform: rotate(45deg); } .circle-line text:nth-child(3){ transform: rotate(90deg); } .circle-line text:nth-child(4){ transform: rotate(135deg); } .circle-line text:nth-child(5){ transform: rotate(180deg); } .circle-line text:nth-child(6){ transform: rotate(225deg); } .circle-line text:nth-child(7){ transform: rotate(270deg); } .circle-line text:nth-child(8){ transform: rotate(315deg); }
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。