February 23, 2010 A Neat, Subtle Archives Widget

Update: I’ve removed the archives widget in favor of a dedicated page/section. The widget was a fun experiment, but never really worked the way I wanted it to. I’m leaving this article up for posterity and so others can still use and adapt the widget if they so desire.


You may have noticed I rearranged some elements of Geek & Mild over the weekend. Or maybe you didn’t.

The biggest change is the location of the archives widget timeline thing, which I moved to the opposite side of the window. The reasoning has to do with Fitt’s law and the widget sharing vicinity with the browser scrollbar. I was never comfortable with how close the two interface elements were.

I’m still unsure if the widget works for its purpose, but since I haven’t gotten any particularly negative feedback about it, I figure it must do its job adequately.

The widget itself — the code, I mean — is so simple I thought I’d share it.

The HTML (plus ExpressionEngine)

<ul id="archives">
    <li id="now"><a href="/"><span>Now</span></a></li>
    {exp:weblog:month_links}
    <li id="a{year}-{month_num}"><a href="{path=index}"><span>{month} {year}</span></a></li>
    {/exp:weblog:month_links}
</ul>

The CSS

#archives {
    position: absolute;
    top: 185px;
    left: 0;
    width: 75px;
    margin: -20px 0;
    padding: 20px 0 20px 0;
    overflow: hidden;
    list-style: none;
    font: bold 10px/1 ‘helvetica neue’, helvetica, sans-serif;
    text-transform: uppercase;
    list-style: none;
    z-index: 2;
}

#archives:hover {
    width: 150px;
}

#archives li {
    margin-left: -120px;
}

#archives:hover li {
    margin-left: -10px;
}

#archives li a {
    display: block;
    position: relative;
    width: 120px;
    height: 6px;
    margin: 0 0 4px;
    padding: 0 4px;
    text-align: right;
    color: #ededed;
    background: #ccc;
    border: none;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
}


#archives li a:hover {
    height: 10px;
    margin: -4px 0 0;
    padding: 2px 4px;
    color: #ededed;
    background: #222;
    z-index: 2;
}

#archives li a span {
    visibility: hidden;
}

#archives li a:hover span {
    visibility: visible;
}

Then I stick this in the &lt;head&gt; of the index page:

{if segment_1 != "entry" && segment_1 != ""}
    #archives #a{segment_2}-{segment_3} a {
        width: 130px;
        margin-left: -5px;
        background: #222;
    }
{if:else}
    #archives #now a {
        width: 130px;
        margin-left: -5px;
        background: #222;
    }
{/if}

There you have it. Feel free to reuse and repurpose the widget for your own project or website. Let me know if you do, I’d love to see how it’s adapted.

(Thanks to Coda for the code formatting via ‘copy-as-XHTML’ function!)

7 Comments



February 23, 2010 RIP iPod

Here’s why I think the introduction of the iPad spells certain doom for the iPod line of products: Apple ‘skates to where the puck is going to be’. Meaning the touch OS is the future of mobile computing, and despite the iPod’s success, future mobile devices from Apple are not going to be running the iPod software.

One reason for this is there’s really no one at Apple championing the iPod anymore. Ever since Tony Fadell stepped down as VP of the iPod Division (remember Fadell took over the job from Jon Rubinstein, who’s now at Palm) we’ve seen very little advancement in the product line. Certainly the evolution of the iPod has slowed over the last 18 or so months.

Perhaps better support for my prediction, though, is Apple’s history of replacing their own successful products with newer or different models, even at the height of their popularity. They did it with the iMac, iPod Mini, original Nano, etc. Apple rarely leaves a product on the market long enough for it to become stale.

There’s also the marketing perspective. Killing the iPod is a genius move. After all, it is one of the most decorated consumer electronic devices of the last decade. What the iPod represents culturally might even outweigh what it represents technologically. Killing it would create a virtual black hole of headlines.

From the consumer’s perspective, I don’t see a compelling reason to keep the iPod around. If presented with the option of either an iPod Classic or Nano model or a touch OS device for the same price, I suspect 19 out of 20 people would select the Touch.

(And before you race to the comment box to remind me that iPods are great for exercising or that your 49TB music collection won’t fit on an iPod Touch, let me just ask one question: what’s stopping Apple from making a ‘Touch Shuffle’, or a higher-capacity/HDD-based version of the Touch? Just because those product don’t exist today doesn’t mean they won’t be introduced in September, in time for the Holiday lineup. Plus, those segments of users are fringe, not median.)

But there’s another reason Apple would want to do this that seems so obvious to me. Doesn’t it make sense for Apple to kill the iPod to force people to upgrade to the touch OS? Think about it. The only iPod able to purchase and download content direct from the iTunes Store is the Touch. The touch OS represents opportunity for continued profit like no other Apple product. Where you might have one or two Macs in a household, it’s not unrealistic to think every member of that same home could own a touch OS device — maybe even two. Business-wise, there’s a lot to be gained from the death of the iPod. Why wouldn’t they kill it? Sentiment?

Really, it’s not that bold to say the iPod’s days are numbered. Even my prediction of 1-3 years seems a bit conservative. Especially if you know how Apple thinks: different.

19 Comments