"),this.context=this.$canvas.appendTo(this.$container).get(0).getContext("2d"),this.points=[],this.fishes=[],this.watchIds=[]},createSurfacePoints:function(){var t=Math.round(this.width/this.POINT_INTERVAL);this.pointInterval=this.width/(t-1),this.points.push(new SURFACE_POINT(this,0));for(var i=1;ithis.height/2+this.THRESHOLD||(t=Math.round(t/this.pointInterval))<0||t>=this.points.length||this.points[t].interfere(i,e)},reverseVertical:function(){this.reverse=!this.reverse;for(var t=0,i=this.fishes.length;tthis.renderer.height*this.renderer.INIT_HEIGHT_RATE?(this.vy-=this.GRAVITY,this.isOut=!0):(this.isOut&&(this.ay=this.getRandomValue(.05,.2)),this.isOut=!1):this.ythis.renderer.width+this.renderer.THRESHOLD||this.vx<0&&this.x<-this.renderer.THRESHOLD)&&this.init()},render:function(t){t.save(),t.translate(this.x,this.y),t.rotate(Math.PI+Math.atan2(this.vy,this.vx)),t.scale(1,this.direction?1:-1),t.beginPath(),t.moveTo(-30,0),t.bezierCurveTo(-20,15,15,10,40,0),t.bezierCurveTo(15,-10,-20,-15,-30,0),t.fill(),t.save(),t.translate(40,0),t.scale(.9+.2*Math.sin(this.theta),1),t.beginPath(),t.moveTo(0,0),t.quadraticCurveTo(5,10,20,8),t.quadraticCurveTo(12,5,10,0),t.quadraticCurveTo(12,-5,20,-8),t.quadraticCurveTo(5,-10,0,0),t.fill(),t.restore(),t.save(),t.translate(-3,0),t.rotate((Math.PI/3+Math.PI/10*Math.sin(this.phi))*(this.renderer.reverse?-1:1)),t.beginPath(),this.renderer.reverse?(t.moveTo(5,0),t.bezierCurveTo(10,10,10,30,0,40),t.bezierCurveTo(-12,25,-8,10,0,0)):(t.moveTo(-5,0),t.bezierCurveTo(-10,-10,-10,-30,0,-40),t.bezierCurveTo(12,-25,8,-10,0,0)),t.closePath(),t.fill(),t.restore(),t.restore(),this.controlStatus(t)}},$(function(){RENDERER.init(),$(".dark").click(function(){setTimeout(()=>{RENDERER.setFishColor(),RENDERER.context.fill()})})})