Inhouse vs Outsourced Code

November 6th, 2010

A previous employer entrusted the redesign of a major product to an Indian offshore firm.  After about seven months, they lost total confidence in this team and severed all ties.  It quickly fell on me to salvage the project and I believe it took about three months to getting it working “passably”.  Nevertheless I still got constant questions about why it was taking so long.  Rather than try to explain all of the issues with the offshore code to management and the business owners of the product, I printed out a before and after of a single function in a single file (of which there were hundreds of others in a similar state).

Inhouse vs Outsource Code

So important to note here: my revised code was about two pages long when spaced for readability.  The original code was about eight pages long, basically single-spaced, and didn’t work at all.

I taped this over my workstation and whenever someone asked me about the delays I just pointed.  It always did the trick.

Wurfl Update Schedule

October 23rd, 2010

Just as a note, I plan on holding off updating the wurfl tool on this site (http://wurfl.ditherandbicker.com) until after the Windows 7 phones make it into the database.  I imagine that’ll happen by mid November.

Frosted Glass Backgrounds via HTML5/Canvas

September 26th, 2010

I switched to Mac earlier this year but there are a few Windows 7 design touches I really admire. Chief amongst them is the “frosted glass” effect that aero employs for window borders. To me this seems like an ideal problem for html5 and the canvas tag.

My version isn’t totally ideal in terms of the effect itself. The frosting points are visible, instead of being a translucent haze. I think to really make this work I’d need to blur the “frosting” layers. While there’s actually some credible work with html5 blurring (see: http://markos.gaivo.net/blog/?p=591), I’m afraid it would significantly tax the browser.

This component is pretty customizable. You can tweak the colors and opacity of the highlights, midtones, and background. Control the radius of the borders and show whether to draw a plain white background.

I set up a few live examples here: http://www.ditherandbicker.com/canvas-frosted-glass-effect/

You can download the single source file from: Sourceforge

In terms of coding examples:

<div id="smallGlass" style="height: 200px; width: 250px"></div>
<script type="text/javascript">
     new FrostedGlass('smallGlass', {'drawWhiteBackground': false});
</script>

Produces:

And

<div id="smallGlass" style="height: 200px; width: 250px"></div>
<script type="text/javascript">
     new FrostedGlass('smallGlass');
</script>

Produces:

Gradient Header How-To

August 29th, 2010

Download here: https://sourceforge.net/projects/dynamicgradient/files/

Here’s a brief usage guide on the Gradient Header object…

This JavaScript object really just draws a whole bunch of lines. I’m using this as a dynamic background for the headers and footers on the blog portion of the site. It utilizes the canvas tag which has been supported for the past few years by most major browsers and almost all of the new webkit derived smart-phone browsers (Androids and iPhones naturally). If you want to use this for a site header, as I have, I’d recommend also forcing the scrollbar to always load with the page, otherwise the dynamically rendered canvas object might give your layout a black eye. For mobile devices, a more graceful solution may be needed.

If the destination object has an explicitly set width in its style attribute, the GH object will use that. If not, the GH object will use the width of the browser window and in the event of a resize, the width of the GH will be adjusted. Of course this doesn’t work on Internet Explorer, so I wrote the code to “degrade” rather than try to mimic functionality. Maybe I’ll readdress this once IE9 rolls out.

All of the various parameters are listed in the JavaScript file, but here’s a couple examples to get you started:

Example 1:

// <div id="gradExample1" style="width: 300px; height: 50px; border: 1px solid;"><div>
var gradExample1 = new GradientHeader('gradExample1',
        {   'lineStartColor' :'#CBBC6C',
            'lineEndColor' : '#FFFFFF',
            'lineFinalColorStop' : 1,
            'height' : 40,
            'lineWidth' : 1,
            'gutter' : 4
        });

Example 2:

// <div id="gradExample2" style="width:300px; height: 50px; border: 1px solid;"></div>
var gradExample2 = new GradientHeader('gradExample2',
        {   'drawBackground': true,
            'invert': true,
            'lineStartColor' :'#FFFFFF',
            'lineEndColor' : '#CBBC6C',
            'backStartColor' : '#FFFFFF',
            'backEndColor' : '#CBBC6C',
            'backPercent' : .5,
            'lineFinalColorStop' : 1,
            'height' : 50,
            'lineWidth' : 1,
            'gutter' : 1
        });

Note that setting the ‘invert’ flag will change the direction of the lines to start from the bottom and move upwards. Also by default, the background gradient won’t be drawn to the page.

Thinking of Header Graphics Sucks

August 28th, 2010

…you gotta sketch it out, and then open up gimp or photoshop or (ugh) illustrator.  It’s much easier to build a little process to dynamically create header graphics for you.

So I whipped up a small JavaScript class to append a dynamic header that will draw lines of random length.  It uses the canvas tag which supports simple gradients.  I think it’s certainly an improvement over what I had previously.

I wrote the class with reuse in mind, feel free to integrate into your site: https://sourceforge.net/projects/dynamicgradient/files/

NOT INTERNET EXPLORER COMPATIBLE