[前端]纯css实现图片自动闪耀闪光划过效果css3特效logo

 2016-06-11 12:17:24   评论   4,024次浏览

大家可以看到本站logo,在自动载入的情况下能够有一个闪光的效果,这种效果既不是十分的狂躁,又闲的夺目。那么这种效果是如何实现的呢?

闪光

当然,传统gif图是可以的,现在我们做的是css实现,GIF图的弊端很多,这里不一一赘述。

在容器中logo-site的div或者其他类似标识。

css代码如下:
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}

.logo-site, .logo-sites {
position: relative;
margin: 0 auto;
transition-duration: .5s;
}
.logo-site {
width: 255px;
overflow: hidden;
}
.logo-site:before{
content:"";
position: absolute;
left: -665px;
top: -460px;
width: 200px;
height: 15px;
background-color: rgba(255,255,255,.5);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-animation: searchLights 1s ease-in 1s infinite;
-o-animation: searchLights 1s ease-in 1s infinite;
animation: searchLights 1s ease-in 1s infinite;
}
@-webkit-keyframes searchLights {
0% { left: -100px; top: 0; }
to { left: 120px; top: 100px; }
}
@-o-keyframes searchLights {
0% { left: -100px; top: 0; }
to { left: 120px; top: 100px; }
}
@-moz-keyframes searchLights {
0% { left: -100px; top: 0; }
to { left: 120px; top: 100px; }
}
@keyframes searchLights {
0% { left: -100px; top: 0; }
to { left: 120px; top: 100px; }
}

蚂蚁森林为我浇水吧!

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: