vim: all you need to…reference

Choosing to go into Vim is a complicated thought process. From the terminal, you’ll need these two commands:

 vimtutor //pretend you are going to learn to use Vim
 vim //with optional filename to to open

___

Once you’re in Vim, most likely because $>git commit put/trapped you there without you wanting to go. Use these:

  i   //enter insert mode, now write code
  esc //exit insert mode
  :wq //writefile and quit

js: div actions

divAction.js

I made a simple demo framework for animating divs using composite actions for position, scale, and rotation. I was tired of manipulating css for demoing things. I just wanted to instantiate a class, and then call methods on it to animate, much like you would in cocos2d or SpriteKit.

It’s actually a pretty performant little streamlined package. It updates all actions per frame using requestAnimationFrame. It was meant for demoing and presentations, but it could do more.

demo.js contains the examples for how to:

–instance a Thing, which is just a class wrapped around a div.
–add actions to a Thing to move it, rotate it and scale it.
–the top portion has demo flags to force fixed intervals, and lower performance, all just for the purpose of discussion.
–Note: actions are composite, which means if you add 2 movement actions to a Thing, then the thing will be updating each frame based on both actions.

Since everything is just a div, you could add CSS classes and files, use standard button and click and link commands, etc.

For demo purposes the code in the Thing/actions is not very dry, if you were going to really use this to do anything, you’d want to make an action class and create instances of Actions and add them to Things. That way you could also easily pause or remove an individual action ahead of schedule.

Oh, and obviously all the objects have just simple names stored in global, so please wrap them up in something first.

https://github.com/CHBDev/divActions