Son CV dans un terminal web en Javascript! https://terminal-cv.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
9.4 KiB

/*!
* fireworks-js 1.3.5 by Vitalij Ryndin (https://crashmax.ru)
* https://fireworks.js.org
* License MIT
*/
!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var s=i();for(var e in s)("object"==typeof exports?exports:t)[e]=s[e]}}(this,(function(){return(()=>{"use strict";var t={511:(t,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Explosion=void 0;var e=s(909);i.Explosion=class{constructor(t){var{x:i,y:s,ctx:h,hue:n,exp:o,gravity:a,friction:r,brightness:c,explosionLength:_}=t;for(this._coordinates=[],this._alpha=1,this._x=i,this._y=s,this._exp=o,this._ctx=h,this._gravity=a,this._friction=r,this._explosionLength=_;this._explosionLength--;)this._coordinates.push([i,s]);this._angle=(0,e.randomFloat)(0,2*Math.PI),this._speed=(0,e.randomInt)(1,10),this._hue=(0,e.randomInt)(n-20,n+20),this._brightness=(0,e.randomInt)(c.min,c.max),this._decay=(0,e.randomFloat)(c.decay.min,c.decay.max)}update(t){this._coordinates.pop(),this._coordinates.unshift([this._x,this._y]),this._speed*=this._friction,this._x+=Math.cos(this._angle)*this._speed,this._y+=Math.sin(this._angle)*this._speed+this._gravity,this._alpha-=this._decay,this._alpha<=this._decay&&t()}draw(){var t=this._coordinates.length-1;this._ctx.beginPath(),this._exp&&(this._ctx.arc(this._x,this._y,(0,e.randomFloat)(.5,1.5),0,2*Math.PI),this._ctx.fill()),this._ctx.fillStyle=(0,e.hsla)(this._hue,this._brightness,this._alpha),this._ctx.moveTo(this._coordinates[t][0],this._coordinates[t][1]),this._ctx.lineTo(this._x,this._y),this._ctx.strokeStyle=(0,e.hsla)(this._hue,this._brightness,this._alpha),this._ctx.stroke()}}},909:(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.hsla=i.getDistance=i.randomInt=i.randomFloat=void 0,i.randomFloat=function(t,i){return Math.random()*(i-t)+t},i.randomInt=function(t,i){return Math.floor(t+Math.random()*(i+1-t))},i.getDistance=function(t,i,s,e){var h=Math.pow;return Math.sqrt(h(t-s,2)+h(i-e,2))},i.hsla=function(t,i){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return"hsla(".concat(t,", 100%, ").concat(i,"%, ").concat(s,")")}},449:function(t,i,s){var e=this&&this.__awaiter||function(t,i,s,e){return new(s||(s=Promise))((function(h,n){function o(t){try{r(e.next(t))}catch(t){n(t)}}function a(t){try{r(e.throw(t))}catch(t){n(t)}}function r(t){var i;t.done?h(t.value):(i=t.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}r((e=e.apply(t,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:!0}),i.Sound=void 0;var h=s(909);i.Sound=class{constructor(t){this._buffer=[],this.onInit=!0,this._audioContext=new(window.AudioContext||window.webkitAudioContext),this.options=Object.assign({enabled:!1,files:["explosion0.mp3","explosion1.mp3","explosion2.mp3"],volume:{min:4,max:8}},t),this.init()}init(){this.onInit&&this.options.enabled&&(this.onInit=!1,this.load())}load(){return e(this,void 0,void 0,(function*(){for(var t of this.options.files){var i=yield(yield fetch(t)).arrayBuffer();this._audioContext.decodeAudioData(i).then((t=>{this._buffer.push(t)})).catch((t=>{throw t}))}}))}play(){if(this.options.enabled&&this._buffer.length){var t=this._audioContext.createBufferSource(),i=this._buffer[(0,h.randomInt)(0,this._buffer.length-1)],s=this._audioContext.createGain();t.buffer=i,s.gain.value=(0,h.randomFloat)(this.options.volume.min/100,this.options.volume.max/100),s.connect(this._audioContext.destination),t.connect(s),t.start(0)}else this.init()}}},668:(t,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Trace=void 0;var e=s(909);i.Trace=class{constructor(t){var{x:i,y:s,dx:h,dy:n,ctx:o,hue:a,speed:r,traceLength:c,acceleration:_}=t;for(this._coordinates=[],this._currentDistance=0,this._x=i,this._y=s,this._sx=i,this._sy=s,this._dx=h,this._dy=n,this._ctx=o,this._hue=a,this._speed=r,this._traceLength=c,this._acceleration=_,this._totalDistance=(0,e.getDistance)(i,s,h,n);this._traceLength--;)this._coordinates.push([i,s]);this._angle=Math.atan2(n-s,h-i),this._brightness=(0,e.randomInt)(50,70)}update(t){this._coordinates.pop(),this._coordinates.unshift([this._x,this._y]),this._speed*=this._acceleration;var i=Math.cos(t