Visit the site at suluke.github.io/hfg-particles
If you want to dive into the code and make changes, we recommend you do the following to get started:
- Clone this repo (obviously)
- Run
git submodule update --init
. This will populate thestatic
subdirectory, which also includes some binary assets which we don't want to have in themaster
branch as of now. - You must have
nodejs
andnpm
installed - From inside this repo's directory, run
npm install
- Now start the development server by running
npm start
Alternatively, there is also thenpm run start:dev
script, which will try to restart the server when you make deeper changes to the overall project setup (this mainly affectsserver.js
and stuff insidenode_modules
). - Et voilá: If you navigate your webserver to
localhost:3000
, you should see the same webpage as on the project website
After you have successfully set up the development environment on your local machine and navigated to localhost:3000
, the development server will have processed all source files and written the results to the static/
subdirectory.
The contents of this directory can be served statically by any file server of you choice.
Because of this, we (the project maintainers) have the
gh-pages
branch checked out inside thestatic/
directory. So whenever we want to update the live-site, we justcd static/ && git commit -am "Update gh-pages build" && git push
- That's all for deployment :)
package.json
: Some handy scripts live in this directory, like e.g.npm run lint
ornpm run format
server.js
: Our development server is at the same time serving as our build system. This may sound weird to you, but we find this works quite well in practice and keeps the complexity low. We don't have live-reload, but hitting f5 when you need it shouldn't be all that complicated. In return, you will avoid having tens of file watchers as well as having to recompile the whole project on every file save.index.html
: The main entry point to the webapp.js/
directory: Application code. The entry ismain.bundle
(as can be seen from the.bundle
suffix). We use es6 (transpiled by bublé), including moduleimport
syntax (statically bundled by rollup)sass/
directory: Styles, written in SCSS language and compiled by our server using node-sass
For the creation of a new effect, the following steps are required:
- Create a new file where the effect will live in the future in
js/effects
, e.g.js/effects/my-effect.js
- Add your effect to the effects list, which is found in
js/effects/index.js
- Write the necessary code. This usually involves the following steps:
- Create a class extending
Effect
(js/effects/effect.js
) where you override the unimplemented methods with your own - Create a class extending
ConfigUI
(also ineffect.js
) to describe the ui a user will see to change certain effect parameters
- Create a class extending
See commit cdefd5c for a fairly complete example of this.
See LICENSE file for legal information.