En el fondo de la página para agregar el blog de animación, siga las líneas de ratones

Fuente: https://www.cnblogs.com/Sharley/p/9603129.html

efecto:

 

 

Situado en un modo de blog es "Administrar -> Configuración" y, a continuación, añadir el código HTML en el ajuste de pie de página en

<script> 
 
! función () { 
 
 función n (n, e, t) { 
 
 retorno n.getAttribute (e) || t 
 
 } 
 
 la función e (n) { 
 
 volver document.getElementsByTagName (n) 
 
 } 
 
 la función t () { 
 
 var t = e ( "script"), o = t.length, i = t [o-1 ]; 
 
 retorno { 
 
 l: o, z: n (i, "zIndex", - 1), o: n (i, "opacidad", 5.), c: n (i, "color", "0,0,0 "), n: n (i," Count", 99 ) 
 
 } 
 
 } 
 
 la función o () { 
 
 un = = M.Width window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 
 
 c= m.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight 
 
 } 
 
 funcione i () { 
 
 r.clearRect ( 0,0 , a, c); 
 
 var n, e, t, o, m, l; 
 
 s.forEach ( función (i, x) { 
 
 para (i.x + = i.xa, i.y + = i.ya, i.xa * = ix> a || ix <0 -1: 1, i. ? ya * = iy> c || iy <0 -1: 1, r.fillRect (ix-0,5, iy-.5,1,1), e = x + 1; e <u.length; e ++) n = u [e], 
 
 nula ! == nx && nulo ! == ny && (o = ix-nx, m = iy- ny, 
 
 l = o * o + m * m, l <n.max && (n === y && l> = n.max / 2 && (ix -. = 03 o *, iy -. = 03 m *),
  
 t = (n.max-l) /n.max,r.beginPath (), r.lineWidth = t / 2, r.strokeStyle = "RGBA (" + D.C +",, r.moveTo (ix, iy), r.lineTo (nx, ny), r.stroke ())) 
 
 }), 

 x (i) 
 
 } 
 
 var a, c, u, m = document.createElement ( "lienzo" ), 
 
 d = t (), l = "C_n" + dl, r = m.getContext ( "2D" ), 
x = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || ventana .msRequestAnimationFrame || función (n) { 
 window.setTimeout (n, 1E3 / 45)
 
 }, 
 w = Math.random, Y = {x: nulo , y: nulo , max: 2E4}; m.id = l, m.style.cssText = "posición: fijo; top: 0; izquierda: 0; z-index:" + d.z + "; opacidad:" + hacer, e ( "cuerpo") [0] .appendChild (m), o (), ventana.
 
 
 
 
 
 window.onmousemove = función (n) { 
 
 n = n || window.event, yx = n.clientX, yy = n.clientY 
 
 }, 
 
 window.onmouseout = función () { 
 
 yx = nula , yy = nulo 
 
 }; 
 
 para ( var = s [], f = 0; dn> f; f ++ ) { 
 
 var H = w () * a, g = w () * c, v = 2 * w () - 1, p = 2 * w () - 1; s.push ({x: h, y: g, xa: v, ya: p, max: 6E3 }) 
 
 } 
 
 u = s.concat ([y]), 
 
 setTimeout ( función () { i ()}, 100 ) 
 
 } (); 
 
 </ script>

 

Supongo que te gusta

Origin www.cnblogs.com/big-ming/p/12449560.html
Recomendado
Clasificación