炫彩字and鼠标爱心

Posted 1112zx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了炫彩字and鼠标爱心相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>



    <style type="text/css">
    body{
        background-color: black;
    }
     #zx {
             font-weight: 600;
            font-size: 28px;
            font-family: "黑体";
            color: #8c888b;
            background: -webkit-linear-gradient(45deg, #70f7fe, #fbd7c6, #fdefac, #bfb5dd, #bed5f5);
           
            color: transparent;
            /*设置字体颜色透明*/
            -webkit-background-clip: text;
            /*背景裁剪为文本形式*/
            animation: ran 10s linear infinite;
            /*动态10s展示*/
        }

        @keyframes ran {
            from {
                backgroud-position: 0 0;
            }
            to {
                background-position: 2000px 0;
            }
        }

    </style>


    <script type="text/javascript"> 
function changeColor(){ 
//var color="#f00|#0f0|#00f|#880|#808|#088|#bcc8ed|#|#|#|#234|#534";//定义一条变换颜色的字符串
var color="#fce1bb|#fce9b2|#e3d7c1|#cdc2d3|#c6bbd8|#bcc7ec|#b2e8e2|#b3e7e2|#e4dacc|#fcd9c4|#fbe1bb";
    color=color.split("|"); //然后通过split方法进行分割
var xuan = document.getElementsByTagName("h1");//获得元素
for(var i=0;i<xuan.length;i++){
xuan[i].style.color=color[parseInt(Math.random() * color.length)];

}
} 
setInterval("changeColor()",100);//死循环,每0.1秒变换一种颜色
//爱心特效

!function(e, t, a) {
function r() {
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
requestAnimationFrame(r)
}
function n() {
var t = "function" == typeof e.onclick && e.onclick;
e.onclick = function(e) {
t && t(),
o(e)
}
}
function o(e) {
var a = t.createElement("div");
a.className = "heart",
s.push({
el: a,
x: e.clientX - 5,
y: e.clientY - 5,
scale: 1,
alpha: 1,
color: c()
}),
t.body.appendChild(a)
}
function i(e) {
var a = t.createElement("style");
a.type = "text/css";
try {
a.appendChild(t.createTextNode(e))
} catch(t) {
a.styleSheet.cssText = e
}
t.getElementsByTagName("head")[0].appendChild(a)
}
function c() {
return "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")"
}
var s = [];
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame ||
function(e) {
setTimeout(e, 1e3 / 60)
},
i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: ‘‘;width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),
n(),
r()
} (window, document);

</head>

<body>

<marquee direction="left">
    <a id="zx">
    <br>??嘀嘀哞哞</br>
    <br>&nbsp;&nbsp;&nbsp;星星上的张优秀??</br>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;星星上的张优秀??</br>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;星星上的张优秀??</br>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;星星上的张优秀</br>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;星星上的张优秀</br>
    
    </a>
    </marquee>
    
    
   <scrollamount=#> <marquee scrollamount=20><h1>?嘻嘻?</h1></marquee>


</body>

以上是关于炫彩字and鼠标爱心的主要内容,如果未能解决你的问题,请参考以下文章

QQ空间上鼠标动那里就有字跟在后面怎么弄的动画啊

Typecho炫彩鼠标插件:HoerMouse

HTML5+CSS3小实例:炫彩的发光字特效

网页精美动效/动画制作 按钮鼠标悬浮动效的注意点 02《炫彩网页 iVX 无代码动效/动画制作》

网页精美动效/动画制作 按钮鼠标悬浮动效基础 01《炫彩网页 iVX 无代码动效/动画制作》

随鼠标动的炫彩小球