环圈立体旋转显示效果,带鼠标感应效果,非常漂亮,根据自己的需求来自定义。
<!doctype html> <html> <head> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>光环立体翻转旋转显示特效_武鸣人</title> <style type="text/css"> html {overflow:hidden} body, .www_wuming_ren {background:#000; overflow:hidden; width:100%; height:100%; position:absolute; margin:0; padding:0} #www_wuming_ren {left:0; top:0; zoom:1} #www_wuming_ren span {position:absolute; font-size:0; line-height:0; overflow:hidden} </style> <script type="text/javascript"> var BeautifullMath = function () { var obj = [], xm = 0, ym = 0, axe = 0, aye = 0, parts = 500, scr, txe, tye, nw, nh; var addEvent = function (o, e, f) { window.addEventListener ? o.addEventListener(e, f, false) : o.attachEvent('on'+e, function(){f.call(e)}) }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var resize = function () { nw = scr.offsetWidth * .5; nh = scr.offsetHeight * .5; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var init = function (n, f) { if(!!n) parts = n; scr = document.getElementById('www_wuming_ren'); addEvent(document, 'mousemove', function(e){ e = e || window.event; xm = e.clientX; ym = e.clientY; }); resize(); addEvent(window, 'resize', resize); __init(f); setInterval(run, 16); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var __init = function (f) { for (var i=0; i<parts; i++) { var o = {}; o.p = document.createElement('span'); scr.appendChild(o.p); var r = i/parts, j, a, b; j = i % (parts * .5); a = Math.floor(j)/200+(Math.floor(j/2)%10)/5* Math.PI * 2; b = Math.acos(-0.9+(j%4)*0.6); r = !!f?f(r):r-r*r+.5; var sbr = Math.sin(b) * r; o.x = Math.sin(a) * sbr; o.y = Math.cos(a) * sbr; o.z = Math.cos(b) * r; obj.push(o); o.transform = function () { var ax = .02 * txe, ay = .02 * tye, cx = Math.cos(ax), sx = Math.sin(ax), cy = Math.cos(ay), sy = Math.sin(ay); //rotation var z = this.y * sx + this.z * cx; this.y = this.y * cx + this.z * -sx; this.z = this.x * -sy + z * cy; this.x = this.x * cy + z * sy; //3d var scale = 1 / (1 + this.z), x = this.x * scale * nh + nw - scale * 2, y = this.y * scale * nh + nh - scale * 2; //set style var p = this.p.style; if (x >= 0 && y >=0 && x < nw * 2 && y < nh * 2) { var c = Math.round(256 + (-this.z * 256)); p.left = Math.round(x) + 'px'; p.top = Math.round(y) + 'px'; p.width = Math.round(scale * 2) + 'px'; p.height = Math.round(scale * 2) + 'px'; p.background = 'rgb('.concat((c),',',(c),',',(1024-c),')'); p.zIndex = 200 + Math.floor(-this.z * 100); } else p.width = "0px"; } } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //run function var run = function () { var se = 1 / nh; txe = (ym - axe) * se; tye = (xm - aye) * se; axe += txe; aye += tye; /* ---- anim particles ---- */ for (var i = 0, o; o = obj[i]; i++) o.transform(); } return {init:init} }(); onload = function () { BeautifullMath.init(500, function(r){ return r=.5 }); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <div id="www_wuming_ren" class="www_wuming_ren"></div> </body> </html>
本文来自武鸣人网站,转载请注明出处