NodeConf July 4th Fireworks Show
The NodeConf July 4th Fireworks Show
Well, @mikeal said we can't blow shit up and light stuff on fire. Something about not burning down the entire forest, blah blah blah. So instead we're going to have a virtual fireworks show.
Special thanks to Kevin Decker for the canvas code powering the simulator.
Start by installing the module and running the simulator:
git clonecd fireworksnpm installnode example
Now connect to the server using a browser and watch the animation.
var Fireworks = ;var C = Fireworkscolor;var script =type: 'launch'colors: Cred Cyellow Corangesizes: 3 6 9type: 'overlay'offset: 23first:type: 'overlay'offset: 'end'first:type: 'burst'colors: Cred Cyellow Corangesizes: 3 4 5second:type: 'tails'colors: Cred Cyellow Corangesizes: 3 3 3second:type: 'curve'duration: 30colors: Cyellow 0 0type: 'stars'location: 'inner'size: 8colors: Cred Cyellow Corangetype: 'curve'duration: 30colors: 0 Cwhite Cwhitetype: 'stars'location: 'outter'size: 12colors: Cred Cyellow Corangetype: 'sparkle'duration: 20color: Cgray;var animation = Fireworks;
The fireworks show consists of a pre-define set of 1260 pixels split into three strands, and organized in a flower-like arrangement:
The animation uses a simple array format:
// Colors are expressed as 24 bit RGB valuesvar black = ;var white = ;// Each frame is an array of colors for each of// the pixels on the strandvar frame0 = white black black;var frame1 = black white black;var frame2 = black black white;// Each sequence is an array of frames for a single// strand in order of framesvar sequence = frame1 frame2 frame3 frame4 frame5;// The complete animation is an array with three// sequences, one for each strandvar animation = sequence sequence sequence;
An example animation compiler is included in
example/script.js. You can change it as you like (as well as the
lib/index.js file as long as
you comply with the animation array format), restart the server, and refresh your browser.
This is still a work in progress. For now, just fork this and create your own fireworks show. More information on how to share is coming!