CSS實現(xiàn)橫向粒子變動加載動畫
發(fā)布時間:2016-04-25 15:39:21 作者:佚名
我要評論

這篇文章主要介紹了CSS實現(xiàn)橫向粒子變動加載動畫的相關資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了CSS實現(xiàn)橫向粒子變動加載動畫的對應代碼,供大家參考,具體內(nèi)容如下
此處用到了CSS3動畫animation屬性的animation-fill-mode屬性和animation-delay屬性。
● animation-fill-mode屬性規(guī)定動畫在播放之前或之后,其動畫效果是否可見。
none:不改變默認行為。
forwards:當動畫完成后,保持最后一個屬性值(在最后一個關鍵幀中定義)。
backwards:在animation-delay所指定的一段時間內(nèi),在動畫顯示之前,應用開始屬性值(在第一個關鍵幀
中定義)。
both: 向前和向后填充模式都被應用。
● animation-delay屬性定義動畫何時開始。該屬性允許負值,示例中延遲0.16s執(zhí)行動畫。
CSS Code復制內(nèi)容到剪貼板
- #loader7:before,
- #loader7:after,
- #loader7 {
- border-radius: 50%;
- width: 2.5em;
- height: 2.5em;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
- -webkit-animation: load7 1.8s infinite ease-in-out;
- animation: load7 1.8s infinite ease-in-out;
- }
- #loader7 {
- margin: 60px 50px;
- float: left;
- font-size: 10px;
- position: relative;
- text-indent: -9999em;
- -webkit-animation-delay: 0.16s;
- animation-delay: 0.16s;
- }
- #loader7:before {
- left: -3.5em;
- }
- #loader7:after {
- left: 3.5em;
- -webkit-animation-delay: 0.32s;
- animation-delay: 0.32s;
- }
- #loader7:before,
- #loader7:after {
- content: '';
- position: absolute;
- top: 0;
- }
- @-webkit-keyframes load7 {
- 0%,
- 80%,
- 100% {
- box-shadow: 0 2.5em 0 -1.3em #000000;
- }
- 40% {
- box-shadow: 0 2.5em 0 0 #000000;
- }
- }
- @keyframes load7 {
- 0%,
- 80%,
- 100% {
- box-shadow: 0 2.5em 0 -1.3em #000000;
- }
- 40% {
- box-shadow: 0 2.5em 0 0 #000000;
- }
- }
以上就是本文的全部內(nèi)容,希望對大家學習CSS樣式進行加載有所幫助。
相關文章
CSS實現(xiàn)大小相同、顏色深淺不一的粒子旋轉(zhuǎn)加載動畫
這篇文章主要介紹了CSS實現(xiàn)大小相同、顏色深淺不一的粒子旋轉(zhuǎn)加載動畫的相關代碼,運用CSS3的border-radius圓角屬性、box-shadow陰影屬性等屬性制作出來的,感興趣的小伙伴2016-04-25- 粒子動畫就是頁面上存在大量的粒子構(gòu)建而成的動畫。傳統(tǒng)的粒子動畫主要由 Canvas、WebGL 實現(xiàn),接下來通過本文給大家介紹使用 CSS 構(gòu)建強大且酷炫的粒子動畫效果,感興趣的2022-08-09