javascript

AS3 / JS Constrain a value in one line

Here is a little snippet to constrain a value in a single line. It works by using two nested inline conditionals. The ‘else’ part of the first conditional is another conditional. It may not be the best approach but it works and is much easier and faster to write than two if-else statements. In English […]

November 29, 2012

JS Transform Handles

The other day I was playing around with Mozilla’s Popcorn Maker and I had the idea of using HTML/JS/CSS to create transformable divs using transform handles and a bounding box. I did a quick search for any existing examples of HTML transform handles but i couldn’t find anything so I decided to give it a […]

November 17, 2012

Leveraging iOS hardware via the browser with Javascript

Just another quick post tonight. I have bigger one lined up for tomorrow I promise. I just wanted to show a little experiment I did a while back with JavaScript – accessing the Accelerometer and Compass data in Safari on the iPad. Below is a short video demonstrating it if you don’t have access to an […]

October 31, 2011

Creating a HTML version of this blog’s header

Update: this post was made when I was using a different blog design. Please view the original swf file here. Below is a little experiment I did which involved creating a version of this blog’s image flipping Flickr feed header (which I made in Flash) – in HTML/CSS/Javascript. Luckily jQuery includes a JSON parsing feature […]

September 22, 2011

painty – A simple HTML5 web app for the iPad

As you may know I have been mucking around with HTML5’s canvas element lately. Here is an evolution of the paint mixing example I showed a couple posts back. I decided to turn it into a simple iPad web app. Check out the video below and visit the following URL on an iPad to try […]

August 14, 2011

Javascript and Canvas wet paint mixing

Here is an experiment I did to learn how the HTML5 Canvas tag works. I wanted to know how to manipulate pixels so I attempted to port my AS3 paint mixing to Javascript. I was surprised by the performance although it doesn’t seem to be as fast as the Flash version, and it is definitely […]

June 23, 2011