Coupon Ninja

I just dis­cov­ered the Coupon­Ninja web­site and com­pletely fell in love with the header images:

Coupon Ninja Screenshot

It makes me snicker every time I look at it.

Via Design Shack.

Gallery of Doodles in Lightbox 2

Nerd­StarGamer now has a new Gallery page that fea­tures my doodles:

Screenshot of Doodle Gallery

All of the images have been set up as a list of thumb­nails which use Light­box 2 to dis­play large versions.

I spent a little extra time to set up Light­box on this blog with­out using a plugin. I’ve been on a steady cru­sade to get rid of most of my plu­g­ins for quite some time. Set­ting up Light­box in Word­Press was fairly straightforward.

After down­load­ing the Light­box 2 files, I cre­ated a new direc­tory in my tem­plate direc­tory called lightbox and dropped all of the light­box files into it. I then put a func­tion call into the header.php file right before the line that reads <?php wp_head(); ?>.

<head profile="http://gmpg.org/xfn/11">
    ...some other tags...

    <?php AKM_include_lightbox(); ?>
    <?php wp_head(); ?>
</head>

The AKM_includ_lightbox(); func­tion is just a short little func­tion that I wrote and put in the functions.php file of my tem­plate. Here is the function:

function AKM_include_lightbox() {
    $lbDir = get_bloginfo('template_directory') . "/lightbox";

    // Echo out some file path variables for images used lightbox JS
    $output = '<script type="text/javascript">' . "\n";
    $output .= "\t" . 'var tplDir = "' . $lbDir . '";' . "\n";
    $output .= '</script>' . "\n";

    // Echo links to js and css for lightbox
    $output .= '<script type="text/javascript" src="' . $lbDir . '/js/prototype.js"></script>' . "\n";
    $output .= '<script type="text/javascript" src="' . $lbDir . '/js/scriptaculous.js?load=effects,builder"></script>' . "\n";
    $output .= '<script type="text/javascript" src="' . $lbDir . '/js/lightbox.js"></script>' . "\n";
    $output .= '<link rel="stylesheet" href="' . $lbDir . '/css/lightbox.css" type="text/css" media="screen" />' . "\n";

    echo $output;   
}

This first line of the func­tion sets up a vari­able that includes the path to the Light­box files inside my tem­plate direc­tory. This is nec­es­sary because the lightbox.js file needs to ref­er­ence the images included in the Light­box folder. With­out this part, the pre­vi­ous, next and close images will not show up because the link will be going to your Word­Press uploads directory.

That second chunk of text in the func­tion echos out a small bit of JavaScript into your header that simply declares the vari­able tplDir and sets it to the path to your Light­Box instal­la­tion. The last chunk of text inserts all of the nec­es­sary Light­box JavaScript and CSS links into your header. I could have writ­ten all of this directly into the header.php file, of course, how­ever I felt that my file was get­ting a bit messy and that this approach was much more clear.

We also need to make a small edit to the lightbox.js file which is going to use that tplDir vari­able we set. Find the line in the begin­ning of the file like this (around line 49):

fileLoadingImage:        'images/loading.gif',     
fileBottomNavCloseImage: 'images/closelabel.gif',

Simply change those two lines to this:

fileLoadingImage:        tplDir+'/images/loading.gif',     
fileBottomNavCloseImage: tplDir+'/images/closelabel.gif',

That com­pletes the Light­box 2 setup in Word­Press with­out using a plugin. Now all you have to do is add the rel="lightbox" tag to any link you want to use Light­box. For exam­ple, if you have a thumb­nail image that links to a larger image like this:

<a href="images/full-size-image.jpg"><img src="images/thumbnail" /></a>

To add the Light­box effect, just add in the attribute like this:

<a rel="lightbox" href="images/full-size-image.jpg"><img src="images/thumbnail" /></a>

Be sure to check out the Light­box 2 page for more infor­ma­tion on what you can do with it.

The Superest

The Super­est is a very funny run­ning blog of illus­tra­tions of super­est heros. Each super­est hero plays off of the last in a very clever way:

The Super­est is a con­tin­u­ally run­ning game of My Team, Your Team. The rules are simple: Player 1 draws a char­ac­ter with a power. Player 2 then draws a char­ac­ter whose power can­cels the power of that pre­vi­ous char­ac­ter. Repeat.

The design of the site itself is is quite ele­gant and simple. Most of the dis­play type on the site is done in a very nice typeface:

The Superest

Start from the begin­ning get the the feel­ing for the way the super­est heros flow one after another.

Typography for Seed Conference Website

The new web­site for the 3rd Seed Con­fer­ence in Chicago is sport­ing some excel­lent typography.

Seed Conference Website Screenshot

The type really looks ele­gant and nice. This is all done with CSS styles and no images. It’s a great exam­ple of what can be done with web typography.

Via Daring Fire­bal.

Multi Columns in websites

For the past couple of months I’ve been work­ing on cre­at­ing a new web­site that uses Word­Press as a CMS for the orga­ni­za­tion Girls Get Con­nected (That’s the old site, because the new one isn’t quite done yet). The project has been a great one to work on because I’ve gotten to do every­thing includ­ing the design of the site and devel­op­ment of the Word­Press back-​end and templates.

Early on in the project, after the design mockup had been approved, I knew there were going to be some dif­fi­cul­ties imple­ment­ing it. One of the things that I knew would be a prob­lem was the fact that I had designed a rather promi­nent sec­tion on the home page of the site which called for an arti­cle to be split into mul­ti­ple columns. This being a con­tent man­aged site, I also knew it wasn’t really going to be an option to ask the end users to break up their arti­cles into two even sec­tions so that it would make nice and pretty columns. Also, CSS3 really wasn’t an option, since this site would have to work on all cur­rent browsers. Some­thing else would have to be done.

The solu­tion I ended up using was a very ele­gant JavaScript pro­gram writ­ten by Randy Simons. The script is called Multi-​Column Text and is pretty easy to imple­ment. It auto­mat­i­cally splits the text into mul­ti­ple columns (you chose how many), and includes sup­port for liquid lay­outs. This means that the con­tent and columns aren’t static; they will auto­mat­i­cally adjust as the page is resized. Check out the demon­stra­tion page to see what I mean. This script is also works on enough old browsers to actu­ally be usable.

What impressed me most about the script was that it requires very little extra markup. Assum­ing all of your markup is in some sort of stan­dards com­pli­ant state, all that is required is one (or pos­si­bly two) extra div tags. Say you wanted to make the fol­low­ing code seg­ment use the mul­ti­col­umn script:

<h2>Maecenas</h2>
<p>Pellentesque mi. In lacinia iaculis ante.</p>
<h1>Ut dapibus</h1>
<p><em>Nunc non dui.</em> Maecenas quis lacus sed dui commodo elementum.</p>
<p><strong>Pellentesque rhoncus sollicitudin libero. Phasellus nunc risus, tincidunt vel, bibendum eu, molestie ac, tortor. Etiam in felis.</strong></p>
<p><strong><em>Pellentesque id erat. Mauris condimentum pharetra nibh. Fusce sollicitudin auctor tortor. Aliquam placerat,</em></strong></p>

All that needs to be added are two div tags to wrap the con­tent. The first div must also include an id or class name for the JavaScript to hook to. You can use what­ever class or id name you want when you imple­ment it. I chose to use id=multicolumn. The fin­ished markup would look like this:

<div class="multicolumn">
  <div>
    <h2>Maecenas</h2>
    <p>Pellentesque mi. In lacinia iaculis ante.</p>
    <h1>Ut dapibus</h1>
    <p><em>Nunc non dui.</em> Maecenas quis lacus sed dui commodo elementum.</p>
    <p><strong>Pellentesque rhoncus sollicitudin libero. Phasellus nunc risus, tincidunt vel, bibendum eu, molestie ac, tortor. Etiam in felis.</strong></p>
    <p><strong><em>Pellentesque id erat. Mauris condimentum pharetra nibh. Fusce sollicitudin auctor tortor. Aliquam placerat,</em></strong></p>
  </div>
</div>

I like the way that looks: clean and simple. You can even use this in in a Word­Press tem­plate with PHP tags included and every­thing still works. This is what is actu­ally coded into one of my Word­Press tem­plate files:

<div class="multicolumn">
  <div>
    <?php ggc_the_long_excerpt(); ?>
    <p class="readmore"><a href="<?php the_permalink() ?>" rel="bookmark" title="Continue Reading <?php the_title_attribute(); ?>">Read More &raquo;</a></p>
  </div>
</div>

My favorite part is what hap­pens when Javascript is not avail­able. In my case, the page still works fine and no con­tent is lost. Sure, there are some rather long line lengths, but every­thing still works.