Giter Site home page Giter Site logo

supernova's Introduction

The supernova

This snippetry is part of Flanimals, a flag- and animal-finding game. But for me the supernova has been a little project in its own right. It's the final act of Flanimals, so after you've collected your 178 flags and 111 animals - listening to a lot of bings and grunts - you can sit back and watch the world explode. Few things more relaxing out there really...

one tiny technical thingy (for what it's worth)

The supernova is built entirely in Javascript and friends with a lof of D3.js-lifting. The shreds are SVG-circles connected by a highly erratic force-layout changing its gravity and friction to Also sprach Zarathustra. Some of the colour-effects are kindly facilitated by the splendid HSL-colour-space, which is a pure pleasure to work with when your aim is to programmatically change colour:

d3.selectAll('circle.shreds')
	.transition()
	.duration(dur)
	.delay(function(d,i) { return i / n * dur ; })
	.each('end', function(){
		d3.select(this)
			.style('fill', 'hsl(' + Math.floor(Math.random()*360) + ', 100%, 50%)')
			.attr('r', 3);
	});

As this is JavaScript trying to be After Effects and in fact reeling off a short film, there are a lot of setTimeout's and setInterval's involved to time the state, the layouts and the twitches to the music. Tweaking necessary but it sort of works. If music and visual is out of sync, you should reload the whole thing for the browser to cache the music...

--

flanimals_supernova_explosion

--

For the full Flanimals joy come over here

supernova's People

Contributors

larsvers avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.