Petar Strinic

and all those sorts of things…

In the continuation of my exploration into browser rendered graphics, I’ve ported my recent Canvas clock to SVG. This time around I created a very rudimentary Svg class that abstracts some of the repetitive SVG element generation. Otherwise, the port differs only in the fact that the entire clock does not need to be re-rendered on every frame. The “moving parts” are only adjusted in their value or coordinates on every frame.

Demo

Share

February 7th, 2013

Posted In: Projects

Tags: , ,

Leave a Comment

In February of 2009 I made an ActionScript Clock as an experiment with ActionScript. Recently, I’ve been toying with the idea of porting some of our old Commodore 64 games, to modern platforms. The obvious answer, to the question of how to support most platforms, is to move it into the web browser. To that end I started exploring canvas and SVG and some libraries that support each. For now, here’s a version of the clock written with pure javascript and canvas. More to come later.

Demo

Share

December 15th, 2012

Posted In: Projects

Tags: , ,

Leave a Comment

While playing around with a weather widget, the other day, I though to myself why not use HTML5’s geolocation capabilities to show the user the weather for their current location automatically. This turns out to be exceedingly easy, if you’re willing to live with a couple of small assumptions, such as it’s safe to use a regular expression to parse the zip code out of Google Maps API’s formatted_address. Although they do offer a more specific “postal code” field as part of the address object, this is just a little quicker to get to, if you’re willing to assume a format like “, IL 60601”.

In easy steps…

1. Get the user’s latitude and longitude, we can do something like this:

2. Get the address information from Google maps and do the regex hack to get the zip out of the formatted_address.

Shady demo: http://petarstrinic.com/examples/whatIsMyZip.html

Share

April 7th, 2012

Posted In: Misc

Tags: , , ,

8 Comments

« Previous PageNext Page »