Skip to content

Instantly share code, notes, and snippets.

View Jeremboo's full-sized avatar

Jérémie Boulay Jeremboo

View GitHub Profile
@Jeremboo
Jeremboo / AnimationManager.js
Created October 3, 2018 02:11
Stock and distribute animations
class AnimationManager {
constructor () {
this.animMap = new Map()
// To manage the status of the menu during the transition
// and lock clicks.
this.menuInTransition = false
}
save (animName, tweenAnim) {
@Jeremboo
Jeremboo / ImageManager.js
Created October 3, 2018 02:09
Preload and Map images
class ImageManager {
constructor () {
this.wMap = new Map() // Remplace with weakMap ???
}
/**
* Load it before if it nessessary
* @param {String} url The image to load
* @return {Promise}
*/
@Jeremboo
Jeremboo / Api.js
Last active October 1, 2018 22:02
Api.js to manage the communication between an api and the javascript project. With token.
export default class Api {
constuctor(serverUrl, sessionName = '__apiToken') {
if (typeof serverUrl === 'undefined') {
throw new Error('ERROR: the url of the server should exist');
}
this._token = '';
this.serverUrl = serverUrl;
this.sessionName = sessionName;
/**
* SurfaceAnimation animate Node elements on the X and Y axis
* @version 1.1.0
* @update 2017.12.11
* @author jeremboo http://jeremieboulay.fr
*
* @example
* const surfaceAnimation = new SurfaceAnimation(
* [
* '---------------',
@Jeremboo
Jeremboo / GLMouseMoveListener.js
Created November 21, 2017 17:20
GLMouseMoveListener to listen if the mouse is on a Mesh
/**
* @author jeremboo https://jeremieboulay.fr
*
* GLMouseMoveListener to listen if the mouse is on a Mesh
*
* Ex:
* - Init
* mouseMoveListener.camera = this.webgl.camera;
* this.mouseMoveListener.start()
* ...
/**
* @author jeremboo https://jeremieboulay.fr
*
* ScrollEngine.js to create parallax effect on your html page
* with the transform CSS property and an animationFrameRate.
*
* Usage:
* -------
*
* // HTML
@Jeremboo
Jeremboo / GPUSimulation.js
Last active June 6, 2020 15:18
GPUSimulation.js build a Simulation of RGBA float textures that hold 4 floats for each compute element (texel)
/**
* @author jeremboo https://jeremieboulay.fr
* @version 1.0.0
*
* GPUSimulation, based on :
* - GPUComputationRenderer by yomboprime : https://threejs.org/examples/js/GPUComputationRenderer.js
* - Demo for THREE.FBOHelper by thespite : https://www.clicktorelease.com/code/THREE.FBOHelper/#512
* - FBO particles article by nicoptere : http://barradeau.com/blog/?p=621
*
* The GPUSimulation build a Simulation of RGBA float textures that hold 4 floats for each compute element (texel)
@Jeremboo
Jeremboo / AnimComponent.js
Last active September 19, 2017 15:14
Class to manage animations with GreenSock
/**
* V1.0.0
* @author jeremboo https://jeremieboulay.fr
*
* REACT ANIMATED COMPONENT :
* Class to manage react components animated by GreenSock timelines.
* You can show/hide child components and their children.
*
* PARENT: Start to animate components
@Jeremboo
Jeremboo / keymap.cson
Last active November 24, 2016 09:15
Atom config
'atom-text-editor[data-grammar~="js"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
@Jeremboo
Jeremboo / mixins.styl
Last active December 18, 2017 10:46
My mixins
remify(value) {
u = unit(value);
if (u is 'px') {
return unit(value/16, 'rem');
} else {
return unit(value, u);
}
}