{"size": 5744, "ext": "js", "max_stars_repo_path": "component---src-pages-land-tsx-037f820cc9331c7dda18.js", "max_stars_repo_name": "Yuni-Q/Yuni-Q.github.io", "max_stars_repo_stars_event_min_datetime": "2020-01-10T09:47:04.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-10T09:47:04.000Z", "max_issues_repo_path": "component---src-pages-land-tsx-037f820cc9331c7dda18.js", "max_issues_repo_name": "Yuni-Q/Yuni-Q.github.io", "max_issues_repo_issues_event_min_datetime": "2020-01-10T09:15:12.000Z", "max_issues_repo_issues_event_max_datetime": "2020-01-16T03:55:51.000Z", "max_forks_repo_path": "component---src-pages-land-tsx-037f820cc9331c7dda18.js", "max_forks_repo_name": "Yuni-Q/Yuni-Q.github.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 2872.0, "max_line_length": 5664, "alphanum_fraction": 0.7303272981}
(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{CAH7:function(t,i,e){"use strict";e.r(i);var s=e("q1tI"),n=e.n(s),a=e("vOnD"),h=function(){function t(t,i,e){this.x=t,this.y=i,this.radius=Math.random()+.5,this.speed=3*Math.random()+.5,this.cm=e}return t.prototype.draw=function(){this.cm.context.beginPath(),this.cm.context.arc(this.x,this.y,this.radius,0,2*Math.PI),this.cm.context.fill()},t}(),r=function(){function t(t,i,e,s){this.x=t,this.y=i,this.height=300;var n=e.canvasHeight-(this.height+(e.canvasHeight-this.y));this.gradient=e.context.createLinearGradient(0,n,0,this.y),this.gradient.addColorStop(0,"rgba("+e.colors2[s]+", 0)"),this.gradient.addColorStop(.5,"rgba("+e.colors2[s]+", 0.5)"),this.gradient.addColorStop(.75,"rgba("+e.colors2[s]+", 0.5)"),this.gradient.addColorStop(1,"rgba("+e.colors2[s]+", 1)");this.particles=[];for(var a=0;a<30;a++)this.particles.push(new h(this.x,this.y,e));this.cm=e}return t.prototype.draw=function(){this.cm.context.strokeStyle=this.gradient,this.cm.context.beginPath(),this.cm.context.moveTo(this.x,this.y),this.cm.context.lineTo(this.x,this.y-this.height),this.cm.context.stroke();for(var t=0;t<this.particles.length;t++){var i=this.particles[t];i.y-=i.speed,i.y<this.y-this.height&&(i.y=this.y),i.draw()}},t}(),c=function(){function t(t,i,e,s){this.x=t,this.y=i,this.yForOrder=this.y,this.width=20,this.height=300,this.angle=0;this.lines=[];for(var n=0;n<5;n++)this.lines.push(new r(this.x+(Math.random()*this.width-.5*this.width),this.y,e,s));this.gradient=e.context.createLinearGradient(0,e.canvasHeight-(this.height+(e.canvasHeight-this.y)),0,this.y),this.gradient.addColorStop(0,"rgba("+e.colors[s]+", 0)"),this.gradient.addColorStop(.5,"rgba("+e.colors[s]+", 0.5)"),this.gradient.addColorStop(.75,"rgba("+e.colors[s]+", 0.5)"),this.gradient.addColorStop(1,"rgba("+e.colors[s]+", 1)"),this.cm=e}return t.prototype.draw=function(){this.cm.context.fillStyle=this.gradient,this.cm.context.save(),this.cm.context.filter="blur(20px)",this.cm.context.beginPath(),this.cm.context.ellipse(this.x,this.y,2*this.width+5*Math.abs(Math.sin(this.angle*Math.PI/180*30)),.5*this.width+5*Math.abs(Math.sin(this.angle*Math.PI/180*30)),0,0,2*Math.PI),this.cm.context.fill(),this.angle++,this.cm.context.filter="blur(5px)",this.cm.context.beginPath(),this.cm.context.ellipse(this.x,this.y,this.width,.25*this.width,0,0,2*Math.PI),this.cm.context.fill(),this.cm.context.fillRect(this.x-.5*this.width,this.cm.canvasHeight-(this.height+(this.cm.canvasHeight-this.y)),this.width,this.height),this.cm.context.restore();for(var t=0;t<this.lines.length;t++){this.lines[t].draw()}},t}(),o=a.c.canvas.withConfig({displayName:"land__Canvas",componentId:"sc-10icqg2-0"})(["background:url(/images/BG-city.jpg) no-repeat center / cover;"]);i.default=function(){var t={canvas:void 0,context:void 0,canvasWidth:0,canvasHeight:0,colors:["222, 35, 18","238, 150, 63","246, 228, 0","110, 210, 70","63, 145, 255","185, 22, 226"],colors2:["255, 160, 150","255, 200, 150","255, 250, 180","195, 255, 170","200, 220, 255","239, 173, 225"],charactersSrc:{somun:"/images/sprite-somun.png",ji:"/images/sprite-ji.png"},playedFrame:0,currentFrame:0};return Object(s.useEffect)((function(){t.canvas=document.querySelector("#the-canvas"),t.context=t.canvas.getContext("2d");var i=(window.devicePixelRatio,1),e={x:0,y:0},s=[],n=[],a=[],h=0,r=function(){var e,s;console.log(window.innerWidth,window.innerHeight),t.canvasWidth=window.innerWidth,t.canvasHeight=window.innerHeight,t.canvas.width=t.canvasWidth*i,t.canvas.height=t.canvasHeight*i,i>1&&t.context.scale(i,i),n.length<2&&(e=new d(t.charactersSrc.somun,"underAttack",.5*t.canvasWidth-256+64,.5*t.canvasHeight-64,t),s=new d(t.charactersSrc.ji,"attack",.5*t.canvasWidth-64,.5*t.canvasHeight-64,t),n.push(e),n.push(s),n.forEach((function(t){return a.push(t)}))),function i(){t.context.clearRect(0,0,t.canvas.width,t.canvas.height),a.forEach((function(i){if(i instanceof d&&i.draw(),i instanceof c){var e=i.y/t.canvasHeight+1;t.context.save(),t.context.translate(i.x,i.y),t.context.scale(e,e),t.context.translate(-i.x,-i.y),i.draw(),t.context.restore()}})),t.playedFrame++,t.playedFrame%20==0&&(t.playedFrame>1e10&&(t.playedFrame=0),0===t.currentFrame?t.currentFrame=1:t.currentFrame=0),requestAnimationFrame(i)}()},o=function(i){if(!(h>=t.colors.length)){e.x=i.clientX-t.canvas.getBoundingClientRect().left,e.y=i.clientY-t.canvas.getBoundingClientRect().top;var r=new c(e.x,e.y,t,h);s.push(r),a.push(r),a.sort((function(t,i){return t.yForOrder-i.yForOrder})),++h>=t.colors.length&&(n[0].updateAction("attack"),n[1].updateAction("underAttack"))}};return t.canvas.addEventListener("click",o),window.addEventListener("resize",r),window.addEventListener("load",r),r(),function(){window.removeEventListener("click",o),window.removeEventListener("resize",r),window.removeEventListener("load",r)}}),[]),n.a.createElement(o,{id:"the-canvas"})};var d=function(){function t(t,i,e,s,n){this.width=256,this.height=256,this.x=e,this.y=s,this.yForOrder=this.y+this.height-24,this.action=i,this.image=new Image,this.image.src=t,this.setAction(),this.cm=n}var i=t.prototype;return i.setAction=function(){switch(this.action){case"attack":return this.startFrame=0,void(this.endFrame=1);case"underAttack":return this.startFrame=2,void(this.endFrame=3);default:this.startFrame=0,this.endFrame=0}this.frame=this.startFrame},i.updateAction=function(t){this.action=t,this.setAction()},i.draw=function(){this.cm.playedFrame%20==0&&(0===this.cm.currentFrame?this.frame=this.endFrame:this.frame=this.startFrame),this.cm.context.drawImage(this.image,256*this.frame,0,256,256,this.x,this.y,this.width,this.height)},t}()}}]);
//# sourceMappingURL=component---src-pages-land-tsx-037f820cc9331c7dda18.js.map