UNPKG

lixin-web

Version:

vue and bootstrap

1 lines 7.12 kB
function utilityClock(t){for(var i=t.querySelector(".dynamic"),e=t.querySelector(".hour"),n=t.querySelector(".minute"),a=t.querySelector(".second"),s=function(t){return t%5==0?o(t):r(t)},o=function(t){var e=document.createElement("div");e.className="minute-text",e.innerHTML=(t<10?"0":"")+t,h(e,t/60,135),i.appendChild(e)},r=function(t){var e=document.createElement("div");e.className="anchor";var n=document.createElement("div");n.className="element minute-line",l(e,t),e.appendChild(n),i.appendChild(e)},c=function(t){var e=document.createElement("div");e.className="hour-text hour-"+t,e.innerHTML=t,h(e,t/12,105),i.appendChild(e)},h=function(t,i,e){var n=2*i*Math.PI;t.style.top=(-e*Math.cos(n)).toFixed(1)+"px",t.style.left=(e*Math.sin(n)).toFixed(1)+"px"},l=function(t,i){t.style.transform=t.style.webkitTransform="rotate("+6*i+"deg)"},m=function(){var t=new Date,i=3600*t.getHours()+60*t.getMinutes()+1*t.getSeconds()+t.getMilliseconds()/1e3;l(a,i),l(n,i/60),l(e,i/60/12),requestAnimationFrame(m)},u=1;u<=60;u++)s(u);for(var u=1;u<=12;u++)c(u);m()}function autoResize(t,i){var e=function(){Math.min(window.innerWidth,window.innerHeight)/i;t.style.transform=t.style.webkitTransform="scale(0.5)"};e(),window.addEventListener("resize",e)}function animate(t){if("function"==typeof t){var i=16;ctx.clearRect(0,0,canvas.width,canvas.height),t(i),RAF(function(){animate(t)})}}function Particle(t,i,e,n,a,s,o){this.x=t,this.y=i,this.ex=e,this.ey=n,this.vx=a,this.vy=s,this.a=1500,this.color=o,this.width=particleSize_x,this.height=particleSize_y,this.stop=!1,this["static"]=!1,this.maxCheckTimes=10,this.checkLength=5,this.checkTimes=0}function useImage(){img.complete?canvasHandle.init():img.onload=function(){canvasHandle.init()}}console.log(AppData.isLogin()),AppData.isLogin()&&(window.location.href="/index.html");var clock=document.querySelector("#utility-clock");utilityClock(clock),clock.parentNode.classList.contains("fill")&&autoResize(clock,327),$(function(){window.onload=function(){function t(){$(".login-close").click(function(){$(".erwema").removeClass("show1")})}$(".login1-2").click(function(){$(this).next(".erwema").toggleClass("show1"),$(this).parents(".login1").siblings().children(".erwema").removeClass("show1")}),$(".erwema").append('<div class="login-close glyphicon glyphicon-remove"></div>'),setTimeout(t(),3e3)}});var Ping=function(){};Ping.prototype.ping=function(t,i,e){function n(){a&&clearTimeout(a);var t=new Date-s;"function"==typeof i&&i(t)}this.img=new Image,e=e||0;var a,s=new Date;this.img.onload=this.img.onerror=n,e&&(a=setTimeout(n,e)),this.img.src=t+"/?"+ +new Date},$(function(){$.post("/api/utils/domain-urls",{},Will.successRes(function(t){function i(){for(var i=new Ping,e=$(".erwema.list ul li"),n=t,a=[],s=0;s<n.length;s++)i.ping(n[s],function(t){return function(i){a.push({SuDu:i,URL:n[t]}),a.length==n.length&&(a.sort(function(t,i){return t.SuDu-i.SuDu}),$.each(a,function(t,i){e.eq(t).find(".speed").html(this.SuDu),e.eq(t).find(".link-text").html(this.URL),e.eq(t).find("a").attr("href",this.URL)}))}}(s));var o=location.href;i.ping(o,function(t){$(".login_xlpm").html(t)})}i(),$('[data-command="reload"]').click(function(){$(".erwema.list ul li").find(".speed").html("..."),i()})}))});var canvas=document.getElementById("particle"),ctx=canvas.getContext("2d");img=document.querySelector(".logo"),canvas.width=150,canvas.height=150;var mouseX=null,mouseY=null,mouseRadius=50,RAF=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();Array.prototype.forEach2=function(t){for(var i=0;i<this.length;i++)t.call("object"==typeof this[i]?this[i]:window,i,this[i])};var particleArray=[],animateArray=[],particleSize_x=1,particleSize_y=2,canvasHandle={init:function(){img.style.visibility="hidden",this._reset(),this._initImageData(),this._execAnimate()},_reset:function(){particleArray.length=0,animateArray.length=0,this.ite=100,this.start=0,this.end=this.start+this.ite},_initImageData:function(){this.imgx=(canvas.width-img.width)/2,this.imgy=(canvas.height-img.height)/2,ctx.clearRect(0,0,canvas.width,canvas.height),ctx.drawImage(img,this.imgx,this.imgy,img.width,img.height);for(var t=ctx.getImageData(this.imgx,this.imgy,img.width,img.height),i=0;i<img.width;i+=particleSize_x)for(var e=0;e<img.height;e+=particleSize_y){var n=4*(e*t.width+i);if(t.data[n+3]>=125){var a,s="rgba("+t.data[n]+","+t.data[n+1]+","+t.data[n+2]+","+t.data[n+3]+")",o=i+20*Math.random(),r=200*-Math.random()+400,c=img.height/2-40*Math.random()+20;a=c<this.imgy+img.height/2?300*Math.random():300*-Math.random(),particleArray.push(new Particle(o+this.imgx,c+this.imgy,i+this.imgx,e+this.imgy,r,a,s)),particleArray[particleArray.length-1].drawSelf()}}},_execAnimate:function(){var t=this;particleArray.sort(function(t,i){return t.ex-i.ex}),this.isInit||(this.isInit=!0,animate(function(i){animateArray.length<particleArray.length&&(t.end>particleArray.length-1&&(t.end=particleArray.length-1),1400==t.end&&setTimeout(function(){img.style.visibility="visible",canvas.style.display="none"},1e3),animateArray=animateArray.concat(particleArray.slice(t.start,t.end)),t.start+=t.ite,t.end+=t.ite),animateArray.forEach2(function(t){this.update(i)})}))}},tickTime=16,oldColor="";Particle.prototype={constructor:Particle,drawSelf:function(){oldColor!=this.color&&(ctx.fillStyle=this.color,oldColor=this.color),ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height)},move:function(t){if(this.stop)this.x=this.ex,this.y=this.ey;else{t/=1e3;var i=this.ex-this.x,e=this.ey-this.y,n=Math.atan(e/i),a=Math.abs(this.a*Math.cos(n));a=this.x>this.ex?-a:a;var s=Math.abs(this.a*Math.sin(n));s=this.y>this.ey?-s:s,this.vx+=a*t,this.vy+=s*t,this.vx*=.95,this.vy*=.95,this.x+=this.vx*t,this.y+=this.vy*t,Math.abs(this.x-this.ex)<=this.checkLength&&Math.abs(this.y-this.ey)<=this.checkLength?(this.checkTimes++,this.checkTimes>=this.maxCheckTimes&&(this.stop=!0)):this.checkTimes=0}},update:function(t){this.move(t),this.drawSelf()}},useImage(),!function(){var t=document.getElementById("rainyDay");t.onload=function(){var t=new RainyDay({image:this,enableSizeChange:!1});t.rain([[3,2,2]],100)},t.crossOrigin="anonymous",t.src="img/login/U1Tqqdw2.jpg",$toggleBtns=$(".check-network").find("> .pull-left:first").add($(".app_download-ios")).add($(".app_download-client")).add($(".host-valid")).click(function(t){t.preventDefault();var i=$(this).is(".active");$toggleBtns.removeClass("active"),$(this)[i?"remove":"addClass"]("active")})}(),$('[data-command="verify"]').click(function(){Will.ajax({url:$('input[name="domain"]').val()},"/api/utils/test-domain",function(t){t?Will.success("域名验证成功!"):Will.warning("域名验证失败!")})}),$('[data-command="forget-password"]').click(function(){var t=$('[name="username"]').val().trim();return""==$('[name="username"]').val()?void Will.warning("请填写您的用户名!"):void WangJiMiMa("","",t)}),$(function(){setTimeout(function(){DengLuVue.checkGuGe()},10)});