Add a way to pause the background animation #220

I currently set href to "" because I don't currently know how to interface with session variables directly through html tags. "Basic View" and "Standard View" have different lengths, so the footer shifts when the button is pressed. The paused background state is different from the paused state when the user once again switches to the tab after a period of time, where the triangles are all orange and regular. The session variable can also be renamed and used elsewhere to perhaps make the page less reactive, for example in displaying search results, to reduce lag.
Because now, to me it seems both render (in Background) and draw (in Background) call draw (in Background). I still don’t see why there seems to be redundancy here, nor how time is passed into draw (in Background), unless that is done by default, reactively. Original version below:


  render: =>
    @resizeView()
    @generateTriangles()

    frame @draw

    @renderer.view


draw: (time) =>
    return unless @renderer

    vector.update (time) for key, vector of @vectors
    triangle.draw() for key, triangle of @triangles
    @renderer.render @stage

    frame @draw


Sorry this is taking so long

On Jul 1, 2014, at 7:25 PM, Mitar <notifications@github.com> wrote:

> In client/lib/background.coffee:
> 
> > @@ -34,6 +34,7 @@ class Vector
> >      @deltaY = 0
> >  
> >    update: (time) =>
> > +    return if Session.get 'backgroundPaused'
> There is a difference between @renderer.render and Background.render. Don't confuse that. Background.render is called first time here and it bootstraps the loop.
> 
> —
> Reply to this email directly or view it on GitHub.
>