Author Archives: Zevan

Closest Point on a Line

For some reason I decided to port a snippet from AS3 to JS. Chose this one:
http://actionsnippet.com/?p=2969#comment-5674
…pretty much at random.
Here is the port in a pen:
See the Pen Closet Point on a Line by Zevan Rosser (@ZevanRosser) on CodePen.

This is actually a port of a port from this old thread:
http://www.gamedev.net/topic/444154-closest-point-on-a-line/

Posted in Uncategorized | Leave a comment

SVG to Canvas (good trick)

Awhile back, I wrote some collision detection code that blitted existing interactive SVG to Canvas and then used the pixel data to figure out various aspects of the relationships between arbitrary SVG nodeTypes. A really simple trick I used can be seen in this pen:
See the Pen pJZdav by Zevan Rosser (@ZevanRosser) on CodePen.

The trick [...]

Posted in Graphics, html5, javascript, misc, pixel manipulation, svg | Tagged , , , , , , | Leave a comment

Input Field with LocalStorage Predictions

This is a quick example showing how to give an input field “memory”. After you type something once and hit return it will be stored in `localStorage`. String values are ranked based on how often they are selected/entered. I know people don’t like jQuery these days, seems this pen is from a time when I [...]

Posted in html5, javascript | Tagged , , | Leave a comment

Quick line in HTML and JavaScript

Usually if you want to draw lines in HTML you use canvas or SVG. Awhile back I wondered how I might do it without those. This is really just a proof of concept speed coded answer to that question:
See the Pen Quick Line by Zevan Rosser (@ZevanRosser) on CodePen.

This works by using a div with [...]

Posted in Graphics, Math, html5, javascript, misc, motion | Tagged , , | Leave a comment