(self.webpackChunkcnblogs_theme_simplememorye_2_1_0=self.webpackChunkcnblogs_theme_simplememorye_2_1_0||[]).push([[8086],{43255:function(){var e;(e=jQuery).fn.circleMagic=function(t){let o,n,a,l,i=!0,r=[],s=e.extend({color:"rgba(255,255,255,.5)",radius:10,density:.3,clearOffset:.2},t),h=this[0];function c(){i=!(document.body.scrollTop>n)}function d(){o=h.clientWidth,n=h.clientHeight,h.height=n+"px",a.width=o,a.height=n}function f(){if(i){l.clearRect(0,0,o,n);for(let e in r)r[e].draw()}requestAnimationFrame(f)}function m(){let e=this;function t(){e.pos.x=Math.random()*o,e.pos.y=n+100*Math.random(),e.alpha=.1+Math.random()*s.clearOffset,e.scale=.1+.3*Math.random(),e.speed=Math.random(),"random"===s.color?e.color="rgba("+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.random().toPrecision(2)+")":e.color=s.color}e.pos={},t(),this.draw=function(){e.alpha<=0&&t(),e.pos.y-=e.speed,e.alpha-=5e-4,l.beginPath(),l.arc(e.pos.x,e.pos.y,e.scale*s.radius,0,2*Math.PI,!1),l.fillStyle=e.color,l.fill(),l.closePath()}}!function(){o=h.offsetWidth,n=h.offsetHeight,function(){let e=document.createElement("canvas");e.id="homeTopCanvas",h.appendChild(e),e.parentElement.style.overflow="hidden"}(),a=document.getElementById("homeTopCanvas"),a.width=o,a.height=n,a.style.position="absolute",a.style.left="0",a.style.bottom="0",a.style.zIndex="1",l=a.getContext("2d");for(let e=0;e<o*s.density;e++){let e=new m;r.push(e)}f()}(),window.addEventListener("scroll",c,!1),window.addEventListener("resize",d,!1)}}}]);