From 55394efb95c922ce396dc9d93c0fb1cddcde5076 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 16 Dec 2018 00:20:56 +0300 Subject: starfield ok --- starfield/README.md | 23 +++++++++++++++++++++++ starfield/stars.html | 2 +- starfield/stars.js | 37 +++++++++++++++---------------------- 3 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 starfield/README.md diff --git a/starfield/README.md b/starfield/README.md new file mode 100644 index 0000000..931c46e --- /dev/null +++ b/starfield/README.md @@ -0,0 +1,23 @@ +# Starfield # + +3D starfield simulation. Like the good old Windows screensaver, but in JS and improved. + +To start the animation, just call this function, and (optionally) pass some options to it to configure the animation to your liking. For it to work you should have a canvas object in your document with id #stars. + +```javascript +warpLaunch({ + 'max_particles': 500, + 'speed': 50, + 'step': 2, + 'interactive': true, + 'color': true, +}); +``` + +### What does each option mean ### + +* max_particles: The amount of stars that appear onscreen at one given moment +* speed: How fast stars move towards the screen +* step: If interactive mode is on, how much the speed changes when the mouse wheel is scrolled +* interactive: If enabled, allows to control the speed of the simulation with the scroll wheel +* color: Stars are colored instead of white if enabled diff --git a/starfield/stars.html b/starfield/stars.html index 1cc9f30..9c7d0f2 100644 --- a/starfield/stars.html +++ b/starfield/stars.html @@ -40,7 +40,7 @@ html{