a complete rewrite of particleground.js
only a third file size (to be fair: without jQuery-stuff and, raf polyfill), better performance, and some additional options.
even if it has almost no impact on the performance, code like this...
var ratioX = (winW - 0) / (30 - -30);
pointerX = (tiltX - -30) * ratioX + 0;
...is bloat! What is wrong with:
pointerX = (tiltX +30) * (winW/60);
The thing that really hits performance is the drawing routine. It is possible to only call ctx.stroke() once in a frame and leave the ctx style properties totally untouched, combine positioning and drawing into a single loop, avoid clunky Particle-Objects, and the ugly switch statements,
even if there is no equal codebase anymore, you maybe want to merge some of these _ideas_ into your library:
orientationSupport && !desktop
pointerX - (winW / 2)
Thanks @indus, this looks really cool. I won't merge the pull request wholesale into Particleground due to the removal of jQuery, removal of functionality I consider important (e.g. pause and destroy methods) and renaming of the library, but I'd love to cherry pick some of your ideas, especially those which improve rendering performance.
Sure! You are welcome. If you have questions or you find bugs feel free to contact me.
But would you mind when I open up a separate repo for my version. I could add some sort of reference (e.g. "inspired by jnicol's particleground.js")
Yeah of course, go right ahead and start a new repo for Zodiac :)