<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
 xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:media="http://search.yahoo.com/mrss/">
<channel>
    <title>zachstronaut: newest posts</title>
    
    <link>http://www.zachstronaut.com/</link>
    <atom:link href="http://www.zachstronaut.com/posts/rss" rel="self" type="application/rss+xml" />
    
    <language>en-us</language>
    
    <pubDate>Mon, 18 Jan 2010 09:45:00 -0800</pubDate>
    
    <description>Newest posts on zachstronaut.</description>
    
    <item>
    <title><![CDATA[Touch Screen Building Directory - Video Preview]]></title>
    <link>http://www.zachstronaut.com/posts/2010/01/17/touch-screen-directory-web-app.html</link>
    <guid>http://www.zachstronaut.com/posts/2010/01/17/touch-screen-directory-web-app.html</guid>
    <pubDate>Mon, 18 Jan 2010 09:45:00 -0800</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2010/01/17/touch-screen-directory-web-app.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>I lead the team of people for <a href="http://www.sua.umn.edu/">Student Unions & Activities</a> at the University of Minnesota who built this touch screen building directory installed in Coffman Memorial Union. The directory is a web app running in WebKit on a Mac Mini attached to a touch screen monitor.  <em>No Flash was used.</em> Many of the graphic elements like the panels and buttons are generated entirely with CSS3. The 3D floor diagrams were created with Google SketchUp.  Here's a first look at the project which launched early on Friday, January 15th:</p>

<div class="inset center-text">
<object width="600" height="400"><param name="movie" value="http://www.youtube.com/v/_C8kP7PEAmI&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_C8kP7PEAmI&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="400"></embed></object>
</div>

<p>We used a usability test driven design process.  We were able to completely redesign portions of the project in the week before it launched based on direct user feedback. We are continuing to test and make iterative improvements to the directory. Special thanks to the totally epic team that made this possible: Ellie, <a href="http://ethanpoole.com">Ethan</a>, <a href="http://kamranayub.com">Kamran</a>, Ken, Sungho, and Trent. My role included project management, creative direction, information architecture (IA), core PHP and MySQL work, as well as JavaScript work on the drag-and-drop administrative tool for the map data.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2010/01/17/touch-screen-directory-web-app.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[&lt;/2009&gt; Predictable Year in Review Post]]></title>
    <link>http://www.zachstronaut.com/posts/2010/01/10/2009-year-in-review.html</link>
    <guid>http://www.zachstronaut.com/posts/2010/01/10/2009-year-in-review.html</guid>
    <pubDate>Sun, 10 Jan 2010 09:49:52 -0800</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2010/01/10/2009-year-in-review.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>Well, yesterday was the last day of 2009, and today starts a new decade.  Hello 2010.  You are so shiny and futuristic looking.  Anyway, I figured I'd succumb to the incredibly predictable year-in-review post.  So what did I do in 2009?  I did quite a bit actually, and writing this post helps to remind me of that... otherwise I just have a tendency to think of all the things I <em>didn't</em> accomplish.  Also, I find years tend to blur together without any reflection.  Here's a handy little timeline [made with pure CSS and no images, don't-chya-know] of oh-nine:</p>

<div class="timeline">
    <h3>January</h3>
    <ul>
        <li><p>Wrote this blog app using my own custom PHP/MySQL MVC framework</p></li>
        <li><p>Launched zachstronaut.com</p></li>
        <li><p>Had a little <a href="http://www.zachstronaut.com/posts/2009/01/17/frigid.html">fun with the 40-below weather</a></p></li>
        <li><p>Connected with Karl Swedberg of <a href="http://www.learningjquery.com/" target="_karl">Learning jQuery</a> and helped to <a href="http://www.zachstronaut.com/posts/2009/01/18/jquery-smooth-scroll-bugs.html">patch his smooth scrolling script</a></p></li>
        <li><p>My <a href="http://www.zachstronaut.com/posts/2009/01/27/canvas-404.html">Canvas+JavaScript Black Hole</a> 404 page became 404 Research Lab's <a href="http://plinko.net/404/links.asp?type=otw">404 of the Week</a></p></li>
    </ul>
    
    <h3>February</h3>
    <ul>
        <li><p>Celebrated <a href="http://www.zachstronaut.com/posts/2009/02/13/1234567890-day-countdown.html">1234567890 day</a></p></li>
        <li><p>Created the <a href="http://www.zachstronaut.com/posts/2009/02/18/announcing-birdmanizer.html">Harvey Birdmanizer</a> as a way to play around with WebKit's CSS transforms and transitions</p></li>
        <li><p>Found <a href="http://www.zachstronaut.com/posts/2009/02/02/analytics-browser-window-size.html">a use for the beta Events feature</a> that popped up in my Google Analytics</p></li>
        <li><p><a href="http://www.zachstronaut.com/posts/2009/02/22/jquery-patch-css-transform.html">Patched jQuery to standardize access to CSS transforms</a> across Chrome, Safari, and Firefox.</p></li>
    </ul>
    
    <h3>March</h3>
    <ul>
        <li><p>Released my <a href="http://www.zachstronaut.com/posts/2009/03/11/jquery-plugin-rotate-3d-isometric.html">rotate3Di jQuery plugin</a> that makes isometric 3d rotation of html content possible</p></li>
    </ul>
    
    <h3>April</h3>
    <ul>
        <li><p>Spoke at <a href="http://minnewebcon.umn.edu/ver_one/schedule09.php" target="_wmc">MinneWebCon 2009</a> about <a href="http://www.zachstronaut.com/posts/2009/03/30/minnewebcon-2009.html">Web Human Interface Guidelines</a></p></li>
    </ul>
    
    <h3>May</h3>
    <ul>
        <li><p>Had an emergency appendectomy</p></li>
        <li><p>Won a award for the <a href="http://www.zachstronaut.com/posts/2009/05/08/award-winning-video-game.html">web-based JavaScript video game Handy Andy 2</a></p></li>
        <li><p>Presented <a href="http://www.zachstronaut.com/posts/2009/05/13/minnedemo-shortjournal.html">ShortJournal</a> at <a href="http://minnedemo.org/" target="_mdemo">minnedemo</a></p></li>
    </ul>
    
    <h3>June</h3>
    <ul>
        <li><p>My <a href="http://www.zachstronaut.com/posts/2009/06/15/isocube-css-3d-cube.html">"3D" CSS isocube</a> was an official <a href="http://hacks.mozilla.org/2009/06/3d-transforms-isocube/" target="_mozhacks">Mozilla Hacks</a> demo for the Firefox 3.5 release</p></li>
        <li><p>Created a <a href="http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html">CSS realtime spotlight effect</a>, another official <a href="http://hacks.mozilla.org/2009/06/text-shadow-spotlight/" target="_mozhacks">Mozilla Hacks demo</a> also featured on <a href="http://ajaxian.com/archives/fun-with-text-shadow" target="_ajax">Ajaxian</a></p></li>
        <li><p>Showed some <a href="http://www.zachstronaut.com/posts/2009/06/28/pixel-art-legos-video-games.html">pixel art</a> in the Together show at the <a href="http://www.umberstudios.com/" target="_umber">umber&deg; studios</a> art gallery</p></li>
    </ul>
    
    <h3>July</h3>
    <ul>
        <li><p>Celebrated my nation's independence by blowing up a small part of it
    </ul>
    
    <h3>August</h3>
    <ul>
        <li><p>Patched jQuery to support <a href="http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html">animation of the rotation and scale CSS transforms</a></p></li>
        <li><p>Created the <a href="http://www.zachstronaut.com/posts/2009/08/31/equip-pants-rpg-game.html">JavaScript RPG Equip &gt; Pants</a> in seven days for the <a href="http://experimentalgameplay.com/blog/2009/08/and-the-theme-of-august-is/" target="_exp">Experiment Gameplay Project</a></p></li>
    </ul>
    
    <h3>September</h3>
    <ul>
        <li><p>Remixed <a href="http://css-tricks.com/" target="_csstricks">Chris Coyier</a> and <a href="http://devongovett.wordpress.com/" target="_devon">Devon Govett</a>'s bookmarklet <a href="http://css-tricks.com/examples/ThePrintliminator/" target="_print">Printliminator</a> into the <a href="http://www.zachstronaut.com/lab/printliminasploder.html">Printliminasploder</a></p></li>
    </ul>
    
    <h3>October</h3>
    <ul>
        <li><p>Invited to demo <a href="http://www.scribbls.com/" target="_scribbls">Scribbls</a> with <a href="http://paularmstrongdesigns.com/" target="_paularms">Paul Armstrong</a> at the <a href="http://www.mimasummit.org/">2009 MIMA Summit</a></p></li>
        <li><p>Had a wonderful Halloween holiday in London, England</p></li>
    </ul>
    
    <h3>November</h3>
    <ul>
        <li><p><a href="http://articles.sitepoint.com/article/overcome-cache-conundrums" target="_sitepoint">SitePoint</a> published my article about <a href="http://www.zachstronaut.com/posts/2009/11/10/css-image-browser-cache-control.html">browser cache control</a> for images, CSS, and JavaScript files</p></li>
        <li><p>Attended the awesomest <a href="http://minnebar.org/minnebar/" target="_minnebar">minnebar</a> yet and met some really <a href="http://www.ideaswarm.com/products/appviz/" target="_appviz">great</a> <a href="http://www.batterypoweredgames.com/" target="_games">folks</a></p></li>
    </ul>
    
    <h3>December</h3>
    <ul>
        <li><p>Attended <a href="http://www.aneventapart.com/2009/sanfrancisco/" target="_aea">An Event Apart</a> in San Francisco and made <a href="http://twitter.com/cygnil" target="_cygnil">new friends</a> and saw <a href="http://jpmullan.com" target="_jesse">old friends</a></p></li>
        <li><p>Met <a href="http://www.zeldman.com/" target="_zeldman">Zeldman</a>, <a href="http://meyerweb.com/" target="_meyer">Meyer</a> again, <a href="http://snook.ca/" target="_snook">Snook</a> in person, and saw <a href="http://twitter.com/jmspool" target="_spool">Spool</a> do magic tricks</p></li>
        <li><p>Previewed my <a href="http://www.zachstronaut.com/posts/2009/12/02/3d-javascript-flipbox.html">3D-flipping image gallery</a> LightBox-clone</p></li>
        <li><p>Used <a href="http://www.zachstronaut.com/lab/cooking-with-gas.html">CSS text-shadow to create a burning text on fire effect</a></p></li>
        <li><p>Made the <a href="http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html">Winternizer</a>, which creates realistic snow on any website with some CSS text-shadow trickery</p></li>
    </ul>
</div>

<p>Phwew... I got tired typing that, and even more tired re-reading it.  Where do I get off thinking I didn't get anything done in 2009?  It is a year I should definitely be proud of.  Other things from the year not in the timeline: a bunch of browser bugs I found and submitted over the course of the year, countless projects at my full-time job at the University of Minnesota (probably most memorable is launching a <a href="http://www.sua.umn.edu/reservations/coffman/spaces/great-hall" target="_sua">complete redesign of the Events &amp; Conferences site</a>), and a ton of new friends gained and connections made.</p>

<p>My <a href="http://www.zachstronaut.com/posts/2009/01/12/launch.html">stated resolution for 2009</a> was to, <em>"Help the collective improvement of the web."</em>  I'd say I kept that promise to myself (probably a personal first for a New Year's resolution).  Every bug I submitted, every patch I wrote, and every crazy thing I tried to get web browsers to do were all my contributions to the vast collection of brilliant people out there who all helped to make 2009 the year that <em>web browsers really got awesome</em>.</p>

<p>In 2010 I will continue to work to make the web more awesomer [sic], and I'm also making some personal resolutions to dig deeply in the mobile web, spend a lot of time on interactive design and games, and also make way more time for doodling and drawing.</p>

<p>Another important statement I made back at the beginning of 2009 was that I believe making connections is perhaps <em>the</em> most important thing to be doing.  I am genuinely grateful for every single connection I made with so many people over the last year, both new connections and re-connections.  2009 was a banner year in that regard, but staying connected is just as much a 2010 New Year's resolution for me.  I look forward to attending more conferences, working with more people, helping people succeed at their passions, and being inspired by the work done by all of you brilliant folks.</p>

<p>Have a great 2010!  Oh, and if you are interested, check out the <a href="http://www.zachstronaut.com/css/timeline.css" target="_css">CSS for no-images-used timeline</a>.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2010/01/10/2009-year-in-review.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[New Project: Winternetizer, Web 2.snow]]></title>
    <link>http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html</guid>
    <pubDate>Thu, 31 Dec 2009 09:08:16 -0800</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>My latest project is a little "Web Two-Point-Snow" fun I put together as my personal holiday gift to the internet, or should I say <em>winter</em>net&hellip; <em>win</em>ternet?  Ok, I'll stop.  Anyway, the <a href="http://www.zachstronaut.com/projects/winternetizer/">Winternetizer</a> adds festive, fancy, 100% Flash-free flakes of falling snow to any website.</p>

<p>You'll have a much better experience using a browser that Santa has on his Nice List such as Safari, Firefox 3.5+, or Chrome. In fact, in those browsers, I'd go so far as to say the snow looks <strong>so real you will find yourself flopping on the ground to make snow angels.</strong> Give it a try now before you read about the super cool technical details behind it:</p>

<form class="formy" action="/winternetizer/post" method="post" target="_winternet">
<label for="url">Website URL</label><input style="width: 342px;" type="text" id="url" name="url" value="http://www.jquery.com" />
<input type="submit" class="button" id="go" name="go" value="Winternetize!" />
</form>

<p>(Incidentally, you can also add the JavaScript directly to your own site to delight your visitors.  The <a href="http://www.zachstronaut.com/projects/winternetizer/">Winternetizer project page</a> has details.)</p>

<h3>The Secrets to Better Snow</h3>

<p>Yes, it is true that falling snow scripts go back probably over a decade.  We've all seen it done using falling snowflake GIFs, or falling periods, or the trusty asterisk (which to be fair, is a great six-sided stand-in for an actual flake).</p>

<p>However, if you have a modern browser, you will have noticed that my falling snow script has depth-of-field blurring and parallax, flakes that rotate as they fall, and you lucky Mac users no doubt noticed the pretty actual snowflake graphics.  The total effect is accomplished with text, CSS, and JavaScript &mdash; no Flash, no PNGs, no GIFs, no Canvas.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Demo: "3D" JavaScript Tile Flipping Photo Gallery]]></title>
    <link>http://www.zachstronaut.com/posts/2009/12/02/3d-javascript-flipbox.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/12/02/3d-javascript-flipbox.html</guid>
    <pubDate>Wed, 02 Dec 2009 20:19:12 -0800</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/12/02/3d-javascript-flipbox.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p><strong>FlipBox</strong> is another LightBox clone (a JavaScript photo gallery tool) where the new twist is a fun "3D" tile flipping animation effect.  It is much easier to demonstrate than to explain, so I decided to do my first screencast with audio (be gentle!) so I could show you what FlipBox is all about.  Incidentally, Mac OSX 10.6 Snow Leopard has a great free screen capture tool built into QuickTime.  Sorry in advance if the volume is a little low.  Real action starts at 0:45:</p>

<div class="inset center-text">
<object width="600" height="400"><param name="movie" value="http://www.youtube.com/v/oHJs4QerZyo&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/oHJs4QerZyo&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="400"></embed></object>
</div>

<h3>More About FlipBox</h3>

<p>FlipBox is jQuery-based and makes use of my <a href="http://www.zachstronaut.com/projects/rotate3di/">rotate3Di plugin</a> to create a 3D-like isometric tile flipping effect using the CSS3 <code>transform</code> property currently only supported by Safari, Chrome, and Firefox 3.5+.  (That's another reason why I wanted to record a video demo.)  If you happen to have an awesome web browser, you can check out a <a href="http://www.zachstronaut.com/projects/flipbox/flipbox.php">live demo of FlipBox</a>.</p>

<p>In it's current state, with only a little preparation by the user, FlipBox is already a simple to use LightBox-like tool.  There's a few other demos with this concept I hope to put together, and I would also like to write proper documentation and do a release.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/12/02/3d-javascript-flipbox.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Best CSS (and Image) Cache Control]]></title>
    <link>http://www.zachstronaut.com/posts/2009/11/10/css-image-browser-cache-control.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/11/10/css-image-browser-cache-control.html</guid>
    <pubDate>Tue, 10 Nov 2009 19:52:23 -0800</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/11/10/css-image-browser-cache-control.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>Have you ever updated the markup and CSS for a website but when you load it in your browser it renders incorrectly because of the browser's cache?  Have you ever told a co-worker or client that they need to "refresh" or "force refresh?" Chances are then that other visitors to your site are running into this problem, too.</p>

<p>Busy sites like Twitter, Digg, Boing Boing and others use methods to avoid browser cache issues.  They find it important for their sites to always display correctly.  You too can ensure visitors to your website will always get exactly the version of your style sheets and related image files that you want them to get.</p>

<p>I wrote an article for <a href="http://www.sitepoint.com/" target="_sitepoint">SitePoint</a> covering solutions to browser cache problems titled <a href="http://articles.sitepoint.com/article/overcome-cache-conundrums" target="_sitepoint">"Overcome Your Caching Conundrums"</a>.</p>

<p>In the article I cover popular ways to deal with JavaScript and CSS file cache control, as well as a <strong>trick-of-the-trade</strong> method that will also help you manage your image caching.  <em>Hint:</em> Have you ever wished that <code>url()</code> for your background images was relative to the styled-document's location instead of being relative to the stylesheet file's location?  I used to feel that way, and it wasn't too long ago that I saw <a href="http://twitter.com/meyerweb/status/1092045690" target="_twitter">Eric Meyer tweet a similar desire</a>. But now I am actually quite glad that <code>url()</code> works the way it does, and that has to do entirely with CSS cache controlling.</p>

<p>Now go and <a href="http://articles.sitepoint.com/article/overcome-cache-conundrums" target="_sitepoint">read the article on SitePoint</a>.  I hope you will find it interesting!</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/11/10/css-image-browser-cache-control.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[My Zombie Video Commercial]]></title>
    <link>http://www.zachstronaut.com/posts/2009/10/20/lunch-zombie-video-commercial.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/10/20/lunch-zombie-video-commercial.html</guid>
    <pubDate>Tue, 20 Oct 2009 15:06:50 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/10/20/lunch-zombie-video-commercial.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>In the spirit of Halloween, I wanted to post this zombie-themed video commercial for the <a href="http://www.sua.umn.edu/gopherexpress/" target="_gex">Gopher Express convenience store</a>.  I did much of the writing, directing, and editing for the video with a lot of help from some <a href="http://twitter.com/jmullan" target="_twitter">very talented</a> <a href="http://twitter.com/trigunw0lf" target="_twitter">people</a>.  I was definitely making a deliberate nod at director <a href="http://www.imdb.com/name/nm0942367/" target="_imdb">Edgar Wright's</a> work on <em>Shaun of the Dead</em>.  I think it shows.</p>

<p><strong>My zombie vide is titled, "Luuuuuuuunch." Watch it now!</strong></p>

<div class="inset center-text">
<object width="500" height="405" style="margin: 0 auto;"><param name="movie" value="http://www.youtube.com/v/AY2pow8NBUY&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AY2pow8NBUY&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"></embed></object>
</div>

<ul class="download padding">
	<li><a href="/videos/luuunch/zombie-gex-s3-640.mov">zombie-gex-s3-640.mov (51MB MOV)</a></li>
</ul>

<p>I was extremely honored when this video won a <em>Communicators Forum Maroon Award</em> in the "electronic media, video" category in 2008.  The video was also submitted this year to the <a href="http://zombieshortfilmfestival.blogspot.com/" target="_fest">Zombie Short Film Festival</a> in Toronto.  With some luck, my co-creators and I will be able to add a "double award-winning film" to our resumes.</p>

<p><em>[Fingers crossed.]</em></p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/10/20/lunch-zombie-video-commercial.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Equip &gt; Pants, a "Bare" Minimum RPG]]></title>
    <link>http://www.zachstronaut.com/posts/2009/08/31/equip-pants-rpg-game.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/08/31/equip-pants-rpg-game.html</guid>
    <pubDate>Mon, 31 Aug 2009 19:50:09 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/08/31/equip-pants-rpg-game.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>I've been tracking the <a href="http://experimentalgameplay.com/" target="_expgame">Experimental Gameplay Project</a> blog since its return earlier this year.  I decided to enter the competition this month when I saw the <a href="http://experimentalgameplay.com/blog/2009/08/and-the-theme-of-august-is/" target="_expgame">August theme, "bare minimum,"</a> which they suggested could be anything including "graphics, sound, gameplay &mdash; some have even been so crass as to suggest clothing!"</p>

<p>My idea was to create an extremely basic RPG with gameplay throwbacks to NES titles like Dragon Warrior and Final Fantasy, but with even simpler graphics.  The graphics concept I came up with was basically that anything in the game would be represented with giant square pixels of color.  And then playing off the theme's implication of bare-as-in-naked, I came up with the game title: Equip &gt; Pants.  Here's a very brief review:</p>

<blockquote>
<p>Having perhaps the highest hilarious: number of pixels ratio, equip > pants follows the exploits of a pantless hero who must don pants. <cite>-Experimental Gameplay Project</cite></p>
</blockquote>

<p>In the spirit of the Experimental Gameplay Project competition rules, I spent just seven days developing this game.  I put in less than 40 hour of development time total.</p>

<p>The game is written in JavaScript, and should run fine in most browsers.  <strong>Play it now. Click START below.</strong></p>

<div class="inset">
    <iframe src="/lab/equip-pants" width="408" height="360"></iframe>
</div>

<p>And after you've finished, check out the <a href="http://experimentalgameplay.com/blog/2009/08/best-of-the-net-bare-minimum-edition/" target="_expgame">other games</a> from the August theme.  Just to give a few more technical details about the game: I used the DOM to draw the graphics instead of a canvas tag.  Those of you with Safari, Chrome, or Firefox 3.5 should see a beautiful pixel font in the game thanks to an @font-face rule.</p>

<p>Oh, and don't mind the ABOUT / CREDITS link... that just goes to this blog entry.  (Some places have linked to the game directly rather than this post.)
                
        <p><a href="http://www.zachstronaut.com/posts/2009/08/31/equip-pants-rpg-game.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Where Is the Web Revolution Taking Us?]]></title>
    <link>http://www.zachstronaut.com/posts/2009/08/24/web-revolution-concerns.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/08/24/web-revolution-concerns.html</guid>
    <pubDate>Mon, 24 Aug 2009 17:20:39 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/08/24/web-revolution-concerns.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>Today I read an article on <a href="http://happyworm.com" target="_happyworm">happyworm.com</a> titled <a href="http://happyworm.com/blog/2009/08/24/html-5-the-revolution-will-not-be-televised/" target="_happyworm">"HTML 5 - The Revolution will not be Televised."</a>  It reminded me of some of the concerns I've been having lately with developments in the web industry.  They are concerns I spoke about briefly at the end of my <a href="http://www.zachstronaut.com/posts/2009/03/30/minnewebcon-2009.html">presentation on Web Human Interface Guidelines</a> at <a href="http://minnewebcon.umn.edu/sessions09.php" target="_minnewebcon">MinneWebCon 2009</a>, and now feels like a pretty good time to dust the subject off and say some more about it.</p>

<p>Specifically, I did not share the happyworm article's optimism about these points:</p>

<blockquote>
<p>"It seems that it's not so much about the corporations anymore, more about the community."</p>

<p>"...a seismic shift in power towards the community and away from the browser vendors, the consequences of which cannot be underestimated."</p>
</blockquote>

<p>First, let me start by saying I'm assuming by "community" the author meant web developers. It is important to note that Apple, and even more so Google, were heavily involved in the HTML5 spec and thus, if only by association, the demise of XHTML2.  I ask if maybe the power has moved away from browser vendors towards content-provider corporations, and not towards the community?  (It is worth noting that this is a very common trend now in America for decades.)  The W3C ceding some control strikes me as perhaps further evidence that the community may actually be losing ground.  Google entering the browser vendor market only serves to muddy the waters.</p>

<p>Some fraction of the web developer community was very excited by Google pushing HTML5.  Some fraction was very disappointed.  Can the community have the power if the community is divided?  Maybe Google and Apple are listening only while it is convenient for them and their bottom line.  Maybe the HTML5 supporters think they have power because Google's use of power just happens to line up with some of the web development community for the time being.</p>

<p>Personally, I'm very much a supporter of community-based web standards.  I'm glad for now that we have Google and Apple blazing ahead with roughly standards-based HTML5, CSS3, and JavaScript.  I certainly don't think we should give Microsoft the keys to the car.  They've already shown us where they would drive it, if not deliberately then by incompetence or lack of vision.  And I think we also must give credit to Opera and Mozilla.  They seem to embrace community driven development.  I think they've got our backs.</p>

<p>I do think we probably have little to fear on the CSS and HTML fronts.  I think the illusion of community derived standards will continue, with the corporations that actually make the decisions acting mostly benevolently.  Occasionally they may err on the side of progress over standardization, but the benefits of that will probably outweigh the problems.</p>

<p>I am much more concerned about JavaScript (JS), especially with how Google is positioning itself.  We (web developers) enjoy fairly standardized JavaScript language for the moment, with a lush pasture of JS libraries, user interface (UI) toolkits, etc to choose from.  Google has entered the browser market and is fully intending to create a browser-based operating system.  I'm not so sure we can trust Google to act in the web development community's interests over its own corporate money-making interests in regards to web applications, specifically client-side JavaScript applications and web applications UI.  I think there is a real possibility that Google may create a proprietary JavaScript web applications platform and lure many developers in via a "web standards" carrot, custom (read: proprietary) application toolkits with pre-built functionality, a captive audience, and a clear path to individual app monetization.  I think this could create some real fractures in the JavaScript language and potentially even web development as we know it.</p>

<p>I will give a simpler example for my concerns for the future of community driven decisions in the realm of JavaScript and Web Applications UI.  There has been some talk of incorporating jQuery as part of HTML5/JavaScript.  If you are a Dojo, YUI, or Mootools fan, how would you feel about jQuery being selected as an early winner?  What are the chances people will want to use some other JS framework, or Web App UI widgets built for some other JS framework, when jQuery would perform dramatically better because it is actually built into the browser?</p>

<p>It is far from certain, but we may soon find ourselves with far fewer choices as web developers than we have now.  Or, maybe Google will "do no evil" and blow all of our minds with great stuff while having a ear in the web development community.  I, for one, am watching carefully.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/08/24/web-revolution-concerns.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[jQuery Patch: Animate CSS Rotation and Scale]]></title>
    <link>http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html</guid>
    <pubDate>Fri, 07 Aug 2009 23:03:16 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>I have created a monkey patch for jQuery 1.3.1+ which enables you to independently set and/or animate both the scale and rotation of any HTML content with jQuery. This code uses the <code>scale()</code> and <code>rotate()</code> CSS transformations <strong>that are only supported by Webkit, Safari, Chrome, and Firefox 3.5 at this time.</strong></p>

<p>As an example I have some spinning HTML content.  You can click the content to increase its scale while it continues to spin.</p>

<p>Read the full post to see the example and download the patch.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[My Art from "Play" and "Together" Shows]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/28/pixel-art-legos-video-games.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/28/pixel-art-legos-video-games.html</guid>
    <pubDate>Sun, 28 Jun 2009 20:11:35 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/28/pixel-art-legos-video-games.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>A friend of mine runs <a href="http://www.umberstudios.com/" target="_umber">umber&deg; studios</a>, an art gallery in south Minneapolis.  The gallery is celebrating its second anniversary with a show titled "Together" that brings&hellip; together&hellip; all the artists who have shown work in the gallery in the last two years.  The reception was on June 20, and the show runs through July 12.</p>

<p>Here's a photo of yours truly next to my submission &mdash; a nearly life size blowup of some pixel art I've been working on for Zachstronaut:</p>

<div class="half add-bottom-margin">
<img src="/posts/umber-shows/lg-zachstronaut.jpg" width="288" height="432" alt="Me standing next to large pixel astronaut." />
</div>
<div class="half add-bottom-margin">
<img src="/posts/umber-shows/together-postcard.jpg" width="288" height="432" alt="The postcard for Together show." />
</div>

<p>So like I said, the "Together" show was comprised entirely of artists who had previously shown work at umber.  I had the great pleasure of showing a variety of fun pieces in a fall 2007 show titled <a href="http://www.umberstudios.com/archive.php?directory=archive/play" target="_umber">"Play."</a>  The show was the idea of my friend <a href="http://www.skwiotsmith.com/" target="_skwiot">Peter Smith</a>, and I was very happy to have him invite me to be a part of it.</p>

<p>My art for the "Play" show was a juxtaposition (oh yes, I dropped the j-bomb) of video games I played growing up &mdash; which inspired my career path as a builder of the digital flavor &mdash; with the physical toys I used to build stuff as a kid.</p>

<p id="lego">First below, photos of four pieces done in LEGO brick on LEGO plate (left to right, top to bottom).  Here are links to the games in question: <a href="http://en.wikipedia.org/wiki/Bubble_Bobble" target="_wikipedia">Bubble Bobble (NES)</a>, <a href="http://en.wikipedia.org/wiki/Dragon_Warrior" target="_wikipedia">Dragon Warrior (NES)</a>, <a href="http://en.wikipedia.org/wiki/Final_Fantasy_(video_game)" target="_wikipedia">Final Fantasy (NES)</a>, <a href="http://en.wikipedia.org/wiki/Super_Mario_Bros." target="_wikipedia">Super Mario Bros. (NES)</a>.  Then, a piece constructed with dominoes, <a href="http://en.wikipedia.org/wiki/GORILLAS.BAS" target="_wikipedia">GORILLAS.BAS (QBasic)</a>.</p>

<div class="half add-bottom-margin">
<img src="/posts/umber-shows/lego-bubblebobble.jpg" width="288" height="180" alt="Bubble Bobble." />
</div>
<div class="half add-bottom-margin">
<img src="/posts/umber-shows/lego-dragonwarrior.jpg" width="288" height="180" alt="Dragon Warrior." title="Descendent of Erdrick." style="cursor: help;" />
</div>

<div class="half add-bottom-margin">
<img src="/posts/umber-shows/lego-finalfantasy.jpg" width="288" height="180" alt="Final Fantasy." title="Black Mage casts FIR2." style="cursor: help;" />
</div>
<div class="half add-bottom-margin">
<img src="/posts/umber-shows/lego-mario.jpg" width="288" height="180" alt="Super Mario Bros." />
</div>

<div class="half add-bottom-margin">
<img src="/posts/umber-shows/domino-gorillas.jpg" width="288" height="216" alt="GORILLAS.BAS." />
</div>
<div class="half add-bottom-margin">
<img src="/posts/umber-shows/play-postcard.jpg" width="288" height="216" alt="The postcard for Play show." />
</div>

<p>Actually, I had one more LEGO work in the show which was the heart containers from <a href="http://en.wikipedia.org/wiki/The_Legend_of_Zelda" target="_wikipedia">The Legend of Zelda (NES)</a>, but that piece has sold.  If you're seriously interested in any of this art or commissioning a piece, <a href="http://www.zachstronaut.com/about/#contact">contact me</a>.</p>

<p>Surprisingly, I've never become a regular Flickr user, but I imagine I should get high-res shots of these up on Flickr or somewhere eventually.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/28/pixel-art-legos-video-games.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[CSS text-shadow Fun: Realtime Lighting Demo]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html</guid>
    <pubDate>Mon, 22 Jun 2009 13:02:47 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html#comments</comments>
    <content:encoded><![CDATA[
        
        <a class="right" href="http://hacks.mozilla.org/2009/06/text-shadow-spotlight/" target="_mozhacks"><img src="http://sfx-images.mozilla.org/hacks/HACK_BADGE.png" alt="Official Demo, Hacks.Mozilla.org." border="0" /></a>

<p>After my <a href="http://www.zachstronaut.com/posts/2009/06/13/exploring-css-text-shadow.html">last post about the CSS <code>text-shadow</code> property</a> it occurred to me that it could be used to create some fun pseudo-realtime lighting effects.</p>

<p>In the example below I am using a PNG to create a spotlight, and I am using JavaScript to update the <code>text-shadow</code> style on the text in order to simulate realtime shadows from a single light source.  <strong>Move your mouse over the box to cast a shadow with the spotlight.</strong></p>

<p>Should work in Firefox 3.5, Safari, Opera, and Chrome.  Apparently still no support in IE8?  Big shocker there.&lt;/sarcasm&gt;</p>

<p><a href="http://www.zachstronaut.com/lab/text-shadow-box/text-shadow-box.html" target="_example">View the example in a new window.</a></p>

<div class="inset"><iframe src="http://www.zachstronaut.com/lab/text-shadow-box/text-shadow-box.html" width="600" height="408" scrolling="no"></iframe></div>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[HTML Isometric "3D" Cube Using CSS Transforms]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/15/isocube-css-3d-cube.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/15/isocube-css-3d-cube.html</guid>
    <pubDate>Mon, 15 Jun 2009 00:00:00 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/15/isocube-css-3d-cube.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>The isometric "3D" cube shown in the demo is created using HTML and CSS transforms available in Firefox 3.5, Safari, and Chrome.  Users of these browsers should also see some video on one of the faces of the cube thanks to the new HTML5 <code>&lt;video&gt;</code> tag.</p>

<p>A <a href="http://hacks.mozilla.org/2009/06/3d-transforms-isocube/" target="_mozhacks">detailed blog post about the isocube</a> was published on <a href="http://hacks.mozilla.org/" target="_mozhacks">hacks.mozilla.org</a> as part of their Upgrade the Web in 35 Days series.</p>

<p><a href="http://www.zachstronaut.com/lab/isocube.html" target="_isocube">View the isocube in a new window.</a></p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/15/isocube-css-3d-cube.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Exploring CSS text-shadow Property]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/13/exploring-css-text-shadow.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/13/exploring-css-text-shadow.html</guid>
    <pubDate>Sat, 13 Jun 2009 15:30:57 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/13/exploring-css-text-shadow.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>With the Safari supported CSS property <code>text-shadow</code> coming to Firefox 3.5, I thought I'd play around with the feature a bit more.  Because shadows can be positioned, colored, and blurred &mdash; and because you can do multiple shadows &mdash; they actually let you do more that just create shadows.  You can create programmatically blurred copies of text.  You can create outer glows.  You can create pseudo-3D effects.  Playing around with what was technically possible, I did discover a few interesting things.  None of the examples below are mean to be beautiful from a design perspective.  They are more about exploration of the technology.</p>

<h3>The Examples</h3>

<style type="text/css" media="all">
#shex-one {
    background: white;
    color: white;
    text-shadow: 1px 1px 0 black, 2px 2px 0 black;
}

#shex-two {
    background: white;
    text-indent: -999em;
    text-shadow: 999em 0 0 red;
    overflow: scroll;
}

#shex-three {
    background: white;
    color: rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 1px green;
}

#shex-four {
    background: white;
    color: blue;
    text-indent: -999em;
    text-shadow: 999em 0 8px blue;
    overflow: hidden;
    -webkit-transition: text-shadow 0.25s linear;
}

#shex-four:hover {
    text-shadow: 999em 0 0 blue;
    
}
</style>

<p>Make the text color the same as the background color for "knocked out" text, and do multiple shadows for "3D" text:</p>

<p id="shex-one">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

<pre class="sh_css">
#shex-one {
    color: white;
    text-shadow: 1px 1px 0 black, 2px 2px 0 black;
}
</pre>

<p>By negatively offsetting the text, and then pushing the text's shadow back where the text should be, you can create text that seems to be unselectable.  Also, I set the CSS here to <code>overflow: scroll;</code> to show that text shadows in Firefox 3.5 (as of beta 999) affect the width of their container:</p>

<p id="shex-two">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

<pre class="sh_css">
#shex-two {
    text-indent: -999em;
    text-shadow: 999em 0 0 red;
    overflow: scroll;
}
</pre>

<p>In Safari, text-shadows are the same opacity as the text they shadow.  Text with CSS set to <code>color: transparent;</code> doesn't show up at all.  Firefox doesn't do this, which actually lets you make text that turns invisible when you select it:</p>

<p id="shex-three">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

<pre class="sh_css">
#shex-three {
    color: rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 1px green;
}
</pre>

<p>And finally, some fun with text that is blurred/out of focus until you mouse over it.  A little extra pizzaz added in Safari which supports animated CSS transitions:</p>

<p id="shex-four">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

<pre class="sh_css">
#shex-four {
    color: blue;
    text-indent: -999em;
    text-shadow: 999em 0 8px blue;
    overflow: hidden;
    -webkit-transition: text-shadow 0.25s linear;
}

#shex-four:hover {
    text-shadow: 999em 0 0 blue;
}
</pre>

<h3>Update: Even Cooler Demos!</h3>

<p>If you are interested in more exciting uses of the CSS <code>text-shadow</code> property, then be sure to check these out:</p>

<ul>
	<li><a href="http://www.zachstronaut.com/posts/2009/12/21/happy-xmas-winternet.html">CSS text-shadow Snow!</a></li>
	<li><a href="http://www.zachstronaut.com/posts/2009/06/22/css-text-shadow-lighting-demo.html">CSS text-shadow Spotlight!</a></li>
	<li><a href="http://www.zachstronaut.com/lab/cooking-with-gas.html">CSS text-shadow fire!</a></li>
</ul>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/13/exploring-css-text-shadow.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[Fix jQuery UI Tabs to Update Browser Location]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/08/jquery-ui-tabs-fix.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/08/jquery-ui-tabs-fix.html</guid>
    <pubDate>Mon, 08 Jun 2009 21:08:24 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/08/jquery-ui-tabs-fix.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>When I spoke at <a href="http://minnewebcon.umn.edu/" target="_minnewebcon">MinneWebCon 2009</a> about <a href="http://www.zachstronaut.com/posts/2009/03/30/minnewebcon-2009.html">Standardizing Web User Interfaces</a> I covered one of my major pet peeves on the web: when content that can and should have a direct link, does not.</p>

<p>(The most common example would be the all-Flash portfolios and galleries of designers.  You get three pages into their sites looking at a particular piece of their work, and then you look up in your browser location bar and you are still at http://www.stupid-designer.com/ ... I can't share their design work with somebody even if I wanted to, because there is no link! Terrible SEO and self-promotion.&lt;/rant&gt;)</p>

<p>In terms of web user interface widgets, the very common tab view is often done incorrectly.  For instance, both <a href="http://developer.yahoo.com/yui/examples/tabview/frommarkup_clean.html" target="_yui">YUI's tab view</a> and <a href="http://jqueryui.com/demos/tabs/default.html" target="_jqueryui">jQuery UI's tab view</a> fail to change the browser's location when you switch tabs.</p>

<p>You <em>can</em> already <a href="http://www.zachstronaut.com/posts/jquery-ui-tabs/default.html#tabs-2" target="_jqueryui">directly link to a tab</a> <em>if</em> you know the URL or right-click the tab to find the URL.  However, if I use my browser's default bookmarking behavior, or if I use the location bar to copy and paste a link to somebody, or any number of other scenarios &mdash; because neither the YUI nor jQuery's tab views update the browsers location when you switch tabs, you are likely to send somebody a link to the <em>first</em> tab you landed on rather than the tab you are <em>viewing</em>.</p>

<p>The strangest part of all this is that enabling the direct linking on the back end is actually the hard part.  Getting the location to update as you switch tabs is laughably easy.  Here is the code for the default jQuery tab view behavior:</p>

<pre class="sh_js">
$('#tabs').tabs();
</pre>

To fix the jQuery tab view so that it updates the browsers location as you switch tabs, the code looks like this:</p>

<pre class="sh_js">
$('#tabs').tabs();
$('#tabs ul li a').click(function () {location.hash = $(this).attr('href');});
</pre>

<p>Couldn't be simpler.  I've set it up so you can see it in action.  In this <a href="http://www.zachstronaut.com/posts/jquery-ui-tabs/fixed.html" target="_jqueryui">fixed jQuery tabs example</a> as you click the tabs you will see your browser's location update.</p>

<p>I have submitted a <a href="http://dev.jqueryui.com/ticket/4587" target="_trac">ticket</a>.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/08/jquery-ui-tabs-fix.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>
<item>
    <title><![CDATA[jQuery Syntax for Easy Portability?]]></title>
    <link>http://www.zachstronaut.com/posts/2009/06/03/porting-jquery-syntax.html</link>
    <guid>http://www.zachstronaut.com/posts/2009/06/03/porting-jquery-syntax.html</guid>
    <pubDate>Wed, 03 Jun 2009 21:20:53 -0700</pubDate>
    <dc:creator>Zachary Johnson</dc:creator>
    <comments>http://www.zachstronaut.com/posts/2009/06/03/porting-jquery-syntax.html#comments</comments>
    <content:encoded><![CDATA[
        
        <p>I have to say, I find the syntax of the <a href="http://jquery.com/" target="_jquery">jQuery</a> JavaScript library to be very logical, efficient, and readable.  I realized today that jQuery code also has the very interesting property of being relatively easy to port to any other JavaScript library.  And jQuery, or a jQuery-like syntax, seems to be a reasonable starting point for creating JavaScript-library-agnostic code &mdash; that is, JavaScript code that <em>depends</em> on a JavaScript library to function, but can be easily made to work with <em>any</em> library.</p>

<p>As an example, lets consider the following jQuery call:</p>

<pre class="sh_js">
$('#foo,#bar').addClass('test').css('color', 'blue');
</pre>

Now lets look at code that does the same thing written for <a href="http://developer.yahoo.com/yui" target="_yui">YUI</a> and <a href="http://dojotoolkit.org/" target="_dojo">Dojo</a>:</p>

<pre class="sh_js">
// YUI
YAHOO.util.Dom.addClass(['foo', 'bar'], 'test');
YAHOO.util.Dom.setStyle(['foo', 'bar'], 'color', 'blue');

// Dojo
dojo.query('#foo,#bar').addClass('test').style('color', 'blue');
</pre>

<p>Lets say we wanted to keep the jQuery syntax shown in the very first example above, but instead of including <kbd>jquery.js</kbd> and all of the jQuery code, we wanted to use the YUI JavaScript library.  How could we make the jQuery style call use YUI?  Here's some code that maps those calls to the YUI library:</p>

<pre class="sh_js">
function UseYUI(selector) {
    this.nodes = YAHOO.util.Selector.query(selector);

    this.addClass = function (className) {
        YAHOO.util.Dom.addClass(this.nodes, className);

        return this;
    }

    this.css = function (property, value) {
        if (typeof value == 'undefined') {
            return YAHOO.util.Dom.getStyle(this.nodes, property);

        } else {
            YAHOO.util.Dom.setStyle(this.nodes, property, value);

            return this;
        }
    }
}

function $(selector) {
    return new UseYUI(selector);
}
</pre>

<p>After adding the above code to your page you could keep the jQuery syntax &mdash; i.e. <code>$('#foo,#bar').addClass(&hellip;</code> &mdash; but include the YUI library code and files instead of the code and files for jQuery.</p>

<p>And actually, if we had many methods like <code>addClass</code> where they are the same in jQuery and YUI except for the first argument, we could create a helper function to generate the mapped functions for us:</p>

<pre class="sh_js">
function UseYUI(selector) {
    this.nodes = YAHOO.util.Selector.query(selector);
    
    this.mapMethodToYUIDom = function(method) {
        this[method] = function () {
            var args = new Array();
            args.push(this.nodes);
            for (var i = 0; i &lt; arguments.length; i++) {
                args.push(arguments[i]);
            }
        
            YAHOO.util.Dom[method].apply(null, args)
        
            return this;
        }
    }

    this.mapMethodToYUIDom('addClass');
    this.mapMethodToYUIDom('removeClass');
}
</pre>

<p>Mapping the jQuery style calls to Dojo in this case is even easier than YUI.  Much easier:</p>

<pre class="sh_js">
function $(selector) {
    var nodes = dojo.query(selector);

    nodes.css = nodes.style;

    return nodes;
}
</pre>

<p>It would be a fair amount of work, and a decent bulk of code, to completely map <em>all</em> jQuery style calls to either YUI or Dojo, or any other JavaScript library for that matter. Obviously, when porting from one JavaScript library to another, going through line by line and replacing each call would result in slightly faster and more file-size efficient code.  But that's no walk in the park either.</p>

<p>With the method I've described in this post, you could actually put in the one-time effort towards creating the code to dynamically map from jQuery syntax to any other framework thereby making any and all projects you build and distribute library-agnostic.  What do you think?  It seems like such mappings would come in useful.</p>
                
        <p><a href="http://www.zachstronaut.com/posts/2009/06/03/porting-jquery-syntax.html">Continue Reading Post&hellip;</a></p>
    ]]></content:encoded>
</item>

</channel>
</rss>
