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 / 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()
* ...
/**
* 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 / 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;
@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 / 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) {