Archive for October, 2011

How To Create Tabs On WordPress Settings Pages





 



 


Using tabs in a user interface can help you better organize content, so it’s only natural that WordPress themes that have a lot of options would benefit from tabs on their settings page. In this tutorial, you will learn how to create a tabbed settings page, and you’ll get to download a WordPress theme that implements the code.

tabbed-theme-settings-wordpress

Overview

To get a quick grasp of the tabs we’ll be creating, go to Appearance/Themes in the WordPress admin area. You will find two tabs there: “Manage Themes� and “Install Themes.� When you click on one, the content changes and the tab’s title is highlighted.

The process is actually fairly simple: we set and send a tab variable when a tab is clicked. By querying this tab variable later, in $_GET['tab'], we will know which tab was selected so that we can highlight the corresponding title and display the corresponding tab.

In our approach, there are three times when we will need to know which tab the user is currently on:

  1. When we initially display the tabs and the form fields for the settings (in order to display the correct set of fields);
  2. When the user saves their settings (in order to save the correct fields);
  3. When redirecting the user after they have saved their settings (in order to redirect the user to the correct tab).

For the sake of brevity, we won’t explain all of the code, only the snippets that are relevant to this approach. You can, however, find all of the code in the accompanying theme.

Creating The Tabs

The first snippet we will inspect is the code that produces the tabs:

function ilc_admin_tabs( $current = 'homepage' ) {
    $tabs = array( 'homepage' => 'Home Settings', 'general' => 'General', 'footer' => 'Footer' );
    echo '<div id="icon-themes" class="icon32"><br></div>';
    echo '<h2 class="nav-tab-wrapper">';
    foreach( $tabs as $tab => $name ){
        $class = ( $tab == $current ) ? ' nav-tab-active' : '';
        echo "<a class='nav-tab$class' href='?page=theme-settings&tab=$tab'>$name</a>";

    }
    echo '</h2>';
}

This function will be called later in the content for the settings page. We first define an array that contains all of our tabs. The first tab, which is displayed first by default, is homepage, where we can set up some option for the appearance of the home page. Then we have general, which could be a page containing options used throughout the website, and, finally, footer, to include a tracking code in the footer.

We then set up the URL links for each tab and output them. Notice that if the tab is open, an additional class, nav-tab-active, is added.

Displaying The Tabbed Content

The content for the settings page is displayed in the callback function for add_theme_page (which is an abstraction of add_submenu_page, with the parent slug set to themes.php), which in our theme will be named ilc_settings_page. This is where you will call the function that we just went over.

function ilc_settings_page() {
   global $pagenow;
   $settings = get_option( "ilc_theme_settings" );

//generic HTML and code goes here

if ( isset ( $_GET['tab'] ) ) ilc_admin_tabs($_GET['tab']); else ilc_admin_tabs('homepage');

If the tab is the default one, then $_GET['tab'] is not defined, in which case the current tab will be homepage and, thus, the highlighted one. Otherwise, the highlighted tab will be the one defined in $_GET['tab'].

Following the same function, we now need to display the right set of fields. Depending on the value of $tab, we would display the fields for the settings tab for the home page or for one of the other tabs:

<form method="post" action="<?php admin_url( 'themes.php?page=theme-settings' ); ?>">
<?php
wp_nonce_field( "ilc-settings-page" ); 

if ( $pagenow == 'themes.php' && $_GET['page'] == 'theme-settings' ){

   if ( isset ( $_GET['tab'] ) ) $tab = $_GET['tab'];
   else $tab = 'homepage';

   echo '<table class="form-table">';
   switch ( $tab ){
      case 'general' :
         ?>
         <tr>
            <th>Tags with CSS classes:</th>
            <td>
               <input id="ilc_tag_class" name="ilc_tag_class" type="checkbox" <?php if ( $settings["ilc_tag_class"] ) echo 'checked="checked"'; ?> value="true" />
               <label for="ilc_tag_class">Checking this will output each post tag with a specific CSS class based on its slug.</label>
            </td>
         </tr>
         <?php
      break;
      case 'footer' :
         ?>
         <tr>
            <th><label for="ilc_ga">Insert tracking code:</label></th>
            <td>
               Enter your Google Analytics tracking code:
               <textarea id="ilc_ga" name="ilc_ga" cols="60" rows="5"><?php echo esc_html( stripslashes( $settings["ilc_ga"] ) ); ?></textarea><br />

            </td>
         </tr>
         <?php
      break;
      case 'homepage' :
         ?>
         <tr>
            <th><label for="ilc_intro">Introduction</label></th>
            <td>
               Enter the introductory text for the home page:
               <textarea id="ilc_intro" name="ilc_intro" cols="60" rows="5" ><?php echo esc_html( stripslashes( $settings["ilc_intro"] ) ); ?></textarea>
            </td>
         </tr>
         <?php
      break;
   }
   echo '</table>';
}

?>
   <p class="submit" style="clear: both;">
      <input type="submit" name="Submit"  class="button-primary" value="Update Settings" />
      <input type="hidden" name="ilc-settings-submit" value="Y" />
   </p>
</form>

All of the settings will be stored in a single array in order to prevent several queries from being made.

Saving The Tabbed Fields

Now we need to know which slots of the array to save. Depending on the tab being displayed, certain options stored in the settings array will be displayed. If we just save all of the array slots, then we would overwrite some of the positions not shown in the current tab and thus not meant to be saved.

function ilc_save_theme_settings() {
   global $pagenow;
   $settings = get_option( "ilc_theme_settings" );

   if ( $pagenow == 'themes.php' && $_GET['page'] == 'theme-settings' ){
      if ( isset ( $_GET['tab'] ) )
           $tab = $_GET['tab'];
       else
           $tab = 'homepage';

       switch ( $tab ){
           case 'general' :
         $settings['ilc_tag_class'] = $_POST['ilc_tag_class'];
      break;
           case 'footer' :
         $settings['ilc_ga'] = $_POST['ilc_ga'];
      break;
      case 'homepage' :
         $settings['ilc_intro'] = $_POST['ilc_intro'];
      break;
       }
   }
   //code to filter html goes here
   $updated = update_option( "ilc_theme_settings", $settings );
}

We’ve used a switch conditional again to query the value of $tab and store the right values in the array. After that, we’ve updated the option in the WordPress database.

Redirecting The User To The Right Tab

Now that the contents are saved, we need WordPress to redirect the user back to the appropriate tab on the settings page.

function ilc_load_settings_page() {
  if ( $_POST["ilc-settings-submit"] == 'Y' ) {
   check_admin_referer( "ilc-settings-page" );
   ilc_save_theme_settings();

   $url_parameters = isset($_GET['tab'])? 'updated=true&tab='.$_GET['tab'] : 'updated=true';
   wp_redirect(admin_url('themes.php?page=theme-settings&'.$url_parameters));
   exit;
  }
}

Depending on whether the $_GET['tab'] variable is set, we use wp_redirect to send the user either to the default tab or to one of the other tabs.

Now our tabs are working, displaying the right set of fields, saving the right fields, and then redirecting the user to the correct tab.

Download The Theme

Almost any theme with a moderate number of options would benefit from tabs on the settings page. Just remember that this is one approach. Another approach would be to add several collapsable meta boxes, as seen on the page for writing posts, and to automatically collapse the boxes that are not frequently used. However, tabs enable you to better separate each set of options.

Finally, here is the theme, so that you can take a closer look:

The theme also implements the function whereby each tag is outputted with a unique CSS class, so you can check that out, too.

(al)


© Elio Rivero for Smashing Magazine, 2011.


Please provide a usable fallback for Flash content

Since uninstalling Flash I’ve noticed how common it is for sites that still use Flash to pay little or no attention to visitors that do not have Flash Player installed. Showing a “Missing plugin� message instead of navigation links or even worse, the entire site, is an efficient way of turning people away.

There used to be a time when “everybody� had Flash player installed. These days there are many millions of iOS users that don’t. Apple does not include Flash Player with new Macs anymore (neither is it included with OS X 10.7 Lion). And then there are people who block Flash with browser extensions or uninstall it completely.

Read full post

Posted in , .

Copyright © Roger Johansson



Comprehensive Review Of Usability And User Experience Testing Tools





 



 


Usability and user experience testing is vital to creating a successful website, and only more so if it’s an e-commerce website, a complex app or another website for which there’s a definite ROI. And running your own user tests to find out how users are interacting with your website and where problems might arise is completely possible.

But using one of the many existing tools and services for user testing is a lot easier than creating your own. Free, freemium and premium tools are out there, with options for most budgets. The important thing is to find a tool or service that works for your website and then use it to gather real-world data on what works and what doesn’t, rather than relying purely on instinct or abstract theories.

Free And Freemium Tools

A ton of free and freemium tools are out there to test your website’s usability and user experience. Many of them get you to use your existing visitors as a testing base, which can give you a very accurate picture of what users are experiencing when they use you website.

Ethnio
Ethnio enables you to intercept visitors on your website and recruit them to help you with research (you can offer incentives to make participation more enticing). Ethnio acts as a hub for your various UX tools, including Usabilla, Optimal Workshop and UserTesting.com. It even works with GoToMeeting for screen-sharing. You’ll get detailed reports on the people who respond to your recruitment efforts. Ethnio has a free plan that allows for up to 10,000 page views per month and up to 250 responses. Paid packages start at $49 per month (for up to 100,000 page views and 500 responses) and go up to $299 per month (for over 1 million page views per month and unlimited responses plus other features).

Simple Mouse Tracking
Mouse tracking is a great way to see how visitors are actually interacting with your website. This plugin lets you record mouse activity on your Web pages and then replay that activity in real time. It works in virtually all modern and not-so-modern browsers, it works with static and liquid layouts, and it is customizable by the end user.

xSort
xSort is a card-sorting application for Mac OS X. It gives you full control over the exercise, supports sub-groups, gives statistical results in real time, and lets you create, read, print and export reports easily. The visual environment of the app resembles a table with cards (and you also get an outline view).

KISSinsights
KISSinsights lets you embed surveys directly on your website. The free plan offers an unlimited number of surveys, with up to 30 responses for each one. The premium plan, at $29 per month, allows you to customize the surveys and thank-you messages, removes KISSinsights’ branding, and allows for unlimited responses.

FiveSecondTest
FiveSecondTest helps you better design your landing pages and calls to action by analyzing which elements of your design are most prominent. Just upload a screenshot or mockup, set the questions that you want answered, and then wait for users to complete the test. FiveSecondTest collects the responses for you and analyzes them for common keywords, which it then represents visually. The free community plan lets you earn tests by participating in tests run by others. Paid plans start at $20 per month with more features, including private tests.

AddUse
AddUse enables you to conduct user surveys and user tests. You get one of each for free, and then can purchase additional surveys and tests from there. Signing up is quick and easy and doesn’t require a credit card. AddUse offers real-time results and analysis, and also includes ready-to-use usability questions that you can incorporate in your surveys for faster set-up.

UserEcho
UserEcho is a simple widget for collecting customer responses and ideas. Just copy and paste a few lines of code onto your website and then wait for visitors to respond. The free plan offers one forum and one official representative, as well as simple moderation, admin control, rich-content editing and YouTube embedding. Paid plans start at $15 per month and include more forums, more representatives and more features.

Usabilla
Usabilla lets you run micro-usability tests to get a better picture of how well your website performs with visitors. You can collect feedback, discover usability issues, measure how various tasks perform, and then get visual results. The free plan lets you run one public, active test at a time with up to 10 participants. Paid plans start at $49 per month, allowing you to create private tests with up to 50 participants, and go up to $199 a month (allowing up to 10 active tests at a time and up to 250 participants).

Google Website Optimizer
Google’s free Website Optimizer lets you run A/B and multivariate tests on your website. Just sign up with your Google account and create an experiment. You can specify which page you’d like to test and which sections of the page, and then identify your conversion and success targets. Setting up experiments is a straightforward process.

Google Website Optimizer

Userfly
Userfly lets you watch videos of users interacting with your website. Just install a single line of code, and it will record every mouse movement and click that users make. The free plan allows up to 10 captures per month and stores recordings for 30 days, while premium plans (ranging in price from $10 to $200 per month) allow for more captures and downloadable recordings.

Clickdensity
Clickdensity is a heat-map analytics tool that installs in under five minutes. It provides heat maps, click maps and hover maps and gives you real-time results. The trial version can be installed on a single page and stores up to 5,000 clicks. Premium plans start at £2.50 per month, and all include an unlimited number of pages.

Navflow
Navflow is a tool for analyzing the conversion paths for your mockups and wireframes. Just upload the designs that you would like to test, run a private or public test, and then view the results. The free plan allows you to earn public tests by participating in tests run by others. Paid plans start at $20 a month and allow you to run unlimited private and public tests.

User Plus
User Plus offers two tools for testing your website’s usability: Tester and Advisor. Tester lets you test the important tasks on your website with real people. Just create a test, invite users and then measure and see what they do. Advisor evaluates your website’s usability based on ISO standards and gives you a usability score. Tester is currently in private beta, and for a limited time you can try it for free. Advisor offers both free and paid plans.

Chalkmark
Chalkmark is for first-click testing, to see what visitors click on first on your website. It’s a simple concept, but vital to ensuring that your website is converting well. A free plan is available for running short surveys on a trial basis before you buy. The free plan lets you survey 10 people, with 3 tasks each. Paid plans include unlimited studies, unlimited tasks, unlimited questionnaires and unlimited participant responses.

4Q
4Q is an online survey tool for evaluating user experience and customer satisfaction. Setting it up takes less than five minutes, and the intuitive suite of online tools gives you valuable insight into how visitors are interacting with your website with only a few mouse clicks. A free plan is available that lets you collect responses from up to 100 participants. Paid plans start at $19 per month and include more features and more responses.

WebSort.net
WebSort.net is a remote card-sorting application. Just create a study, send the link to participants, and wait for the results. You can create a free study with up to 10 participants. Then upgrade whenever you want to include 100 participants or more (starting at $149 per test). You can also buy a three-pack of studies for $299; or buy an enterprise license, with unlimited tests in a 12-month period for $2,499.

Concept Feedback
Concept Feedback lets you get feedback on your website so that you can increase conversion rates. Just post your website, get expert feedback from experienced design, usability and strategy pros, and then share the evaluation with your team or client. You can pay to have experts review your website ($99 per expert), or just get feedback from the community for free.

Premium Tools

Vendors of premium testing tools generally recruit users specifically to offer feedback on your website. Many of the tools come with videos of users interacting with your website, and some offer both remote and local testing.

WhatUsersDo
WhatUsersDo lets you test the user experience of virtually any part of your website. Just set tasks for users to carry out on your website, and then watch and listen to recordings of everything they do and say. Setting up a test takes less than five minutes, and results are available within 48 hours. Pricing is a flat fee of £30 per user, and five users are recommended for each test.

TryMyUI
TryMyUI lets you test your website with real users and watch videos of them using your website. You get to see all of their mouse movements and keystrokes and hear everything they say about your website. Users also provide written answers to your questions. A free trial is available, and the regular price is $35 per test.

Userlytics
Userlytics is a full-featured testing service that guides you through the entire testing process, from designing the study to scheduling tests, managing logistics and incentivizing participation. Pricing starts as low as $59 per participant but goes lower with volume discounts. You’ll also get videos of participants interacting with your website for accurate results.

OpenHallway
With OpenHallway, you create test scenarios, record users either remotely or locally, and then watch video results from your browser. You can share videos with clients or team members, and an unlimited number of projects and test scenarios are allowed within your storage limit. You can try OpenHallway for free, with a test scenario and up to three 10-minute user videos. Regular plans start at $49 per month, which allows for up to 1 GB of storage (3 hours of video), and go up to $199 per month for 9 GB of storage (30 hours of video) and downloadable test results.

GazeHawk
GazeHawk runs eye-tracking studies on any image or website. It offers targeted or general user studies, depending on your needs. The starter plan, which includes a 10-participant study with heat maps and gaze replays, is $495. GazeHawk also offer A/B testing packages ($995 for two 10-participant studies), a professional package with 20 participants for $995, and enterprise solutions for bigger tests.

Silverback
Silverback is downloadable software for your Mac for running user tests. You can capture screen activity, record video of testers’ faces, record their voices, and control recording with the built-in remote. And it’s all exportable to Quicktime. The app is free for the first 30 days, and the full license is $69.95.

Verify
Verify, from Zurb, includes nine different test types: click, memory, mood, preference, annotate, label, multi-page click, and linked. New user tests can be set up in less than three minutes. You can share tests with team members or make them public, and visual reports are included to make decision-making easier. The “Plus� plan is $9 per month and includes unlimited tests, while the “Premium� plan includes demographics reports, linked tests and PDF export. A 30-day free trial is available on all accounts.

Feedback Army
Feedback Army offers cheap and simple usability testing for your website. You can set up a new test in two minutes, submit a question about your website, and get 10 responses from Feedback Army reviewers. And it all costs only $15.

UserTesting.com
For $39, UserTesting.com provides you with video of a visitor as they use your website, speaking their thoughts about their experience. You also get a written summary of the problems they encountered while on the website. Videos are generally about 15 minutes long and can be downloaded for archiving and editing (even embedded on a Web page).

IntuitionHQ
IntuitionHQ lets you sign up and start creating tests for free. Pay only once you start actually running tests (and then it’s only $9 per test). Creating a test simply requires that you upload screenshots and then write tasks for users to complete. Once the test is created and published, you get a URL to share with whoever you want to perform the tests.

Mechanical Turk
While not strictly a usability testing app, Amazon’s Mechanical Turk service can be used to gather usability data or feedback from real users. Just set up a “HIT� (human-intelligence task), and then set how much you’re willing to pay people to perform it. You pay only when you’re satisfied with the results.

UserFeel.com
UserFeel.com performs remote usability tests for you, providing videos of users testing your website. Just specify the website that you want to test, set the scenario and tasks, and then watch the videos. Pricing is $39 or less per test, with a 90-day money-back guarantee.

Loop11
Loop11 offers user testing for up to 1000 participants at a time, with an unlimited number of tasks and questions. There’s no time limit and no limit on the number of websites or wireframes you can test. Try Loop11 for free (with a maximum of five tasks and two questions, with data stored for only seven days); after that, tests are $350 each. Tests don’t require any code to be added to the website being tested, which means you can even test competitors’ websites.

ClickTale
ClickTale offers a number of usability testing services, including visitor recordings, click heat maps, mouse movement heat maps, and conversion funnel visualizations. Premium plans start at $99 per month, with full playback and a choice of three out of the four heat maps offered, while other plans (at $290 and $990 per month) include more features. A limited free plan is available to try out the service, as well as enterprise options.

CrazyEgg
CrazyEgg offers heat maps so that you can see exactly how users interact with your website and so increase your sales or leads. In addition to standard heat maps, CrazyEgg also offers scroll maps, confetti (which allows you to distinguish between all of the clicks your website gets, broken down by referral source, search term and other variables), and overlay reports. The basic plan is only $9 a month and includes 10,000 visits per month, up to 10 active pages, and daily reporting. Starting with the “Plus� plan, which is $49 a month, you get hourly reporting.

Webnographer
Webnographer provides remote usability testing services. You can test websites, Web apps, prototypes and intranets with a large number of users anywhere in the world. The tests are unmoderated, so you get honest feedback. And no downloads or website modifications are required to run tests. Pricing is available on request.

Regardless of which tool you choose, the important thing is to recognize the value of user testing. Getting real feedback is an invaluable way to determine which parts of your design work and which don’t. With that information, creating a more user-friendly website that converts better is possible. Usability and user experience testing should be a part of any website redesign project, to ensure that the changes being made will actually have a positive effect.

To streamline the selection process, below is a chart with the key features of each tool, as well as pricing information.

Service Cost Tests existing or new users? Type of testing Visual reporting?
Ethnio $0 – $299 per month Existing Surveys (a hub for other testing services) Detailed reports
Simple Mouse Tracking Free Existing Mouse tracking Yes
xSort Free Both Card-sorting Yes
KISSinsights $0 – $29 per month Existing Surveys No
FiveSecondTest $0 – $200 per month New Visual questionnaires No
AddUse $0 – $99, depending on number of tests Existing Surveys and user tests Somewhat
UserEcho $0 – $256 per month Existing Surveys Somewhat
Usabilla $0 – $199 per month Existing Micro-usability Yes
Google Website Optimizer Free Existing A/B and multivariate tests No
Userfly $0 – $200 per month Existing Mouse clicks and movement recording Yes (video)
Clickdensity $0 – $400 per month Existing Heat maps Yes
Navflow $0 – $200 per month New User paths Yes
User Plus $0 – $35+ per month Both User testing and usability scoring Yes
Chalkmark $0 – $109 per month Existing First clicks Yes
4Q $0 – $399 per month Existing Surveys Yes
WebSort.net $0 – $2,499 per year Both Card-sorting Yes
Concept Feedback Free for community feedback, $99 per expert New Expert and community feedback Yes
WhatUsersDo £30 per user New General usability Yes
TryMyUI $35 per test New General usability Yes
Userlytics $59 per participant New General usability Yes
OpenHallway $49 – $199 per month Both General usability Yes
GazeHawk $495 – $995+ per test New General usability, including heat maps Yes
Silverback $69.95 Both General usability Yes
Verify $9 – $29 per month Existing Nine types of usability tests Yes
Feedback Army $20 per test New Surveys No
UserTesting.com $39 per user New General usability Yes
IntuitionHQ $9 per test Both Screenshot surveys, including A/B tests Yes
Mechanical Turk Varies New Surveys No
UserFeel.com $39 per test New General usability Yes
Loop11 $350 per project Both General usability Yes
ClickTale $99 – $990 per month Existing Heat maps Yes
Crazy Egg $9 – $99 per month Existing Heat maps Yes
Webnographer Unknown New General usability Unknown

(al)


© Cameron Chapman for Smashing Magazine, 2011.


Designer Spotlight: Interview with MoGraph & Branding Designer Fraser Davidson


  

Today we have a new designer spotlight, where we interview and feature a member of the design and development community. In this installment, we shine that light on talented motion graphic designer and sports branding specialist Fraser Davidson. If you are not familiar with his work, then you are in for quite a treat (and just might find that you have seen some of his designs around the web before.

In his own words, Fraser is:

“An award winning London based, freelance Motion Graphic Designer, Animator and Director. He was previously Head of Motion Graphics at Mainframe, a Motion Graphics, VFX & Animation House.

Graduating from Nottingham Trent University with a BA in Graphic Design, Fraser has six years experience creating advertising, music videos and channel branding across many media. Fraser has had his work featured in a number of publications and has collected three International Promax Awards.

He is the writer and director of the multi-award winning Youtube series ‘The Alternative Rugby Commentary’ and has collaborated on projects with Australian comedian, Tim Minchin. These include animated short, ‘Popesong’ and the BAFTA nominated animation for his nine minute beat poem ‘Storm’. Directed by DC Turner and Produced by Tracy King”.

In Our Words:

Fraser is like a force to be reckoned with. His work absolutely screams creative overflow! With his intense and near flawless design work in the sports field, to his deft, imaginative animation and motion graphics designs that are executed with such precision and skill, Davidson’s portfolio is simply stunning to behold. Below, interspersed throughout the interview are some of Fraser’s skillfully crafted pieces.

The Interview

Thanks again for agreeing and taking the time to answer these questions. So Fraser, what got you first interested in the motion graphics game?

Well, I studied graphic design at University. I found after two years on the course that I didn’t really enjoy the emphasis on what I considered to be the mundane aspects of design. I wasn’t that into the nuances of type layout, grids and high concept stuff. I happened to stumble upon the After Effects section of the course (web design was full) and got sucked in from there. I self taught and spent the rest of the course bending projects to my purposes. I got a job with Mainframe in London shortly after leaving university and was lucky enough to work with some of the best in the business. Mainframe has since spawned several great companies including key components of Man vs Machine, The Found Collective, Beautiful TV and several more.

WRU In Stadium Animation from Fraser Davidson on Vimeo.

This is a project for the Welsh Rugby Union. Fraser was the Live Action Director/ Animator/ Compositor

Branding is a delicate, very involved process, how did you first become interested
in this area of design?

I’m not convinced it is that delicate an art to be honest, and I certainly don’t feel that way about my own work. I enjoy branding as it gives you a chance to be quite gestural with your marks. You only really need one good idea. This helps as I tend to avoid good ideas on the whole.

Your work in branding focuses on the sports field. Is this a niche you came to focus on as you saw a need there, or were you drawn there as a fan? Or was it a bit of both?

Well, I had a fairly brief career in rugby before starting in design. I’ve always been drawn to the contact sports, and since a young age was interested in the symbolism and the visual derivation of logos and team colours. Theres a real tribal nature that comes with sport branding, there are very few other industries in which consumers/ fans feel such a connection with a brand or logo. The idea that you can create something that people wear as a genuine piece of heraldry, as part of a clan or tribe really appeals to me. Team logos are things Ive drawn virtually my whole life, its just that I have only recently started doing it for a job.

With your work in sports identity, what is your process like? How do you typically get started?

Hmm. Its a good question, but not an easy one to answer verbally. I typically have a rough idea for a feeling or stance of a given animal/vegetable/mineral and kind of work into the detail from there. Its important that logos have movement and the feeling that you have captured a particular attitude or emotion. Once you have that sense of purpose locked down, the rest of it is just tweaking really.

You have worked with some really high profile clients and organizations, is there still some dream client (or team) that you would love to have the opportunity to work for?

Yes, in the last year Ive had the opportunity to work with some great clients and organisations on some really exciting projects. Most of these I cant really share at the moment as they wont be in public domain until next season. But there are hopefully going to be some interesting new looks for a few very big NCAA schools. I guess if I were to be greedy, I’d say that an absolute dream job would be to produce a logo for an NFL franchise.

With your work in motion graphics, how would you describe your process there? When getting started what do you do differently than with your branding work?

The two have very little in common to be honest. A typical logo takes 2-3 hours to put together on average, animation projects can last for months. Its much more technically involved. After the initial creative ideas and bursts, a large part of the job relies very heavily on hours of thankless graft. There is a somewhat pervasive idea that computers make animation a) easy and b) fast. Its still neither, if you do it properly.

On the motion graphics front, you also do art direction and animation. Do you prefer to handle all of these various aspects of a project, or do you have a favorite you’d rather focus on?

On the whole, Its far easier to express your own ideas than it is to express someone else’s. I’ve worked on jobs where ‘creative’ people see you as an extension of their own tool kit and not as a creative person in your own right. It can be quite hard to have someone with no design experience sit next to you and have you shift keyframe velocities about. On the whole I like producing every part of an animation. Except voice overs, there’s a total budgetary minefield.

Tim Minchin Storm Trailer from Fraser Davidson on Vimeo.

This is the preview for the animated short Tim Minchin’s The Storm. Fraser was the animator on for this project.

What are some of your go to tools to work with? What software would you essentially be lost without?

As a mograph designer you will need an extensive working knowledge of Illustrator, Photoshop and After Effects. A 3D program helps a great deal also.

What advice would you give to other motion graphic designers just getting started in the field?

The best design advice I ever received is that you are known for what you do. Seems obvious enough, but the number of people I come across whose jobs involve 3D compositing, who would far rather be creating character animation (or vice versa) is crazy. The principle point has a that people will not employ you to create work in areas you do not have form in. If you want to design sports logos, start today, get them out there where folk can see them. If you want to get into character animation, start animating shorts in your spare time. Be prolific, don’t be guarded of your design and don’t hide it away. This applies to anyone, not just beginners.

Zappar Sting from Fraser Davidson on Vimeo.

This is a promotional video for a Zappar Branding Project. Here, Fraser was the Animator and Director

What tips would you offer someone who decides to toss their hat into the branding arena?

Practice I guess? Again, I dont mean to seem facetious, but my answer is really the same as above. Do as much of it as you can and get as much feedback as you can. Very few people get worse at something the more they do it.

What would you say are some of the major developments that have helped shape the motion graphics field since you have been in it? What things would you say are on the horizon for the field?

Its really almost been the perfect industry from my perspective. The internet/ youtube/ the viral and all the other content avenues have meant an explosion in the need for video content. When I first started (only 7 years ago) we were still working predominantly in TV branding, there weren’t web budgets like there are now. The certainties of traditional media have disappeared and a guy in his bedroom with a good desktop computer can make anything from film quality vfx to animated cartoon series with millions of viewers. With all the new technology and means to view video, its hard to see where we’ll be in 2 years time. Obviously the resurgence of 3D in films and TV is yet to reach an apex, but I think augmented reality is going to be the next big unexplored vista.


This is a still from a series of videos for The Alternative Rugby Commentary. Fraser was the Animator/Director/Writer for the majority of the promos in this project.

Speaking of the future, do you have any projects in the works that you can share with our readers?

Motion wise, I have a quite original induction video for a large ad agency that’s getting its final renders while I write this. I recently worked with my friends at The Found Collective on a nice piece for the UK Government promoting Britain. Rumour has it that it was to be viewed by the big man from the White House. And I have a nice personal piece that’s overrun by about a year for the awesome British comedic poet Tim Key. They will hopefully all feature on my website in the next few months. Unfortunately I cant really tell you too much about the College rebranding.

Your work reflects the passion of someone who is always having fun. Is this the case, or are you just really good at making look that way?

Ha. I tend to work in frenetic bursts of good humour I think. I’m quite easily distracted, so I often work on a number of projects at once. Hopefully this keeps them looking fresh and fun.

How would you say designing a logo for a sports team or franchise differs from designing a logo for a regular business? In other words, are sports fans more demanding than your average customer in terms of accepting the design?

People don’t send you hate mail if they don’t like the financial services logo you designed. Companies ‘belong’ to the people who own them and if its a good company, the people that work there. Teams and their logos ‘belong’ to fans. People might wear Nike/ Diesel/ D&G logos because they like the product or associate with the brand. People wear team jerseys for far stronger emotional reasons. They pour far more time and energy into these organisations, the teams are part of who they are. A good team logo should reflect this.

(rb)


Optimizing Long Lists Of Yes/No Values With JavaScript





 



 


Very frequently in Web development (and programming in general), you need to store a long list of boolean values (yes/no, true/false, checked/unchecked… you get the idea) into something that accepts only strings. Maybe it’s because you want to store them in localStorage or in a cookie, or send them through the body of an HTTP request. I’ve needed to do this countless times.

The last time I stumbled on such a case wasn’t with my own code. It was when Christian Heilmann showed me his then new slide deck, with a cool feature where you could toggle the visibility of individual slides in and out of the presentation. On seeing it, I was impressed. Looking more closely, though, I realized that the checkbox states did not persist after the page reloaded. So, someone could spend a long time carefully tweaking their slides, only to accidentally hit F5 or crash their browser, and then — boom! — all their work would be lost. Christian told me that he was already working on storing the checkbox states in localStorage. Then, naturally, we endlessly debated the storage format. That debate inspired me to write this article, to explore the various approaches in depth.

Using An Array

We have two (reasonable) ways to model our data in an array. One is to store true/false values, like so:

[false, true, true, false, false, true, true]

The other is to store an array of 0s and 1s, like so:

[0, 1, 1, 0, 0, 1, 1]

Whichever solution we go with, we will ultimately have to convert it to a string, and then convert it back to an array when it is read. We have two ways to proceed: either with the old Array#join() (or Array#toString()) and String#split(), or with the fancier JSON.stringify() and JSON.parse().

With the JSON way, the code will be somewhat shorter, although it is the JavaScript equivalent of slicing bread with a chainsaw. Not only there is a performance impact in most browsers, but you’re also cutting down browser support quite a bit.

The main drawback of using array-based strings is their size in bytes. If you go with the number method, you would use almost 2 characters per number (or, more precisely, 2N − 1, since you’d need one delimiter per number, except for the last one):

[0, 1, 1, 0, 0, 1, 1].toString().length // 13, for 7 values

So, for 512 numbers, that would be 1023 characters or 2 KB, since JavaScript uses UTF-16. If you go with the boolean method, it’s even worse:

[false, true, true, false, false, true, true].toString().length // 37, also for 7 values

That’s around 5 to 6 characters per value, so 2560 to 3072 characters for 512 numbers (which is 5 to 6 KB). JSON.stringify() even wastes 2 more characters in each case, for the opening and closing brackets, but its advantage is that you get your original value types back with JSON.parse() instead of strings.

Using A String

Using a string saves some space, because no delimiters are involved. For example, if you go with the number approach and store strings like '01001101010111', you are essentially storing one character per value, which is 100% better than the better of the two previous approaches. You can then get the values into an array by using String#split:

'01001101010111'.split(''); // ['0','1','0','0','1','1','0','1','0','1','0','1','1','1']

Or you could just loop over the string using string.charAt(i) — or even the string indexes (string[i]), if you don’t care about older browsers.

Using Bitfields

Did the previous method make you think of binary numbers? It’s not just you. The concept of bitfields is quite popular in other programming languages, but not so much in JavaScript. In a nutshell, bitfields are used to pack a lot of boolean values into the bits of the boolean representation of a number. For example, if you have eight values (true, false, false, true, false, true, true, false), the number would be 10010110 in binary; so, 150 in decimal and 96 in hex. That’s 2 characters instead of 8, so 75% saved. In general, 1 digit in the hex representation corresponds to exactly 4 bits. (That’s because 16 = 24. In general, in a base2n system, you can pack n bits into every base2n digit.) So, we weren’t lucky with that 75%; it’s always that much.

Thus, instead of storing that string as a string and using 1 character per value, we can be smarter and convert it to a (hex) number first. How do we do that? It’s no more than a line of code:

parseInt('10010110', 2).toString(16); // returns '96'

And how do we read it back? That’s just as simple:

parseInt('96', 16).toString(2); // returns  '10010110'

From this point on, we can follow the same process as the previous method to loop over the values and do something useful with them.

Can We Do Better?

In fact, we can! Why convert it to a hex (base 16) number, which uses only 6 of the 26 alphabet letters? The Number#toString() method allows us to go up to base 36 (throwing a RangeError for >= 37), which effectively uses all letters in the alphabet, all the way up to z! This way, we can have a compression of up to 6 characters for 32 values, which means saving up to 81.25% compared to the plain string method! And the code is just as simple:

parseInt( '1001011000', 2).toString(36); // returns 'go' (instead of '258', which would be the hex version)
parseInt('go', 36).toString(2); // returns  '1001011000'

For some of you, this will be enough. But I can almost hear the more inquisitive minds out there shouting, “But we have capital letters, we have other symbols, we are still not using strings to their full potential!� And you’d be right. There is a reason why every time you open a binary file in a text editor, you get weird symbols mixed with numbers, uppercase letters, lowercase letters and whatnot. Every character in an UTF-16 string is a 2 bytes (16 bits), which means that if we use the right compression algorithm, we should be able to store 16 yes/no values in it (saving 93.75% from the string method).

The problem is that JavaScript doesn’t offer a built-in way to do that, so the code becomes a bit more complicated.

Packing 8 Values Into One Character

You can use String.fromCharCode to get the individual characters. It accepts a numerical value of up to 65,535 and returns a character (and for values greater than that, it returns an empty string).

So, we have to split our string into chunks of 16 characters in size. We can do that through .match(/.{1,16}/g). To sum up, the full solution would look like this:

function pack(/* string */ values) {
    var chunks = values.match(/.{1,16}/g), packed = '';
    for (var i=0; i < chunks.length; i++) {
        packed += String.fromCharCode(parseInt(chunks[i], 2));
    }
    return packed;
}

function unpack(/* string */ packed) {
    var values = '';
    for (var i=0; i < packed.length; i++) {
        values += packed.charCodeAt(i).toString(2);
    }
    return values;
}

It wasn’t that hard, was it?

With these few lines of code, you can pack the aforementioned 512 values into — drum roll, please — 32 characters (64 bytes)!

Quite an improvement over our original 2 KB (with the array method), isn’t it?

Limitations

Numbers in JavaScript have limits. For the methods discussed here that involve an intermediate state of converting to a number, the limit appears to be 1023 yes/no values, because parseInt('1111…1111', 2) returns Infinity when the number of aces is bigger than 1023. This limit does not apply to the last method, because we’re only converting blocks of bits instead of the whole thing. And, of course, it doesn’t apply to the first two methods (array and string) because they don’t involve packing the values into an integer.

“I Think You Took It A Bit Too Far�

This might be overkill for some cases. But it will definitely come in handy when you want to store a lot of boolean values in any limited space that can only store strings. And no optimization is overkill for things that go through the wire frequently. For example, cookies are sent on every single request, so they should be as tiny as possible. Another use case would be online multiplayer games, for which response times should be lightning-fast, otherwise the games wouldn’t be fun.

And even if this kind of optimization isn’t your thing, I hope you’ve found the thought process and the code involved educational.

(al)

Thanks to Eli Grey and Jonas Wagner for their advice and corrections

Image on front page created by Ruiwen Chua.


© Lea Verou for Smashing Magazine, 2011.


  •   
  • Copyright © 1996-2010 BlogmyQuery - BMQ. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress