Return to Video

Emacs Rocks! Episode 11: swank-js

  • 0:00 - 0:04
    Welcome back to Emacs Rocks
  • 0:04 - 0:10
    Today we're taking a look at the glorious stuff to be done with swank-js
  • 0:10 - 0:14
    It's a REPL for JavaScript
  • 0:14 - 0:16
    I found it a little hard to install,
  • 0:16 - 0:20
    and I've added some convenient functions to set it up for myself.
  • 0:20 - 0:25
    but now I can jack into the JavaScript REPL
  • 0:28 - 0:32
    It has autocompletion, which is nice
  • 0:32 - 0:35
    But I can also run JavaScript straight from the buffer.
  • 0:35 - 0:39
    Eval is C-x C-e like in elisp
  • 0:39 - 0:41
    and the results are at the bottom
  • 0:41 - 0:45
    Let's square these numbers.
  • 0:52 - 0:57
    And I can eval-and-replace
  • 0:57 - 0:59
    That's pretty sweet
  • 0:59 - 1:02
    Okay, now for the awesome part ...
  • 1:02 - 1:07
    I made a little bouncy ball in Canvas
  • 1:07 - 1:09
    I am now connecting to it,
  • 1:09 - 1:15
    and I can do stuff with the browser from the REPL
  • 1:25 - 1:27
    But check it out -
  • 1:27 - 1:30
    I can write code straight in my editor too
  • 1:30 - 1:36
    Like setting the vertical and horizontal speed of the ball.
  • 1:44 - 1:48
    Both at the same time, please ... yeah!
  • 1:53 - 1:55
    Or I can change the elasticity of the ball,
  • 1:55 - 2:01
    to the point where it's gaining speed as it's bouncing.
  • 2:03 - 2:07
    whoa! - come back here!
  • 2:28 - 2:30
    Okay, let's check out the CSS
  • 2:30 - 2:34
    what about a nice red background?
  • 2:36 - 2:38
    nah ..
  • 2:38 - 2:42
    some stars then
  • 2:44 - 2:47
    yeah! cool
  • 2:54 - 2:55
    Now, time for some fun ...
  • 2:55 - 2:59
    Change the opacity, I'll make a new ball every time,
  • 2:59 - 3:02
    and then loop the anim 200 times.
  • 3:24 - 3:27
    See? There's the bouncy pattern.
  • 3:27 - 3:32
    Now we can change the entry speed ...
  • 3:37 - 3:41
    or the bounciness ...
  • 3:41 - 3:44
    This should dampen it quickly.
  • 3:44 - 3:47
    And this should make for some serious bouncing.
  • 3:49 - 3:54
    I can even change the gravity.
  • 4:03 - 4:07
    Okay, back to real animation
  • 4:14 - 4:18
    See, there's the pattern we just made
  • 4:19 - 4:22
    That's it for Emacs Rocks this time around
  • 4:22 - 4:25
    Swank-js is some pretty awesome stuff
  • 4:25 - 4:29
    If you can get it up and running that is
  • 4:30 - 4:34
    Till next time!
Title:
Emacs Rocks! Episode 11: swank-js
Description:

http://emacsrocks.com - Rocking emacs tricks and tips screencast.

Follow me on twitter: @emacsrocks

more » « less
Video Language:
English
Duration:
04:35
magnarsveen added a translation

English subtitles

Revisions