The iTunes Expanding Album Effect

iTunes 11 marks a significant departure from previous versions. While many of the changes are problematic (another post for another time), I want to focus on one positive: the expanding album effect.

Similar to folders in iOS, this effect lets users to scan a list of items and open one up in place. This has advantages over more traditional pop-up windows and mode changes, which can obscure content and cause the user to lose their place in the list.

iTunes 11

A second aspect of this feature is that it uses content to enhance the chrome. In the detailed view, the background and text colors are generated algorithmically from album art. This not only serves a practical purpose in making the detailed view stand out from the list, but creates a nice (in most cases) aesthetic effect and a sense of feeling that differentiates one album from the next. The intrepid Seth Thompson and Wade Cosgrove have already recreated this, using Mathematica and Cocoa respectively. Apple’s algorithm, it turns out, is pretty sophisticated.

Here’s my take, using HTML, CSS, and Javascript.

Expanding Albums Demo

And you can check it out for yourself here:

Details

The demo is built with App Folders, with behavior and style modified to mimic iTunes. Color Thief is used to derive colors on-the-fly from album art using a median cut algorithm. On top of this, I selected colors for acceptable contrast by converting RGB to YIQ, a color space that better reflects human perceptions. Last but not least, Mustache is used to pull album data from a JSON file into templates.

I got to play with several exciting HTML5 and CSS3 properties in making this demo, including text-overflow, multi-columns, transitions, animations, and canvas. Unfortunately, this means the demo requires a modern browser. The future can’t come fast enough.

24 comments Write a comment

  1. Excellent technique and implementation Thomas! The effect works for me in: Chrome 25.0.1359 [Canary], Internet Explorer 10.0.8400, Opera 12.0.2, Opera Next 12.10 [beta] build 1644, Firefox 17.01, Pale Moon 15.3.2 — in case you were wondering about support in current browsers.

    and thanks for the tip re: color thief and the YIQ ‘color space’

    …Rodney

  2. I save your demo page in my computer. But If I open in my browser and clic in any album, the browser send me to your website.
    And if I change the url code:
    <a href=”http://thomaspark.me/project/expandingalbums/#” rel=”nofollow”>

    for this:
    <a href=”http://mysite/#” rel=”nofollow”>

    It is no working.
    I hope you can help me.
    Thanks a lot. Manuel

  3. Hello, firstable, wonderfull work. The demo works perfectly for me.

    I want to use this plugin on my website (can I? of course, will put a link ;) ) to show a gallery. I have some knowledge on JS but i’m not really good. It is possible to delete the color-thief and set a triangle and just one color for everything? Also want to delete the tracklist and put informations about my image in div or anything else.

    It is really complicated to do for a beginner?
    Sorry for my english and thanks again!

    Benoit, FR

      • Hi Thomas, thanks for the reply. Will have a closer look into it then :) love that you can link directly to an album, simply amazing!

  4. Hey Thomas, great work!

    This is the kind of thing I had hoped people would build when I created App-Folders in the first place.

    I’ve worked some of your changes into the latest commit, including a new option to “instaSwitch” which folder is active at the moment.

    • Hey Stephen, thanks for stopping by, and awesome job on your App Folders plugin. Cool to see some of my changes make their way into your project!

  5. @thomaspark VERY NICE WORK!!!

    Is it possible within the folder to add images instead of text or a combination of the two? Thanks

  6. Wow!!! This is awesome!!!
    I’ve just found that I really want!

    I’d like to use this on wordpress. Can you help me how can I put this on the wordpress?
    or Do you have any plan to make WordPress plug in?
    I really use this on my wordpress!!

    • Sadly I don’t have any plans to turn this into a WordPress plugin. But it should be pretty easy if someone wants to take a stab at it.

      • So sad T_T
        If I can make it I will let you know if you don’t mind.
        And Thank you again.
        Have a good day Thomas :)

  7. Great Job… is possible to incorporate , for php and mysql, i wanna take the info from the database, can you help me… sorry for my english

  8. hello this is very well project but i have a problem width J SON data of that
    could you send me a version that built width HTML
    that the DIVS load width HTML codes not from a j son data and the mustache.js script

Leave a Reply


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>