____ _ __ __ __
/ __ )____ (_) /__ _________ / /___ _/ /____
/ __ / __ \/ / / _ \/ ___/ __ \/ / __ `/ __/ _ \
/ /_/ / /_/ / / / __/ / / /_/ / / /_/ / /_/ __/
/_____/\____/_/_/\___/_/ / .___/_/\__,_/\__/\___/
/_/
- Webpack 3
- Babel
- ES6 ready
- Autoprefixer
- Stylus
- Targetable browser
- Easy configurable devServer
- Network sharing
- Hot reload
- WebGL shaders import
npm
Webpack 3
Node version recommended :
Node : v7.4.0
npm : 4.0.5
Dev are in the /src
repository
The /build
folder can be entirely rebuild from the src folder, so DO NOT place any needed assets in the build folder ! ONLY in the /src
directory, they will be copied in the build during export.
Installation of Webpack : npm i -g webpack webpack-dev-server
##To start :
- Clone the project &
cd path/to/the/clonned/repository
- Run
npm install
- Run
npm start
- Go to
localhost:3000
on your browser.
All the avaliable options are stored in the settings.config.js
in the root of your project
browsersTarget: ["last 2 versions"], // Target browser for autocomplete and Babel config, full list here : https://github.com/ai/browserslist
port: 3000, // the listening port of your devServer
https: false, // Need https ?
sourceMap: true, // SourceMap options for styles
shared: true, // Visible on your local network ?
inline: true, // inline ou iframe reloading
proxy: { // setup proxy paths
'/api': {
target: 'https://other-server.example.com',
secure: false
}
}
Stylus will find automaticly all your .styl
files, just re-run the server !
( all files starting with _yourFile.styl
will be ignored )
Run npm run build
Some mathematics easing equations
Only considering the t value for the range [0, 1]
No easing, no acceleration
Math.linear = function (t) { return t }
Accelerating from zero velocity
Math.easeInQuad = function (t) { return t*t }
Decelerating from zero velocity
Math.easeOutQuad = function (t) { return t*(2-t) }
Acceleration until halfway, then deceleration
Math.easeInOutQuad = function (t) { return t<.5 ? 2*t*t : -1+(4-2*t)*t }
Accelerating from zero velocity
Math.easeInCubic = function (t) { return t*t*t }
Decelerating to zero velocity
Math.easeOutCubic = function (t) { return (--t)*t*t+1 }
Acceleration until halfway, then deceleration
Math.easeInOutCubic = function (t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
Accelerating from zero velocity
Math.easeInQuart = function (t) { return t*t*t*t }
Decelerating to zero velocity
Math.easeOutQuart = function (t) { return 1-(--t)*t*t*t }
Acceleration until halfway, then deceleration
Math.easeInOutQuart = function (t) { return t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t }
Accelerating from zero velocity
Math.easeInQuint = function (t) { return t*t*t*t }
Decelerating to zero velocity
Math.easeOutQuint = function (t) { return 1-(--t)*t*t*t }
Acceleration until halfway, then deceleration
Math.easeInOutQuint = function (t) { return t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t }
There is a global object for storing data and recovering it anywhere.
Simply use :
STORAGE.my_var = "foo";
and after :
let my_var = STORAGE.my_var;
There is a FPS light weight homemade visualizer very simple to use.
import * as tools from './lib/tools.class.js'
var frameRateUI = new tools.FrameRateUI
and in your requestAnimationFrame()
call :
frameRateUI.update()
The AudioAnalyzer is here to help you to build some cools animations from a sound. You will be able to create some controls points based on a frequecy for animated your elements
import * as tools from './lib/tools.class.js'
var audioAnalyzer = new tools.AudioAnalyzer({
url: url,
samplingFrequency: 256,
playerUI: true,
autoplay: true,
debug: true,
})
audioAnalyzer.addControlPoint({
bufferPosition : //your frequency number between 0 and the buffer size
})
The AudioAnalyzer has some helpful methods :
audioAnalyzer.hide()
audioAnalyzer.show()
audioAnalyzer.play()
audioAnalyzer.update()
All the controls are stored in the array :
audioAnalyzer.controls
Each control as a method for changing is frequency :
audioAnalyzer.controls[index].shift( //your new frequency number between 0 and the buffer size )
And don't forget in your requestAnimationFrame()
to call :
audioAnalyzer.update()