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.
Or I shouldn’t modify pixi.js because it’s licensed from MIT? If I have the background resume animation at the same time I may have to add another time variable to pass into frame.

On Jul 1, 2014, at 8:57 PM, Tiantong Qin <tiantongqin@gmail.com> wrote:

> I think what is being appended is a nonreactive execution of background.render on all landing page(s), so if @_background.render() is appended again, the page may have to be reloaded or something. So far my understanding is that window.requestAnimFrame returned by the frame function takes care of calling draw function, and I can alter the time of the animation within frame function.
> 
> On Jul 1, 2014, at 8:37 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'
>> Because now, to me it seems both render (in Background) and draw (in Background) call draw (in Background).
>> 
>> No, they call frame and pass @draw as an argument.
>> 
>> I still don’t see why there seems to be redundancy here
>> 
>> One bootstraps the loop, the other continues the loop.
>> 
>> nor how time is passed into draw
>> 
>> You should check what frame does.
>> 
>> And to confirm I should call Background.render again when the background is resumed
>> 
>> Not necessary. That would restart whole image and you would have a jump in positions of triangles.
>> 
>> Does it have to be removed
>> 
>> What exactly do you think "it" is here? What is appended?
>> 
>> —
>> Reply to this email directly or view it on GitHub.
>> 
>