// ==UserScript==
// @name 点击特效
// @namespace https://github.com/CListery
// @license MIT
// @version 0.1
// @description 炫就完了
// @author CListery
// @include *://*
// @grant none
// @run-at document-idle
// @icon data:image/svg+xml;base64,PHN2ZyB0PSIxNzQwNTYwNzY1NDI0IiBjbGFzcz0iaWNvbiIgc3R5bGU9IndpZHRoOiAxLjAwNDg4MjgxMjVlbTtoZWlnaHQ6IDFlbTt2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO2ZpbGw6IGN1cnJlbnRDb2xvcjtvdmVyZmxvdzogaGlkZGVuOyIgdmlld0JveD0iMCAwIDEwMjkgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjYxNzYiPjxwYXRoIGQ9Ik04MTguNTg2IDY4Mi42NjdsMzQuMDY1IDEwMi4wNTggMTA4LjgxNyAzMy45OTdMODUyLjY1IDg1Mi43MmwtMzQuMDY1IDEwMi4wNTktMzMuOTk3LTEwMi4wNi0xMDEuOTktMzMuOTk2IDEwMS45OS0zMy45OTcgMzMuOTk3LTEwMi4wNTh6IG0tNjgyLjY2Ny02MTQuNGwzNC4wNjUgMTAyLjA1OCAxMDguODE3IDMzLjk5Ny0xMDguODE3IDMzLjk5Ny0zNC4wNjUgMTAyLjA1OUwxMDEuOTkgMjM4LjI1IDAgMjA0LjI1NGwxMDEuOTktMzMuOTk3IDMzLjkyOS0xMDEuOTl6TTQzMS4xMDQgNTUwLjk4YzEzLjY1My0xMy42NTMgNDAuODIzLTEzLjY1MyA1NC40MDkgMCAxMy42NTMgMTMuNjU0IDEzLjY1MyA0MC44MjQgMCA1NC40MDlMMTM4LjY1IDk0NS41NjJjLTYuODI3IDYuODI2LTIwLjQ4IDEzLjU4NS0yNy4yMzkgMTMuNTg1LTYuODI2IDAtMjAuNDEyIDAtMjcuMjM4LTEzLjY1NC0xMy41ODUtMTMuNTg1LTEzLjU4NS00MC43NTUgMC01NC40MDhMNDMx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zLjI5NGMwIDYuODI3IDAgMjAuMzQ0LTYuODI2IDI3LjE3TDQzMS4xMDQgMzgwLjkyOGwxNjMuMjk0IDI3LjIzOGMxMy42NTMgMCAyMC40MTIgNi44MjcgMjcuMTcgMTMuNTg1bDc0LjgyIDE0Mi44MTQgNjEuMjM1LTE1Ni4zOTljMC02LjgyNiAxMy42NTQtMTMuNjUzIDIwLjQ4LTEzLjY1M2wxNjMuMTU4LTI3LjE3LTExNS41NzYtMTA4Ljg4NXoiIGZpbGw9IiNmZmZmZmYiIHAtaWQ9IjYxNzciPjwvcGF0aD48L3N2Zz4=
// ==/UserScript==
(()=>{{const t="click-effect";if(document.getElementById(t))return;let i,n,e,o,s,r,h,a,l=[],d=!1;const c=["#F73859","#14FFEC","#00E0FF","#FF99FE","#FAF15D"],u=document.createElement("canvas");u.id=t,document.body.appendChild(u),u.setAttribute("style","width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;");const g=document.createElement("span");function w(){u.width=2*window.innerWidth,u.height=2*window.innerHeight,u.style.width=window.innerWidth+"px",u.style.height=window.innerHeight+"px",s.scale(2,2),i=u.width=window.innerWidth,n=u.height=window.innerHeight,e={x:i/2,y:n/2},o={x:i/2,y:n/2}}g.classList.add("pointer"),document.body.appendChild(g),u.getContext&&window.addEventListener&&(s=u.getContext("2d"),w(),window.addEventListener("resize",w,!1),function t(){s.fillStyle="rgba(255, 255, 255, 0)",s.clearRect(0,0,u.width,u.height);for(let t=0;t<l.length;t++){let i=l[t];i.radius<0||(s.fillStyle=i.rgba(),s.beginPath(),s.arc(i.x,i.y,i.radius,0,2*Math.PI,!1),s.fill(),i.update())}!function(){for(let t=0;t<l.length;t++){let e=l[t];(e.x+e.radius<0||e.x-e.radius>i||e.y+e.radius<0||e.y-e.radius>n||e.radius<0)&&l.splice(t,1)}}(),requestAnimationFrame(t)}(),window.addEventListener("mousedown",(function(t){d=!1,r=t.clientX,h=t.clientY,a=t.timeStamp}),!1),window.addEventListener("mouseup",(function(t){d||function(t=1,i=e.x,n=e.y,o=0){for(let e=0;e<t;e++)l.push(new f(i,n,o))}(m(10,20),t.clientX,t.clientY)}),!1),window.addEventListener("mousemove",(function(t){const i=t.clientX,n=t.clientY,e=i-r,o=n-h;(Math.abs(e)>20||Math.abs(o)>20)&&(d=!0,r=0,h=0,a=0)}),!1));class f{constructor(t=e.x,i=e.y,n=0){this.x=t,this.y=i,this.angle=2*Math.PI*Math.random(),this.multiplier=n>0?m(14+n,15+n):m(6,12),this.vx=(this.multiplier+.5*Math.random())*Math.cos(this.angle),this.vy=(this.multiplier+.5*Math.random())*Math.sin(this.angle),this.radius=m(8,12)+3*Math.random(),this.originColor=c[Math.floor(Math.random()*c.length)],this.color=this.calColor(),this.rgba=function(){return"rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}calColor(){return{r:this.color?.r?this.color.r:parseInt(this.originColor.substring(1,3),16),g:this.color?.g?this.color.g:parseInt(this.originColor.substring(3,5),16),b:this.color?.b?this.color.b:parseInt(this.originColor.substring(5,7),16),a:this.radius/23}}update(){this.x+=this.vx-o.x,this.y+=this.vy-o.y,o.x=-2/window.innerWidth*Math.sin(this.angle),o.y=-2/window.innerHeight*Math.cos(this.angle),this.radius-=.3,this.vx*=.9,this.vy*=.9,this.color=this.calColor()}}function m(t,i){return Math.floor(Math.random()*i)+t}}})();