This commit is contained in:
杜恒
2021-02-05 10:29:26 +08:00
parent c1bba334ce
commit 08c9f2fdd4
9 changed files with 2435 additions and 2378 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

1
assets/cursor/cursor1.js Normal file
View File

@@ -0,0 +1 @@
"use strict";$(function(){function t(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}}var i=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var e in n){Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}}return t},n=(function(){function t(t,i){for(var n=0;n<i.length;n++){var e=i[n];(e.enumerable=e.enumerable||!1),(e.configurable=!0),"value" in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(i,n,e){return n&&t(i.prototype,n),e&&t(i,e),i}})(),e=(function(){function e(n){var o=n.origin,r=n.speed,s=n.color,a=n.angle,h=n.context;t(this,e),(this.origin=o),(this.position=i({},this.origin)),(this.color=s),(this.speed=r),(this.angle=a),(this.context=h),(this.renderCount=0)}return(n(e,[{key:"draw",value:function(){(this.context.fillStyle=this.color),this.context.beginPath(),this.context.arc(this.position.x,this.position.y,2,0,2*Math.PI),this.context.fill()}},{key:"move",value:function(){(this.position.x=Math.sin(this.angle)*this.speed+this.position.x),(this.position.y=Math.cos(this.angle)*this.speed+this.position.y+0.3*this.renderCount),this.renderCount++}}]),e)})(),o=(function(){function i(n){var e=n.origin,o=n.context,r=n.circleCount,s=void 0===r?10:r,a=n.area;t(this,i),(this.origin=e),(this.context=o),(this.circleCount=s),(this.area=a),(this.stop=!1),(this.circles=[])}return(n(i,[{key:"randomArray",value:function(t){var i=t.length;return t[Math.floor(i*Math.random())]}},{key:"randomColor",value:function(){var t=["8","9","A","B","C","D","E","F"];return"#"+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)}},{key:"randomRange",value:function(t,i){return(i-t)*Math.random()+t}},{key:"init",value:function(){for(var t=0;t<this.circleCount;t++){var i=new e({context:this.context,origin:this.origin,color:this.randomColor(),angle:this.randomRange(Math.PI-1,Math.PI+1),speed:this.randomRange(1,6)});this.circles.push(i)}}},{key:"move",value:function(){var t=this;this.circles.forEach(function(i,n){if(i.position.x>t.area.width||i.position.y>t.area.height){return t.circles.splice(n,1)}i.move()}),0==this.circles.length&&(this.stop=!0)}},{key:"draw",value:function(){this.circles.forEach(function(t){return t.draw()})}}]),i)})();new ((function(){function i(){t(this,i),(this.computerCanvas=document.createElement("canvas")),(this.renderCanvas=document.createElement("canvas")),(this.computerContext=this.computerCanvas.getContext("2d")),(this.renderContext=this.renderCanvas.getContext("2d")),(this.globalWidth=window.innerWidth),(this.globalHeight=window.innerHeight),(this.booms=[]),(this.running=!1)}return(n(i,[{key:"handleMouseDown",value:function(t){var i=new o({origin:{x:t.clientX,y:t.clientY},context:this.computerContext,area:{width:this.globalWidth,height:this.globalHeight}});i.init(),this.booms.push(i),this.running||this.run()}},{key:"handlePageHide",value:function(){(this.booms=[]),(this.running=!1)}},{key:"init",value:function(){var t=this.renderCanvas.style;(t.position="fixed"),(t.top=t.left=0),(t.zIndex="5201314"),(t.pointerEvents="none"),(t.width=this.renderCanvas.width=this.computerCanvas.width=this.globalWidth),(t.height=this.renderCanvas.height=this.computerCanvas.height=this.globalHeight),document.body.append(this.renderCanvas),window.addEventListener("mousedown",this.handleMouseDown.bind(this)),window.addEventListener("pagehide",this.handlePageHide.bind(this))}},{key:"run",value:function(){var t=this;if(((this.running=!0),0==this.booms.length)){return(this.running=!1)}requestAnimationFrame(this.run.bind(this)),this.computerContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.renderContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.booms.forEach(function(i,n){if(i.stop){return t.booms.splice(n,1)}i.move(),i.draw()}),this.renderContext.drawImage(this.computerCanvas,0,0,this.globalWidth,this.globalHeight)}}]),i)})())().init()});

1
assets/cursor/cursor2.js Normal file

File diff suppressed because one or more lines are too long

1
assets/cursor/cursor3.js Normal file
View File

@@ -0,0 +1 @@
$(document).ready(function(){var e=0;$("html").click(function(t){var n=new Array("富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善"),o=$("<span/>").text(n[e]);e=(e+1)%n.length;var a=t.pageX,c=t.pageY;o.css({"z-index":5201314,top:c-20,left:a,position:"fixed","font-weight":"bold",color:"var(--theme)","user-select":"none"}),$("body").append(o),o.animate({top:c-180,opacity:0},1500,function(){o.remove()})})});

1
assets/cursor/cursor4.js Normal file
View File

@@ -0,0 +1 @@
"use strict";!(function(e,t,a){function r(){for(var e=0;e<i.length;e++){i[e].alpha<=0?(t.body.removeChild(i[e].el),i.splice(e,1)):(i[e].y--,(i[e].scale+=0.004),(i[e].alpha-=0.013),(i[e].el.style.cssText="left:"+i[e].x+"px;top:"+i[e].y+"px;opacity:"+i[e].alpha+";transform:scale("+i[e].scale+","+i[e].scale+") rotate(45deg);background:"+i[e].color+";z-index:5201314"))}requestAnimationFrame(r)}function n(e){var a=t.createElement("div");(a.className="heart"),i.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:o()}),t.body.appendChild(a)}function o(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var i=[];(e.requestAnimationFrame=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1000/60)}),(function(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)})(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),(function(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),n(e)}})(),r()})(window,document);