[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.44,0:00:03.60,Default,,0000,0000,0000,,Welcome back to Emacs Rocks Dialogue: 0,0:00:03.60,0:00:10.02,Default,,0000,0000,0000,,Today we're taking a look at the glorious stuff to be done with swank-js Dialogue: 0,0:00:10.02,0:00:13.85,Default,,0000,0000,0000,,It's a REPL for JavaScript Dialogue: 0,0:00:13.85,0:00:15.75,Default,,0000,0000,0000,,I found it a little hard to install, Dialogue: 0,0:00:15.75,0:00:19.90,Default,,0000,0000,0000,,and I've added some convenient functions to set it up for myself. Dialogue: 0,0:00:19.90,0:00:24.82,Default,,0000,0000,0000,,but now I can jack into the JavaScript REPL Dialogue: 0,0:00:28.07,0:00:32.08,Default,,0000,0000,0000,,It has autocompletion, which is nice Dialogue: 0,0:00:32.08,0:00:35.25,Default,,0000,0000,0000,,But I can also run JavaScript straight from the buffer. Dialogue: 0,0:00:35.25,0:00:38.92,Default,,0000,0000,0000,,Eval is C-x C-e like in elisp Dialogue: 0,0:00:38.92,0:00:41.20,Default,,0000,0000,0000,,and the results are at the bottom Dialogue: 0,0:00:41.20,0:00:44.64,Default,,0000,0000,0000,,Let's square these numbers. Dialogue: 0,0:00:52.29,0:00:56.88,Default,,0000,0000,0000,,And I can eval-and-replace Dialogue: 0,0:00:56.88,0:00:59.03,Default,,0000,0000,0000,,That's pretty sweet Dialogue: 0,0:00:59.03,0:01:01.75,Default,,0000,0000,0000,,Okay, now for the awesome part ... Dialogue: 0,0:01:01.75,0:01:07.10,Default,,0000,0000,0000,,I made a little bouncy ball in Canvas Dialogue: 0,0:01:07.10,0:01:09.16,Default,,0000,0000,0000,,I am now connecting to it, Dialogue: 0,0:01:09.16,0:01:14.92,Default,,0000,0000,0000,,and I can do stuff with the browser from the REPL Dialogue: 0,0:01:25.14,0:01:26.84,Default,,0000,0000,0000,,But check it out - Dialogue: 0,0:01:26.84,0:01:30.04,Default,,0000,0000,0000,,I can write code straight in my editor too Dialogue: 0,0:01:30.04,0:01:35.55,Default,,0000,0000,0000,,Like setting the vertical and horizontal speed of the ball. Dialogue: 0,0:01:43.70,0:01:48.24,Default,,0000,0000,0000,,Both at the same time, please ... yeah! Dialogue: 0,0:01:52.70,0:01:55.41,Default,,0000,0000,0000,,Or I can change the elasticity of the ball, Dialogue: 0,0:01:55.41,0:02:00.57,Default,,0000,0000,0000,,to the point where it's gaining speed as it's bouncing. Dialogue: 0,0:02:03.46,0:02:07.30,Default,,0000,0000,0000,,whoa! - come back here! Dialogue: 0,0:02:28.24,0:02:30.38,Default,,0000,0000,0000,,Okay, let's check out the CSS Dialogue: 0,0:02:30.38,0:02:34.37,Default,,0000,0000,0000,,what about a nice red background? Dialogue: 0,0:02:36.40,0:02:38.15,Default,,0000,0000,0000,,nah .. Dialogue: 0,0:02:38.15,0:02:41.59,Default,,0000,0000,0000,,some stars then Dialogue: 0,0:02:43.75,0:02:47.25,Default,,0000,0000,0000,,yeah! cool Dialogue: 0,0:02:53.51,0:02:55.30,Default,,0000,0000,0000,,Now, time for some fun ... Dialogue: 0,0:02:55.30,0:02:58.86,Default,,0000,0000,0000,,Change the opacity, I'll make a new ball every time, Dialogue: 0,0:02:58.86,0:03:02.47,Default,,0000,0000,0000,,and then loop the anim 200 times. Dialogue: 0,0:03:24.03,0:03:26.72,Default,,0000,0000,0000,,See? There's the bouncy pattern. Dialogue: 0,0:03:26.72,0:03:31.77,Default,,0000,0000,0000,,Now we can change the entry speed ... Dialogue: 0,0:03:37.49,0:03:40.60,Default,,0000,0000,0000,,or the bounciness ... Dialogue: 0,0:03:40.60,0:03:43.70,Default,,0000,0000,0000,,This should dampen it quickly. Dialogue: 0,0:03:43.70,0:03:46.58,Default,,0000,0000,0000,,And this should make for some serious bouncing. Dialogue: 0,0:03:49.38,0:03:53.71,Default,,0000,0000,0000,,I can even change the gravity. Dialogue: 0,0:04:02.79,0:04:06.66,Default,,0000,0000,0000,,Okay, back to real animation Dialogue: 0,0:04:13.90,0:04:18.17,Default,,0000,0000,0000,,See, there's the pattern we just made Dialogue: 0,0:04:18.73,0:04:21.73,Default,,0000,0000,0000,,That's it for Emacs Rocks this time around Dialogue: 0,0:04:21.73,0:04:24.73,Default,,0000,0000,0000,,Swank-js is some pretty awesome stuff Dialogue: 0,0:04:24.73,0:04:29.06,Default,,0000,0000,0000,,If you can get it up and running that is Dialogue: 0,0:04:30.23,0:04:34.32,Default,,0000,0000,0000,,Till next time!