CSS3效果光斑动画(渐变)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}css特效文字
body{
background: black;
text-align: center;
font: 50px/200px "微软雅⿊";
color:rgba(255,255,255,.3);
}
h1{
display: inline-block;
background:linear-gradient(120deg,rgba(255,255,255,0) 100px,rgba(255,255,255,1) 180px,rgba(255,255,255,0) 270px); background-position: -300px 0;
background-repeat:no-repeat ;
-webkit-background-clip: text;
/*transition: 3s;*/
}
/*body:hover h1{
background-position: 1000px 0;
}*/
</style>
</head>
<body>
<h1>北京光电传媒股份</h1>
</body>
<script type="text/javascript">
var h1Node = ElementsByTagName("h1")[0];
var left =-300;
move();
function move(){
setInterval(function(){
left+=10;
if(left>1000){
left=-300;
}
h1Node.style.backgroundPosition=left+"px 0px";
},20)
}
</script>
</html>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。