Welcome back to Emacs Rocks
Today we're taking a look at the glorious stuff to be done with swank-js
It's a REPL for JavaScript
I found it a little hard to install,
and I've added some convenient functions to set it up for myself.
but now I can jack into the JavaScript REPL
It has autocompletion, which is nice
But I can also run JavaScript straight from the buffer.
Eval is C-x C-e like in elisp
and the results are at the bottom
Let's square these numbers.
And I can eval-and-replace
That's pretty sweet
Okay, now for the awesome part ...
I made a little bouncy ball in Canvas
I am now connecting to it,
and I can do stuff with the browser from the REPL
But check it out -
I can write code straight in my editor too
Like setting the vertical and horizontal speed of the ball.
Both at the same time, please ... yeah!
Or I can change the elasticity of the ball,
to the point where it's gaining speed as it's bouncing.
whoa! - come back here!
Okay, let's check out the CSS
what about a nice red background?
nah ..
some stars then
yeah! cool
Now, time for some fun ...
Change the opacity, I'll make a new ball every time,
and then loop the anim 200 times.
See? There's the bouncy pattern.
Now we can change the entry speed ...
or the bounciness ...
This should dampen it quickly.
And this should make for some serious bouncing.
I can even change the gravity.
Okay, back to real animation
See, there's the pattern we just made
That's it for Emacs Rocks this time around
Swank-js is some pretty awesome stuff
If you can get it up and running that is
Till next time!