摘要:今天抽了點時間用 HTML+CSS 寫了一個 鴻蒙OS 開機動畫 ,用的最多的就是css的animation這個屬性,分享一下:
最近刷抖音刷微博啥的經(jīng)常能看到鴻蒙 HarmonyOs 的消息,先給華為和我們中國科技的崛起點個贊!
今天抽了點時間用 HTML+CSS 寫了一個 鴻蒙OS 開機動畫 ,用的最多的就是css的animation這個屬性,分享下代碼:
HTML代碼:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HarmonyOS開機動畫</title> <style> * { padding: 0; margin: 0; } html, body { height: 100% } body { background: black; } .outWrap{ position: fixed; top: 30%; left: 15%; display: flex; animation: moveFiexd 4s forwards } .font{ height: 150px; color: white; font-size: 104px; line-height: 150px; opacity: 0; animation: transparency 4s forwards } .back{ height: 150px; color: white; font-size: 131px; line-height: 177px; opacity: 0; animation: transparency 4s forwards } .wrap{ display: flex; flex-direction: column; align-items: center; justify-content: flex-end; } .wrapOver { position: relative; width: 100px; height: 50px; overflow: hidden } .circle1 { position: absolute; box-sizing: border-box; width: 100px; height: 100px; border: 15px solid white; border-radius: 50%; transform: translateY(100%); filter:blur(2px); animation: myMoveTop 2s forwards } .circle2 { position: absolute; box-sizing: border-box; width: 100px; height: 100px; border: 15px solid white; border-radius: 50%; transform: translateY(-150%); filter:blur(2px); animation: myMoveBottom 2s forwards } .bottomSliver{ width: 0px; height: 5px; background:#00a1d6 ; margin-top: 5px; animation: myMoveSliver 4s forwards } @keyframes transparency { 50% { opacity: 0;} 100% { opacity: 1;} } @keyframes myMoveSliver { 50% { width: 0px;} 100% { width: 50px;} } @keyframes myMoveBottom { 90% {filter:blur(2px); } 100% { transform: translateY(-50%);filter:blur(0px);} } @keyframes myMoveTop { 90% {filter:blur(2px); } 100% { transform: none;filter:blur(0px); } } @keyframes moveFiexd { 50% {left:15%; } 100% {left:30%; } } </style> </head> <body> <div class="outWrap"> <div class="font">Harmony</div> <div class="wrap"> <div class="wrapOver"> <div class="circle1"></div> </div> <div class="wrapOver"> <div class="circle2"></div> </div> <div class="bottomSliver"></div> </div> <div class="back">S</div> </div> </body> </html>
網(wǎng)友評論:
袁總遙遙領(lǐng)先~@!
2024-08-01 18:28:05 回復
網(wǎng)友評論:
遙遙領(lǐng)先,袁總也遙遙領(lǐng)先!
2023-11-21 10:20:54 回復
網(wǎng)友評論:
遙遙領(lǐng)先
2023-11-21 10:09:36 回復
網(wǎng)友評論:
不錯,學習到了
2023-11-21 10:05:22 回復