this._traces.length)&&(this._traces.push(new t.Trace({x:this._width*(this._randomRocketsPoint?a.randomInt(0,100):this.rocketsPoint)/100,y:this._height,dx:this._mx&&this.mouse.move||this._m?this._mx:a.randomInt(this.boundaries.x,this.boundaries.width-2*this.boundaries.x),dy:this._my&&this.mouse.move||this._m?this._my:a.randomInt(this.boundaries.y,.5*this.boundaries.height),ctx:this._ctx,hue:a.randomInt(this.hue.min,this.hue.max),speed:this.speed,acceleration:this.acceleration,traceLength:this.trace})),this._tick=0)}drawTrace(){for(var e=this._traces.length;e--;)this._traces[e].draw(),this._traces[e].update(((t,i,n)=>{this.initExplosion(t,i,n),this._sound.play(),this._traces.splice(e,1)}))}initExplosion(e,t,i){for(var n=this.particles;n--;)this._explosions.push(new o.Explosion({x:e,y:t,ctx:this._ctx,hue:i,friction:this.friction,gravity:this.gravity,explosionLength:this.explosion,brightness:this.brightness,exp:this._experimentals}))}drawExplosion(){for(var e=this._explosions.length;e--;)this._explosions[e].draw(),this._explosions[e].update((()=>{this._explosions.splice(e,1)}))}}})(),n})()}));var a=[];e(t).forEach((function(e){a.push(e.command)}));var r=["clear","dark","light","get cv"];a=a.concat(r);var c=["pif","rm -rf /"];window.innerWidth>1024&&function(e){var t=0,i=0,n=0,s=0,o=document.querySelector(".terminal__header");function a(e){(e=e||window.event).preventDefault(),n=e.clientX,s=e.clientY,document.onmouseup=c,document.onmousemove=r}function r(o){(o=o||window.event).preventDefault(),t=n-o.clientX,i=s-o.clientY,n=o.clientX,s=o.clientY,e.style.top=e.offsetTop-i+"px",e.style.left=e.offsetLeft-t+"px"}function c(){document.onmouseup=null,document.onmousemove=null}o?o.onmousedown=a:e.onmousedown=a}(document.querySelector(".terminal"));var h=[],d=!1,l=-1,u=document.querySelector(".terminal__body");if(v(),11===(new Date).getMonth()){for(var m="",f=0;f<6;f++)m+='❅
❆
';var p=''.concat(m,"
");document.body.append(function(e){return document.createRange().createContextualFragment(e)}(p))}function v(e){var t=void 0===e?null:e,i=Math.random().toString(36).replace("0.",""),n=document.createElement("div");n.classList.add("terminal__line");var s=document.createElement("div");s.classList.add("terminal__response"),s.id="response-".concat(i);var o=document.createElement("input");if(o.type="text",o.id="input-".concat(i),o.autocapitalize="off",o.dataset.uid=i,o.dataset.active="1",o.addEventListener("keydown",_),n.appendChild(o),t){var a=document.getElementById(t);a&&(a.setAttribute("disabled","true"),a.removeEventListener("keydown",_),delete a.dataset.active)}document.getElementById("terminal").appendChild(n),document.getElementById("terminal").appendChild(s),o.focus()}function _(i){var m=i.target.value.trim().toLowerCase();if(13===i.keyCode){if(""!==m){d=!1;var f,p="response-".concat(i.target.dataset.uid),_=document.getElementById(p);f=c.includes(m)||r.includes(m)?function(e){switch(e){case"pif":return function(){var e={origin:{y:.7}};function t(t,i){n(Object.assign({},e,i,{particleCount:Math.floor(200*t)}))}t(.25,{spread:26,startVelocity:55}),t(.2,{spread:60}),t(.35,{spread:100,decay:.91,scalar:.8}),t(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),t(.1,{spread:120,startVelocity:45})}(),"Let's go !";case"light":return document.body.classList.contains("dark-mode")?(o(!1),"Your are now in light mode."):"You are already in light mode.";case"dark":return document.body.classList.contains("dark-mode")?"You are already in dark mode.":(o(!0),"You are now in dark mode.");case"get cv":return(t=document.createElement("a")).href="resources/resume.pdf",t.setAttribute("download","CV - Gregory Lebreton.pdf"),t.click(),"The CV will be downloaded.";case"rm -rf /":return o(!0),document.body.classList.add("firework"),new s.Fireworks(document.body,{mouse:{click:!0,move:!1,max:7}}).start(),"🎆";case"clear":return void(u.innerHTML='')}var t}(m):function(i){var n=e(t).find((function(e){return e.command===i})),s="";if(void 0===n)s="'".concat(i.split(" ")[0],"' is not recognized as an internal command or external command, operable program or batch file. Type the help
command to display a list of available commands.");else if("list"===n.responseType&&Array.isArray(n.value))s="",s+=n.value.map((function(e){return"- ".concat(e,"
")})).join(""),s+="
";else if("text"===n.responseType)s=n.value;else if("table"===n.responseType){var o=n.headers,a=n.rows,r=o.map((function(e){return"".concat(e," | ")})).join(""),c=a.map((function(e){return"".concat(e.map((function(e){return"".concat(e," | ")})).join(""),"
")})).join("");s="".concat(r,"
").concat(c,"
")}else"code"===n.responseType&&(s="".concat(n.value.join("\n"),"
"));return s}(m),_&&(_.innerHTML=f,h.push(m),v(i.target.id))}}else if(9===i.keyCode){if(i.preventDefault(),""===m)this.value="help";else{var g=a.find((function(e){return e.startsWith(m)}));g&&(this.value=g)}d=!1}else 38!==i.keyCode&&40!==i.keyCode||(h.length>0&&(!1===d?l=h.length-1:38===i.keyCode&&0!==l?l--:40===i.keyCode&&l!==h.length-1&&l++,this.value=h[l]),d=!0)}window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&o(!0),document.body.addEventListener("click",(function(e){"INPUT"!==e.target.tagName&&document.querySelector("input[data-active]").focus()})),document.querySelector(".fake-close").addEventListener("click",(function(e){var t=document.querySelector(".terminal");t.parentElement.removeChild(t)}))}();
//# sourceMappingURL=index.5c78f897.js.map