playing time

07 Jan 2018

Playing with animation

These past few days I’ve been ill again but I kept on coding! And I finished the lesson on javascript syntax. Yesterday was reviewing time, and today it was more recreational.

I’ve started studying ProcessingJS which a javascript library specialised in drawing and animating. I learned about this library because I’ve started taking math classes on Khan Academy!!! :D And they have computer science classes, the first one of which being a javascript-based introduction to programming. The commands seemed a little bit odd, so I researched what it was exactly.

Actually, it uses ProcessingJs, so I researched it and started to follow the ProcessingJS tutorial to start my first animation ever on codepen. (It’s very basic for now, just a square and an ellipse guided by the mouse, each having a different speed)

The tutorial is here:

I’m tweaking it on codepen to understand what each part does.

I had to reasearch something I’ve never used before:

How do you get the viewport dimension with javascript?

Answer is here

Remember:

var yourWidth = window.innerWidth;
var yourHeight = window.innerHeight;

(OF COURSE, there are exception to this depending on the browser, but the page I’ve referenced cover this. However, the code shown above will work in most cases.)

Miscellaneous

Also, I came accros CDNJS which is a catalog of libraries.

A library I want to try soon: typed.js (or : this site)