這篇文章主要講解了“怎么用純css3實現(xiàn)的發(fā)光屏幕旋轉特效”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“怎么用純css3實現(xiàn)的發(fā)光屏幕旋轉特效”吧!
十年專注成都網(wǎng)站制作,成都企業(yè)網(wǎng)站定制,個人網(wǎng)站制作服務,為大家分享網(wǎng)站制作知識、方案,網(wǎng)站設計流程、步驟,成功服務上千家企業(yè)。為您提供網(wǎng)站建設,網(wǎng)站制作,網(wǎng)頁設計及定制高端網(wǎng)站建設服務,專注于成都企業(yè)網(wǎng)站定制,高端網(wǎng)頁制作,對雨棚定制等多個方面,擁有豐富的網(wǎng)站運維經(jīng)驗。
今天給大家?guī)硪豢罴僣ss3實現(xiàn)的發(fā)光屏幕旋轉特效。該屏幕由純css3實現(xiàn)帶發(fā)光旋轉特效,效果圖如下:
實現(xiàn)的代碼。
html代碼:
XML/HTML Code復制內(nèi)容到剪貼板
<div class="screen">
</div>
css3代碼:
CSS Code復制內(nèi)容到剪貼板
*{
margin: 0;
padding: 0;
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,body{
height: 100%;
}
html{
background-color: #1d1d1d;
}
body{
position: relative;
margin: 0;
padding: 0;
transform-style: preserve-3d;
-webkit-perspective: 500px;
perspective: 500px;
}
/*Screen*/
.screen{
position: absolute;
top: 50%;
left: 50%;
width: 320px;
height: 210px;
margin-top: -105px;
margin-left: -160px;
border-radius: 8px;
box-shadow: 0 0 80px #0caba8;
overflow: hidden;
z-index: 100000;
-webkit-animation: screenMove01 2s,
boxShine 2.5s 2s infinite alternate ,
screenMove02 5s infinite alternate linear;
-moz-animation: screenMove01 2s,
boxShine 2.5s 2s infinite alternate ,
screenMove02 5s infinite alternate linear;
-o-animation: screenMove01 2s,
boxShine 2.5s 2s infinite alternate ,
screenMove02 5s infinite alternate linear;
animation: screenMove01 2s,
boxShine 2.5s 2s infinite alternate ,
screenMove02 5s infinite alternate linear;
}
.screen::before{
display: block;
content:"";
position: absolute;
top: 0;
left: 0;
width: 320px;
height: 210px;
border-width: 5px;
border-style: solid;
border-image: -webkit-linear-gradient(to bottombottom, rgba(29,186,180,1) 0%, rgba(126,252,247,1) 26%, rgba(227,253,252,1) 30%, rgba(126,252,247,1) 36%, rgba(29,186,180,1) 52%, rgba(29,186,180,1) 74%, rgba(164,247,244,1) 91%, rgba(29,186,180,1) 100%) 1;
border-image: -moz-linear-gradient(to bottombottom, rgba(29,186,180,1) 0%, rgba(126,252,247,1) 26%, rgba(227,253,252,1) 30%, rgba(126,252,247,1) 36%, rgba(29,186,180,1) 52%, rgba(29,186,180,1) 74%, rgba(164,247,244,1) 91%, rgba(29,186,180,1) 100%) 1;
border-image: -o-linear-gradient(to bottombottom, rgba(29,186,180,1) 0%, rgba(126,252,247,1) 26%, rgba(227,253,252,1) 30%, rgba(126,252,247,1) 36%, rgba(29,186,180,1) 52%, rgba(29,186,180,1) 74%, rgba(164,247,244,1) 91%, rgba(29,186,180,1) 100%) 1;
border-image: linear-gradient(to bottombottom, rgba(29,186,180,1) 0%, rgba(126,252,247,1) 26%, rgba(227,253,252,1) 30%, rgba(126,252,247,1) 36%, rgba(29,186,180,1) 52%, rgba(29,186,180,1) 74%, rgba(164,247,244,1) 91%, rgba(29,186,180,1) 100%) 1;
}
.screen::after{
display: block;
content:"";
position: absolute;
top: 3px;
left: 3px;
width: 314px;
height: 204px;
border: 3px solid #1d1d1d;
border-color:rgba(29,29,29,0.9);
border-radius: 5px;
background: -webkit-linear-gradient( 135deg, rgba(29,186,180,1) 0%, rgba(227,253,252,1) 17%, rgba(227,253,252,1) 25%, rgba(42,197,191,1) 48%, rgba(126,252,247,1) 93%, rgba(29,186,180,1) 100%);
background: -moz-linear-gradient( 135deg, rgba(29,186,180,1) 0%, rgba(227,253,252,1) 17%, rgba(227,253,252,1) 25%, rgba(42,197,191,1) 48%, rgba(126,252,247,1) 93%, rgba(29,186,180,1) 100%);
background: -o-linear-gradient( 135deg, rgba(29,186,180,1) 0%, rgba(227,253,252,1) 17%, rgba(227,253,252,1) 25%, rgba(42,197,191,1) 48%, rgba(126,252,247,1) 93%, rgba(29,186,180,1) 100%);
background: linear-gradient( 135deg, rgba(29,186,180,1) 0%, rgba(227,253,252,1) 17%, rgba(227,253,252,1) 25%, rgba(42,197,191,1) 48%, rgba(126,252,247,1) 93%, rgba(29,186,180,1) 100%);
-webkit-background-size: 300% 300%;
-moz-background-size: 300% 300%;
-o-background-size: 300% 300%;
-ms-background-size: 300% 300%;
background-size: 300% 300%;
-webkit-animation: bgShine 5s infinite alternate linear;
-moz-animation: bgShine 5s infinite alternate linear;
-o-animation: bgShine 5s infinite alternate linear;
animation: bgShine 5s infinite alternate linear;
}
/**/
/*Animation*/
/*screenMove01*/
@-webkit-keyframes screenMove01 {
0% {opacity: 0; top: 100%; transform: rotateY(0deg);}
100% {opacity: 1; top: 50%; transform: rotateY(-30deg);}
}
@-moz-keyframes screenMove01 {
0% {opacity: 0; top: 100%; transform: rotateY(0deg);}
100% {opacity: 1; top: 50%; transform: rotateY(-30deg);}
}
@-o-keyframes screenMove01 {
0% {opacity: 0; top: 100%; transform: rotateY(0deg);}
100% {opacity: 1; top: 50%; transform: rotateY(-30deg);}
}
@keyframes screenMove01 {
0% {opacity: 0; top: 100%; transform: rotateY(0deg);}
100% {opacity: 1; top: 50%; transform: rotateY(-30deg);}
}
/**/
/*screenMove02*/
@-webkit-keyframes screenMove02 {
0% {transform: rotateY(-30deg);}
100% {transform: rotateY(30deg);}
}
@-moz-keyframes screenMove02 {
0% {transform: rotateY(-30deg);}
100% {transform: rotateY(30deg);}
}
@-o-keyframes screenMove02 {
0% {transform: rotateY(-30deg);}
100% {transform: rotateY(30deg);}
}
@keyframes screenMove02 {
0% {transform: rotateY(-30deg);}
100% {transform: rotateY(30deg);}
}
/**/
/*box shine*/
@-webkit-keyframes boxShine {
0% {box-shadow: 0 0 50px #0caba8;}
100% {box-shadow: 0 0 200px #0caba8;}
}
@-moz-keyframes boxShine {
0% {box-shadow: 0 0 50px #0caba8;}
100% {box-shadow: 0 0 200px #0caba8;}
}
@-o-keyframes boxShine {
0% {box-shadow: 0 0 50px #0caba8;}
100% {box-shadow: 0 0 200px #0caba8;}
}
@keyframes boxShine {
0% {box-shadow: 0 0 50px #0caba8;}
100% {box-shadow: 0 0 200px #0caba8;}
}
/**/
/*bg shine*/
@-webkit-keyframes bgShine {
0% {-webkit-background-size: 300% 300%;}
100% {-webkit-background-size: 100% 100%;}
}
@-moz-keyframes bgShine {
0% {-moz-background-size: 300% 300%;}
100% {-moz-background-size: 100% 100%;}
}
@-o-keyframes bgShine {
0% {-o-background-size: 300% 300%;}
100% {-o-background-size: 100% 100%;}
}
@keyframes bgShine {
0% {background-size: 300% 300%;}
100% {background-size: 100% 100%;}
}
感謝各位的閱讀,以上就是“怎么用純css3實現(xiàn)的發(fā)光屏幕旋轉特效”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對怎么用純css3實現(xiàn)的發(fā)光屏幕旋轉特效這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關知識點的文章,歡迎關注!
名稱欄目:怎么用純css3實現(xiàn)的發(fā)光屏幕旋轉特效
文章源于:http://aaarwkj.com/article20/iggojo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、響應式網(wǎng)站、域名注冊、網(wǎng)站改版、網(wǎng)站維護、移動網(wǎng)站建設
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)