特效描述:html5 跟随鼠标移动 银河星系 背景动画特效。html5银河星系背景动画,鼠标的移动、点击会发生相应的变化!
代码结构
1. HTML代码
流星雨
body {margin:0;padding:0;background-color:#000000;font-size:0;overflow:hidden}
div {margin:0;padding:0;position:absolute;font-size:0;overflow:hidden}
canvas{background-color:#000000;overflow:hidden}
function $i(id) { return document.getElementById(id); }
function $r(parent,child) { (document.getElementById(parent)).removeChild(document.getElementById(child)); }
function $t(name) { return document.getElementsByTagName(name); }
function $c(code) { return String.fromCharCode(code); }
function $h(value) { return ( +Math.max(0,Math.min(255,Math.round(value))).toString(16)).slice(-2); }
function _i(id,value) { $t(div)[id].innerHTML+=value; }
function _h(value) { return !hires?value:Math.round(value/2); }
functio