帶有部分完成指示的CSS 進度圓
簡介:
簡介:條是一個用於指示進度或完成狀態的通用UI 元素。然而,許多 CSS 進度條顯示達到 100% 的完整動畫。本文示範如何建立一個可以在特定百分比停止的CSS 進度圈,如下圖所示:[部分完成的圓形進度條截圖]
解決方案:為了實現這一點,我們利用CSS 剪輯和動畫。 Clip 屬性用於隱藏進度圓的一部分,而animation 屬性則定義圓的旋轉。
.wrapper { width: 100px; height: 100px; position: absolute; clip: rect(0px, 100px, 100px, 50px); } .circle { width: 80px; height: 80px; border: 10px solid green; border-radius: 50px; position: absolute; clip: rect(0px, 50px, 100px, 0px); } div[data-anim~=base] { -webkit-animation-iteration-count: 1; -webkit-animation-fill-mode: forwards; -webkit-animation-timing-function:linear; } .wrapper[data-anim~=wrapper] { -webkit-animation-duration: 0.01s; -webkit-animation-delay: 3s; -webkit-animation-name: close-wrapper; } .circle[data-anim~=left] { -webkit-animation-duration: 6s; -webkit-animation-name: left-spin; } .circle[data-anim~=right] { -webkit-animation-duration: 3s; -webkit-animation-name: right-spin; } @-webkit-keyframes right-spin { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(180deg); } } @-webkit-keyframes left-spin { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } } @-webkit-keyframes close-wrapper { to { clip: rect(auto, auto, auto, auto); } }
CSS 程式碼:
<div class="wrapper" data-anim="base wrapper"> <div class="circle" data-anim="base left"></div> <div class="circle" data-anim="base right"></div> </div>
HTML 程式碼:
此解決方案可確保動畫圈可確保動畫圈流暢,並且能夠根據需要以特定百分比暫停。以上是如何建立一個在特定百分比處停止的 CSS 進度圈?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

重構自己的代碼看起來是什麼樣的?約翰·瑞亞(John Rhea)挑選了他寫的一個舊的CSS動畫,並介紹了優化它的思維過程。

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatoryand and powerincreatingsmoothcsssanimations.keytricksinclude:1)definingsmoothtransitionsbetnestates,2)使用AnimatingMultatingMultationMultationProperPertiessimultane,3)使用使用4)使用BombingeNtibalibility,4)使用CombanningWiThjavoFofofofoftofofo

CSSCOUNTERSAREDOMANAGEAUTOMANAMBERINGINWEBDESIGNS.1)他們可以使用forterablesofcontents,ListItems,and customnumbering.2)AdvancedsincludenestednumberingSystems.3)挑戰挑戰InclassINCludeBrowsEccerCerceribaliblesibility andperformiballibility andperformissises.4)創造性

使用滾動陰影,尤其是對於移動設備,是克里斯以前涵蓋的一個微妙的UX。傑夫(Geoff)涵蓋了一種使用動畫限制屬性的新方法。這是另一種方式。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

Dreamweaver Mac版
視覺化網頁開發工具

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。