Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
個好的開篇,會給你這個項目增加不少分值。
有沒有遇到過打開頁面加載一段時間,頁面內容才加載出來。在等待加載的過程中頁面卻是空白頁,給用戶的體驗特別不好,會讓項目降一個檔次。下面的十六種炫酷炸裂的css加載動畫,會讓你在等待的過程中,體驗視覺盛宴,給用戶不一般的加載體驗,對,就是純css3的炫酷加載動畫,請看效果!
碼字不易,且行且珍惜。
加載1
css源碼
.title{ width: 100%; text-align: center; margin:60px 0; font-size: 18px; color: #999; } .loadingOne{ width: 80px; height: 40px; margin: 0 auto; } .loadingOne span{ display: inline-block; width: 8px; height: 100%; border-radius: 4px; background: lightgreen; -webkit-animation: load 1s ease infinite; animation: load 1s ease infinite; } @-webkit-keyframes load{ 0%,100%{ height: 40px; background: lightgreen; } 50%{ height: 70px; margin: -15px 0; background: lightblue; } } .loadingOne span:nth-child(2){ -webkit-animation-delay:0.2s; animation-delay:0.2s; } .loadingOne span:nth-child(3){ -webkit-animation-delay:0.4s; animation-delay:0.4s; } .loadingOne span:nth-child(4){ -webkit-animation-delay:0.6s; animation-delay:0.6s; } .loadingOne span:nth-child(5){ -webkit-animation-delay:0.8s; animation-delay:0.8s; }
html源碼
<div class="loadingOne"> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <p class="title">[加載1]</p>
加載2
css源碼
.loadingTwo{ width: 150px; height: 4px; border-radius: 2px; margin: 0 auto; margin-top:100px; position: relative; background: lightgreen; -webkit-animation: changeBgColor 1.04s ease-in infinite alternate; animation: changeBgColor 1.04s ease-in infinite alternate; } .loadingTwo span{ display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: lightgreen; position: absolute; margin-top: -7px; margin-left:-8px; -webkit-animation: changePosition 1.04s ease-in infinite alternate; animation: changePosition 1.04s ease-in infinite alternate; } @-webkit-keyframes changeBgColor{ 0%{ background: lightgreen; } 100%{ background: lightblue; } } @-webkit-keyframes changePosition{ 0%{ background: lightgreen; } 100%{ margin-left: 142px; background: lightblue; } }
html源碼
<div class="loadingTwo"> <span></span> </div>
加載3
css源碼
.loadingThree{ width: 150px; height: 15px; margin: 0 auto; margin-top:100px; } .loadingThree span{ display: inline-block; width: 15px; height: 100%; margin-right: 5px; border-radius: 50%; background: lightgreen; -webkit-animation: load 1.04s ease infinite; } .loadingThree span:last-child{ margin-right: 0px; } @-webkit-keyframes load{ 0%{ opacity: 1; } 100%{ opacity: 0; } } .loadingThree span:nth-child(1){ -webkit-animation-delay:0.13s; } .loadingThree span:nth-child(2){ -webkit-animation-delay:0.26s; } .loadingThree span:nth-child(3){ -webkit-animation-delay:0.39s; } .loadingThree span:nth-child(4){ -webkit-animation-delay:0.52s; } .loadingThree span:nth-child(5){ -webkit-animation-delay:0.65s; }
html源碼
<div class="loadingThree"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>
加載4
css源碼
.loadingFour{ width: 150px; height: 15px; margin: 0 auto; margin-top:100px; text-align: center; } .loadingFour span{ display: inline-block; width: 15px; height: 100%; margin-right: 5px; background: lightgreen; -webkit-animation: load 1.04s ease infinite; } .loadingFour span:last-child{ margin-right: 0px; } @-webkit-keyframes load{ 0%{ opacity: 1; } 100%{ opacity: 0; } } .loadingFour span:nth-child(1){ -webkit-animation-delay:0.13s; } .loadingFour span:nth-child(2){ -webkit-animation-delay:0.26s; } .loadingFour span:nth-child(3){ -webkit-animation-delay:0.39s; } .loadingFour span:nth-child(4){ -webkit-animation-delay:0.52s; } .loadingFour span:nth-child(5){ -webkit-animation-delay:0.65s; }.loadingTwo{ width: 150px; height: 4px; border-radius: 2px; margin: 0 auto; margin-top:100px; position: relative; background: lightgreen; -webkit-animation: changeBgColor 1.04s ease-in infinite alternate; animation: changeBgColor 1.04s ease-in infinite alternate; } .loadingTwo span{ display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: lightgreen; position: absolute; margin-top: -7px; margin-left:-8px; -webkit-animation: changePosition 1.04s ease-in infinite alternate; animation: changePosition 1.04s ease-in infinite alternate; } @-webkit-keyframes changeBgColor{ 0%{ background: lightgreen; } 100%{ background: lightblue; } } @-webkit-keyframes changePosition{ 0%{ background: lightgreen; } 100%{ margin-left: 142px; background: lightblue; } }
html源碼
<div class="loadingFour"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>
加載5
css源碼
.loadingFive{ width: 150px; height: 15px; margin: 0 auto; margin-top:100px; } .loadingFive span{ display: inline-block; width: 15px; height: 100%; margin-right: 5px; background: lightgreen; -webkit-transform-origin: right bottom; -webkit-animation: load 1s ease infinite; } .loadingFive span:last-child{ margin-right: 0px; } @-webkit-keyframes load{ 0%{ opacity: 1; } 100%{ opacity: 0; -webkit-transform: rotate(90deg); } } .loadingFive span:nth-child(1){ -webkit-animation-delay:0.13s; } .loadingFive span:nth-child(2){ -webkit-animation-delay:0.26s; } .loadingFive span:nth-child(3){ -webkit-animation-delay:0.39s; } .loadingFive span:nth-child(4){ -webkit-animation-delay:0.52s; } .loadingFive span:nth-child(5){ -webkit-animation-delay:0.65s; }.loadingTwo{ width: 150px; height: 4px; border-radius: 2px; margin: 0 auto; margin-top:100px; position: relative; background: lightgreen; -webkit-animation: changeBgColor 1.04s ease-in infinite alternate; animation: changeBgColor 1.04s ease-in infinite alternate; } .loadingTwo span{ display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: lightgreen; position: absolute; margin-top: -7px; margin-left:-8px; -webkit-animation: changePosition 1.04s ease-in infinite alternate; animation: changePosition 1.04s ease-in infinite alternate; } @-webkit-keyframes changeBgColor{ 0%{ background: lightgreen; } 100%{ background: lightblue; } } @-webkit-keyframes changePosition{ 0%{ background: lightgreen; } 100%{ margin-left: 142px; background: lightblue; } }.loadingFive{ width: 150px; height: 15px; margin: 0 auto; margin-top:100px; } .loadingFive span{ display: inline-block; width: 15px; height: 100%; margin-right: 5px; background: lightgreen; -webkit-transform-origin: right bottom; -webkit-animation: load 1s ease infinite; } .loadingFive span:last-child{ margin-right: 0px; } @-webkit-keyframes load{ 0%{ opacity: 1; } 100%{ opacity: 0; -webkit-transform: rotate(90deg); } } .loadingFive span:nth-child(1){ -webkit-animation-delay:0.13s; } .loadingFive span:nth-child(2){ -webkit-animation-delay:0.26s; } .loadingFive span:nth-child(3){ -webkit-animation-delay:0.39s; } .loadingFive span:nth-child(4){ -webkit-animation-delay:0.52s; } .loadingFive span:nth-child(5){ -webkit-animation-delay:0.65s; }
html源碼
<div class="loadingSix"> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div>
加載6
css源碼
.loadingSeven{ width: 80px; height: 40px; margin: 0 auto; margin-top:100px; } .loadingSeven span{ display: inline-block; width: 8px; height: 100%; border-radius: 4px; background: lightgreen; -webkit-animation: loadsaven 1.04s ease infinite; } @-webkit-keyframes loadsaven{ 0%,100%{ height: 40px; background: lightgreen; } 50%{ height: 60px; margin-top: -20px; background: lightblue; } } .loadingSeven span:nth-child(2){ -webkit-animation-delay:0.13s; } .loadingSeven span:nth-child(3){ -webkit-animation-delay:0.26s; } .loadingSeven span:nth-child(4){ -webkit-animation-delay:0.39s; } .loadingSeven span:nth-child(5){ -webkit-animation-delay:0.52s; }
html源碼
<div class="loadingSeven"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>
加載7
css源碼
.loadingSeven{ width: 80px; height: 40px; margin: 0 auto; margin-top:100px; } .loadingSeven span{ display: inline-block; width: 8px; height: 100%; border-radius: 4px; background: lightgreen; -webkit-animation: loadsaven 1.04s ease infinite; } @-webkit-keyframes loadsaven{ 0%,100%{ height: 40px; background: lightgreen; } 50%{ height: 60px; margin-top: -20px; background: lightblue; } } .loadingSeven span:nth-child(2){ -webkit-animation-delay:0.13s; } .loadingSeven span:nth-child(3){ -webkit-animation-delay:0.26s; } .loadingSeven span:nth-child(4){ -webkit-animation-delay:0.39s; } .loadingSeven span:nth-child(5){ -webkit-animation-delay:0.52s; }
html源碼
<div class="loadingSeven"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>
加載8
css源碼
.loadingEight{ width: 80px; height: 80px; border-radius: 50%; margin: 0 auto; margin-top:100px; position: relative; border:5px solid lightgreen; -webkit-animation: turn 2s linear infinite; } .loadingEight span{ display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: lightgreen; position: absolute; left: 50%; margin-top: -15px; margin-left: -15px; -webkit-animation: changeBgColor 2s linear infinite; } @-webkit-keyframes changeBgColor{ 0%{ background: lightgreen; } 100%{ background: lightblue; } } @-webkit-keyframes turn{ 0%{ -webkit-transform: rotate(0deg); border-color: lightgreen; } 100%{ -webkit-transform: rotate(360deg); border-color: lightblue; } }
html源碼
<div class="loadingEight"> <span></span> </div>
搬你想搬,蓋你所需,碼字不易,且行且珍惜!
用 HTML 和 CSS 制作 LOGO 動畫要比以前更容易,通過使用最新的 JavaScript 庫也能夠使網頁動畫制作的更加精良。
在本文中,我們將與大家分享 10 個讓人印象深刻的世界知名品牌與未知實體的自定義 LOGO 動畫示例。一起來 Enjoy 吧!
SVG 動畫作為網上最熱門的動畫趨勢之一,備受大家的關注。而這個花的 LOGO 動畫便是一個很好的 SVG 動畫示例。
我們可以看到,此 LOGO 的圖標和文字在<svg>標簽內編寫,通過 CSS 來控制動畫,并可以自動的完成頁面的加載。當然,需要一些 SVG 特定的 CSS 屬性支持,例如stroke-dashoffset(譯者:表示虛線的起始偏移),它會按順序來推動輪廓的運動,進而實現了精美的動畫效果。
項目地址:https://codepen.io/flwrs/pen/gLrygN
Carbon LDP 的 LOGO 動畫相當的復雜。但是開發者 David McFeders 通過 CSS/Compass 實現了 Carbon 的 LOGO 動畫,從而也提升了它的逼格。
無論是 LOGO 的大小,還是動畫的速度都很容易設置。它由純 CSS 實現,并保持著無限的循環。雖然,LOGO 的字母是一張 PNG 圖片,但你也可以隨時利用自己設計的字體進行逆向工程。
項目地址:https://codepen.io/MiguelAraCo/pen/QbZqoQ
Binary Lab 的 LOGO 動畫同樣是本文中比較復雜的動畫效果之一。我們可以看到它的效果:從燒瓶里拉出的數字,在 LOGO 的上方不斷的消失。
動畫效果是由 CSS 控制的。同時,這個作品依賴了 TweenMax 庫來添加重復的數字,并完成自定義的 alpha 轉換。作者很有創意的利用 CSS 與 JS 實現了這個酷炫的 Web 動畫效果。
項目地址:https://codepen.io/iconjunkie/pen/vLEaNZ
Stack Overflow 的 LOGO 是我最喜歡的 LOGO 之一,因為它的設計不僅簡單,而且易識別。而這個作品僅用 CSS3 將 Stack Overflow 的 LOGO 進行了動畫效果的實現。
這是迄今為止我看到的最令人印象深刻的純 CSS 動畫之一。最終的展現也與官方的 LOGO 很搭,同時在主流瀏覽器中動畫都可以流暢的運行。相信,任何喜歡 CSS / SCSS 動畫的朋友都會喜歡上這個作品。
項目地址:https://codepen.io/lindell/pen/mEVgJP
這個作品是由 Tim Pietrusky 利用 SVG 和均勻的 CSS 轉換實現的怪物能量 LOGO 系列動畫。如果你也打算在 LOGO 上實現淡入淡出的特效,就可以復制他的代碼來學習。
它是一款純 CSS 實現的動畫,所有的動畫時間都是由 SCSS 直接進行調控。同時,你也可以通過更改變量來調節動畫的速度,淡化顏色。
項目地址:https://codepen.io/TimPietrusky/pen/vKuja
Subvisual 團隊擁有非常獨特的 LOGO,而開發者 Miguel Palhas 則賦予了它酷炫的動畫效果。你會發現構成它的動畫效果有兩個因素,即 LOGO 的文字和“ S ”形圖標。
作品是基于 SVG 元素構成的,也使操縱更簡單。雖然作品中的大多數動畫都是基于 CSS 編寫的,但它也依賴 JavaScript 庫:TweenLite。同時,這個作品可以根據用戶的操作來重復或觸發動畫效果。(懸停、點擊等)
項目地址:https://codepen.io/naps62/pen/eNMvpQ
通過使用免費的像素字體,任何開發人員都可以制作出自定義的像素動畫。而這個作品就是由 CodePen 的用戶 Khaosmuhaha 所制作的。
他通過 HTML Canvas 元素進行純文本的操作,動畫效果則是由 CSS3 的 animation 屬性進行驅動,而 jQuery 則控制了全部。所以,我們所見的連續像素動畫就這樣實現了。
顯然,這是一個利用 Canvas 元素與 webfont 構成的炫酷的作品。
項目地址:https://codepen.io/Khaosmuhaha/pen/MYzRGz
如果你正在尋找一個真正復雜的 LOGO 動畫,可以看看開發者 Alex Aloia 制作的這個示例。在作品中,作者使用了他的名字作為品牌名稱,并將一系列復雜的 SVG 形狀通過繪圖的動畫效果展現出來。
作品的整體效果只通過 CSS 來實現是不太可能的,還需要一些 JS 庫 (DrawSVG 和更流行的 D3.js)的支持。但是,利用開源庫來實現這種獨一無二的動畫,還是非常有趣的。
項目地址:https://codepen.io/tripl3inf/pen/QwrEMY
Bayleys 的 LOGO 動畫的選擇,有些令人費解。但 LOGO 厚實的邊緣使重制變得易如反掌。開發者 Rafael Contreras 僅通過 38 行代碼便實現了動畫效果。
LOGO 是基于 SVG 標簽制作的,動畫效果則是操縱相應的標簽來實現。而在不同的方向移動的眾多 LOGO 元素,使動畫令人著迷。
項目地址:https://codepen.io/rafita/pen/aNyRgv
這是來自任天堂最新款游戲機的一個 LOGO 動畫。而開發者 Koto Furumiya 在 CodePen 上實現了它們廣告片中的動畫效果。
Koto 使用 SVG 重制了任天堂 Switch 的 LOGO,并用 CSS 實現了它的動畫效果。你會相信這個動畫只需要 50 行的 CSS 代碼嗎?
另外,不得不提這個動畫效果確實很逼真。強有力的下推與反彈回升效果,確實與任天堂 Switch 的開機動畫相吻合。
項目地址:https://codepen.io/kotofurumiya/pen/VPmNrR
今天分享的所有示例都是免費與開源的,希望你能將它們應用在你自己的項目上。同時,也希望你能喜歡這些 Demos。如果你正在尋找更多關于 CSS 動畫的示例,也可以了解下這個合輯。
感謝你的閱讀。
注:
本文版權歸原作者所有,僅用于學習與交流。
如需轉載譯文,煩請按下方注明出處信息,謝謝!
英文原文:10 Amazing Examples of CSS & JavaScript Animated Logos
作者:Jake Rocheleau
譯者:IT程序獅
譯文地址:http://www.jianshu.com/p/b204e854a942
GitHub精選》是我們分享Github中優質項目的欄目,包括技術、學習、實用與各種有趣的內容。本期推薦的是一個使用純CSS實現動畫加載效果的項目——SpinKit。
SpinKit通過使用transform和opacity屬性實現了包括方塊翻轉、圓點旋轉、圓環縮放和九宮格漸變等10余種動畫加載的效果。
部分效果代碼:
<div class="sk-folding-cube">
<div class="sk-cube1 sk-cube"></div>
<div class="sk-cube2 sk-cube"></div>
<div class="sk-cube4 sk-cube"></div>
<div class="sk-cube3 sk-cube"></div>
</div>
.sk-folding-cube {
margin: 20px auto;
width: 40px;
height: 40px;
position: relative;
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg);
}
.sk-folding-cube .sk-cube {
float: left;
width: 50%;
height: 50%;
position: relative;
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.sk-folding-cube .sk-cube:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #333;
-webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
animation: sk-foldCubeAngle 2.4s infinite linear both;
-webkit-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
.sk-folding-cube .sk-cube2 {
-webkit-transform: scale(1.1) rotateZ(90deg);
transform: scale(1.1) rotateZ(90deg);
}
.sk-folding-cube .sk-cube3 {
-webkit-transform: scale(1.1) rotateZ(180deg);
transform: scale(1.1) rotateZ(180deg);
}
.sk-folding-cube .sk-cube4 {
-webkit-transform: scale(1.1) rotateZ(270deg);
transform: scale(1.1) rotateZ(270deg);
}
.sk-folding-cube .sk-cube2:before {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.sk-folding-cube .sk-cube3:before {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.sk-folding-cube .sk-cube4:before {
-webkit-animation-delay: 0.9s;
animation-delay: 0.9s;
}
@-webkit-keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0;
} 25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1;
} 90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0;
}
}
@keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0;
} 25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1;
} 90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0;
}
}
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
.spinner {
margin: 100px auto 0;
width: 70px;
text-align: center;
}
.spinner > div {
width: 18px;
height: 18px;
background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}
.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
} 40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
其他效果:
GitHub: https://github.com/tobiasahlin/SpinKit
*請認真填寫需求信息,我們會在24小時內與您取得聯系。