Archive for August, 2012

Learning to Love the Boring Bits of CSS

Learning to Love the Boring Bits of CSS

The future of CSS gives us much to be excited about: On the one hand, there’s a whole range of new methods that are going to revolutionize the way we lay out pages on the web; on the other, there’s a new set of graphical effects that will allow on-the-fly filters and shaders. People love this stuff. Magazines and blogs are full of articles about them.

But if these tools are the show ponies of CSS, then I think it’s time we gave some love to the carthorses: the nuts-and-bolts components of the language, like selectors, units, and functions. I often call these the boring bits, although I say that only with great affection—an affection I think you should share.

To see why, let’s take a quick walk through some of the best of the new boring bits in CSS—the bits being worked on in half-lit laboratories away from the brilliance of the shiny new things in the shop windows. Some of these boring bits have been around for a while but deserve more recognition, while others are just starting to appear in browsers. But they’ll all be revolutionary to the way we work—albeit in humble, unassuming ways.

Relative size units

It’s likely that, as the smart and forward-thinking developer you are, you’ve worked with relative sizing—that is, em units or percentages—so you’ll know this problem: having to use a calculator to work out sizes because of inheritance. For example, it’s pretty common nowadays to set a base font size for your document and then use relative sizing to set your fonts across the rest of the page. In CSS, that probably looks something like this:

html { font-size: 10px; }
p { font-size: 1.4em; }

This is fine, and not a problem at all, until you have a child element you want to set at a different font size. For example, in markup like this:

The cat sat on the <span>mat</span>.

If you want that span to be at a smaller font size, say 1.2em, what do you have to do? Get your calculator out and work out 1.2 divided by 1.4, resulting in this:

p span { font-size: 0.85714em; }

And the problem’s not limited to using em either. If you’re building a fluid site using percentages, you’ll know that the percentage is relative to its container; so if you have an element that you want to be 40 percent of its parent, the length of which is 75 percent, then the width of the element must be set to 53.33333 percent.

Not ideal.

Root-relative lengths

To combat this font-sizing problem, we now have access to the rem (root em) unit. This is still a relative unit, but it’s always relative to a fixed base value, which is the font size of the root element of the document (in HTML, that’s always the html element). Presuming the same root font size of 10px that we used in the preceding example, the CSS rules required for the case at hand are:

p { font-size: 1.4rem; }
p span { font-size: 1.2rem; }

Now both rules are relative to the root font size, which is much more elegant and easy to work with, especially if you have a simple base like 10px or 12px. It’s sort of like going back to using px values again, only scalable.

This is one of the better-supported features in this article; it’s in all modern browsers including IE9, and only absent in Opera Mobile.

Viewport-relative lengths

If you think the rem unit is cool (I do), you’ll be delighted to know there’s also a new set of length units to combat the percentages problem. These work in a similar way to rem, except that they’re relative not to a user-defined value on the document root, but to the dimensions of the device viewport itself.

The two main units are vh and vw, which are relative to the height and width (respectively) of the viewport. Each takes a number as a value, and that number is equal to the same percentage of the specified length. As I still remember the lessons of screenwriting school, let me show that rather than trying to tell it:

div { height: 50vh; }

In this example, the height of the div would be exactly half of the height of the viewport; 1vh = 1 percent of the viewport height, so it stands to reason that 50vh = 50 percent of the viewport height.

As the viewport size changes, so does the value of the unit—but the advantage of this over percentages is that you don’t have to worry about containing elements: an item with a value of 10vw will always be that wide regardless of the width of its parent.

There’s also a vmin unit, which is equal to the smallest of either vh or vw, and it was recently announced that a corresponding vmax unit would be added to the spec (although it hasn’t been at the time of writing).

As of right now these are in IE9+, Chrome, and Safari 6.

Calculated values

When you’re working fluidly and/or responsively, you’ll doubtless come across the problem of mixing units—wanting to have a grid that’s sized in percentages but with fixed margins. For example:

div {
  margin: 0 20px;
  width: 33%; 
}

If your layout only uses padding and border, then you can use box-sizing to help you get around that, but it won’t help you with margins. A better, more flexible approach is to use the calc() value function, which lets you perform mathematical operations with different units, such as:

div {
  margin: 0 20px;
  width: calc(33% - 40px);
}

You’re not limited to using it only on width; you can use it anywhere length values are permitted—and if you want to go really deep down the rabbit hole, you can also use calc() inside calc().

IE9+ has this unprefixed (!), Firefox has it with the -moz- prefix (which should be unprefixed in release 16 or 17), and Chrome and Safari have implemented it with the -webkit- prefix. It doesn't seem to be in mobile WebKit yet, however.

Load a subset of characters

Snappy performance has always been important, but the broad range of mobile devices on the market now—each bringing great variability and uncertainty in connection speed—makes it perhaps even more so. One way to speed up page loading is to keep external file sizes down, which makes a new property for @font-face that aids in doing just that a very welcome addition.

The property in question is unicode-range, and it takes as a value a range of unicode character references. When pulling in external assets, only those specified characters are loaded from the font file, instead of the complete set. This code demonstrates how to load only three characters from the file foo.ttf:

@font-face {
  font-family: foo;
  src: url('foo.ttf');
  unicode-range: U+31-33;
}

This is especially useful if you’re using font icons and only want to show a subset on a given page. In one test I ran, using unicode-range shaved an average 0.85 seconds from the loading time of a font file, which is not insubstantial. Of course, your own mileage may vary.

This property is currently implemented in IE9+ and WebKit browsers like Chrome and Safari.

New pseudo-classes

Units and values are all well and good, but it’s selectors and pseudo-classes that I get particularly excited about. Coming up with a clever selector pattern, even though it’s hidden away where only a hardy few may ever see it, makes me feel like a craftsman. To paraphrase Steve Jobs’ father: you should make the back of the fence look as good as the front even if no one else knows you’ve done it—because you’ll know.

When I first used :nth-of-type() it was a revelation, like I had kicked down the doors of perception. OK, I’m exaggerating a little. But there are a couple of new CSS pseudo-classes that are really worth getting enthused about.

The negation pseudo-class

You probably won’t realize quite how useful the :not() pseudo-class is until you try it. The argument provided to :not() is a simple selector—no compounds. When a list of subjects is being made by a selector that includes :not(), any elements matching the argument will be excluded from that list. I know, that sounds complicated to me, too. But it’s actually quite simple.

Imagine this: you have an item list and you want to apply a rule to all its odd-numbered items, but never the last one in the list. At the moment you’d have to do something like this:

li { color: #00F; }
li:nth-child(odd) { color: #F00; }
li:last-child { color: #00F; } 

With the negation pseudo-class you can exclude the last item from the rule using :last-child as the argument, thus reducing the number of rules by one and making the code a little easier to manage:

li { color: #00F; }
li:nth-child(odd):not(:last-child) { color: #F00; }

It’s nothing groundbreaking, and as I’ve shown already you can work without it—but it’s quite useful. I had the opportunity to use it on a project built with embedded WebKit, and it proved its worth consistently. It’s honestly one of my favorite pseudo-classes.

That’s right, I have favorite pseudo-classes.

This is the most widely implemented of all the features in this article; it’s in IE9+ and all modern browsers, unprefixed. And if you’re familiar with jQuery, you may already be used to using this—it’s been in there since version 1.0, along with the similar not() method.

The matches-any pseudo-class

The :matches() pseudo-class accepts as an argument a simple selector, a compound selector, a comma separated list, or any combination of those items. Great! But what does it do?

It’s most useful for cutting the cruft of multiple selectors. As a use case, imagine you have a bunch of p elements in different containers but you only want to select a few of them; perhaps the style rule you write would look something like this:

.home header p,
.home footer p,
.home aside p {
  color: #F00;
}

With :matches(), you can shorten that considerably by finding the commonalities in the selectors; in our example here all have .home at the start and end in p, so we can use :matches() to aggregate all of the elements in between those. Confusing? Here’s what it looks like:

.home :matches(header,footer,aside) p { color: #F00; }

This is actually part of CSS4 (CSS Selectors Level 4, to be precise), and in the same spec it mentions that you’ll also be able to use the same syntax—comma-separated compound selectors—in future versions of :not(). Exciting!

Today, :matches() is in Chrome and Safari with the -webkit- prefix, and in Firefox under its old name, :any(), with the -moz- prefix.

Do you love the carthorse yet?

The best thing about all the new features in this article is that they solve real-world problems, from the small but annoying repetition of selectors to the new and ongoing challenges of building high-performance responsive sites. In fact, I can imagine using every single one of these features on a regular basis.

New features like filters may have higher visibility, but you’re far more likely to find the ones presented here useful on every one of your builds.

Each of them will make your professional life a little easier while expanding the possibility space of what you can achieve—and there’s nothing boring about that.

Translations:
Italian


RSS readers: Don't forget to join the discussion!


Incredibly Photorealistic 3D Characters


  

Making a realistic and lifelike human character is one of the hardest tasks in 3D graphics. For a long time it was known as the “Holy Grailâ€� among 3D artists in the community. The reason why this skill is so desired, is the possibilities it gives you in the movie or advertising industries. Imagine you could create fully artificial digital actors and make the audience believe they are real. So real that there would be no questioning it. We are all familiar with the best examples out there – Gollum in the Lord of the Rings Trilogy, Davy Jones in the Pirates of the Caribbean or the alien species in Avatar.

There are a vast amount of techniques and tools developed to aid this process. Geometry composed of millions of polygons can be easily molded like clay to form the shape of a character. The 3D model then is linked to skeletal systems that enable artists to animate the body. Complex rendering algorithms calculate how light spreads in the scene to simulate physically accurate shadows and illumination. Shading procedures are then used to compute how textures react when light hits the surface. Rendering engines imitate details of human skin to such an extent that even the scattering of the light under the skin is taken into account.

Above all that, the artist has to convey the personality and make the audience believe that it is a real person. That’s why some 3D characters look so strange – technically all the skin and shading details are correct, but something is lacking in the character. Sometimes the expression is unnatural, or the traits of the face are too perfect. When 3D characters look “almost â€� like actual human beings, it can cause repulsive thoughts, the experience often colloquially said as the uncanny valley.

Anyway, new software and ever growing computing power enables artists to create computer generated characters you would never guess it is not a real photo. Here are 40 of the most interesting and photorealistic 3D characters in the community to date.

Gallery of Characters

Captain Jack Sparrow / Johnny Depp made by ZhiHeng Tang

Portrait of President of Azerbaijan Heydar Aliyev made by Oleg Koreyba

,,The Revolutionary” made by  Kris Kelly

,,Ayco” made by Chris Nichols

,,Bernadette”  by Stephen Molyneaux

,,The Portrait”  made by Luc Bégin

,,Body builder” made by Jian Xu (Tutorial)

Although he looks a bit exaggerated, it was made from a reference of a real bodybuilder Markus Ruhl.

,,Jonas” by Zbynek Kysela

,,Old man” created by  Jin Hee Lee (Tutorial)

,,Portrait attempt” made by Alex Huguet

Korean actress Song Hye Kyo by Max Wahyudi

,,Gunnery Sergeant Thomas Highway” made by Stanislav Klabik (Tutorial)

,,Far and Away” by  Stanislav Klabik

,,Painter ” by RenPeng Dong

,,The Joker ” made by  Max Wahyudi (Making of)

A fan art of a character Joker (actor - Heath Ledger) from the movie Dark Knight.

,,Muriel 2” made by  Mauro Corveloni

,,Young Girl”  made by Viki Yeo (Tutorial)

,,Mursi Tribesman” made by Adam Skutt (Tutorial)

,,Apocalypto’s Middle Eye” made by Peter Zoppi

Close up portrait made by David Moratlla (Tutorial)

,,The Blue Project” self-portrait made by Dan Roarty (Tutorial)

,,An elderly curmudgeon” made by Rokly Wang

,,Hold Hakka Woman” made by Salvatore Ferracane

Portrait of an Old Man made by Tony Reynolds

Varvara made by Denis Tolkishevsky

Sad woman made by Kleber Darcio

Slayer made by Guang Yang

Actor Tommy Lee Jones made by SiYoung Lee

Old woman made by Ivan Ozyumov

Girl elbow stand made by Alexander Tomchuk

Portrait  made by U Ri So

Last Elf made by Piotr Fox Wysock (Making of)

Kid made by Rakesh Sandhu (Tutorial)

Mage made by Joel Mongeon

Chris made by Redragon

Artist Addy Rose made a portrait of her boyfriend in 3D. Here is the tutorial of how she created this image.

“Old Detective” by James Busby

Old man made by Anto Juricic

Pink Amazon Portrait made by Rebeca Puebla

Evil Witch made by  Sven Geruschkat 

Inspired by Disney’s “Snow White and the Seven Dwarfs”

Young Chimp made by Hyejin Moon

Not entirely a human but nonetheless one of the best CG characters of our ancestors.

All For Now

3D technology is evolving so fast that soon digital actors maybe replacing the real ones before too long. When it will be? Only time will tell. Tell us, how many of the images above could you not tell apart from a photo?

(rb)


Coding Q&A With Chris Coyier: Responsive Sprites And Media Query Efficiency


  

Howdy, folks! Welcome to more Smashing Magazine CSS Q&A. It works like this: you send in questions you have about CSS, and at least once a month we’ll pick out the best questions and answer them so that everyone can benefit from the exchange. Your question could be about a very specific problem you’re having, or it could even be a question about a philosophical approach. We’ll take all kinds.

If you’re interested in exploring more Q&A, there’s a bunch more in my author archive.

Resolution Aware Sprites

Joshua Bullock asks:

Your last round of questions was titled “Box-Sizing And CSS Sprites” which offered some great answers for two separate items, but didn’t take them that one step further for responsive design. Ultimately, my question is this: Is there a preferred/suggested way of handling responsive sprites at all for multiple resolutions and image scaling? Is this even possible?

This is a hot topic lately because of the rise in “retina” displays. But really, this problem has been building up for a while. Us Web designers often work in “pixels”, for instance, setting the width of an image: img { width: 100px; }. But what is 100px? It’s been a long time since that literally referenced a pixel on the screen. These days it’s a rather arbitrary measurement. 100px ends up being around an inch on a physical screen, regardless of its resolution.

Retina displays made a really quick and big jump in resolution. Apple’s 27″ Thunderbolt Cinema display has 109 PPI (pixels per inch) while the 15″ Retina MacBook has 220 PPI (literally twice as dense) meaning there are more pixels on the drastically smaller screen.

If you are drawing a solid red box on the screen, no problem at all! The higher resolution display will simply draw it with more pixels. But what about a little icon that you designed at 16×16 “pixels” in Photoshop? Both a high-resolution display and low-resolution display need to display that icon at the same physical size, but the high-resolution display needs to essentially fake a lot of those pixels. It’s like when you enlarge a photo in Photoshop, it immediately starts looking like crap.

One solution is to make all your original images bigger. Instead of a 16×16 “pixel” image, you can actually make it 32×32 in Photoshop but have CSS size it to 16×16. Then the information is there for the high-resolution display.

Your question was explicitly about sprites. How can we make a sprite image that is twice the size for retina screens without making it a huge pain in the butt? Fortunately, Maykel Loomans recently published a very simple and clever technique for this.

Essentially, you make the sprite exactly (and literally) twice as big, while maintaining its proportions. Then in your “normal” CSS, you load up the “normal” sprite and do all the background-position and sizing stuff to make your sprite work. Then using media queries, you overwrite the background-image with your new retina sprite (when the conditions are correct). You use background-size to shrink the retina sprite, so you don’t have to touch the tedious positioning/sizing stuff. Yay!

span.rss-icon {
   background: url(sprite-1x.png)  72px 181px;
   width: 16px;
   height: 16px;
}

@media only screen and (-webkit-min-device-pixel-ratio: 2), 
       only screen and (min-device-pixel-ratio: 2) {
  span.rss-icon {
    background-image: url(sprite-2x.png);
    background-size: 50%;
  }
}

Liquid — Fixed — Liquid

Niels Matthijs asks:

The layout I’m trying to create is L1F2L3, meaning the first and third column are both liquid, while the center column is fixed. I’ve been trying some stuff out, and even though I came close a couple of times, the solution never really pleased me. Do you have anything on this?

The Flexbox method in CSS can hook you up with this solution, and it’s pretty easy:

<div class="grid">
  <div class="col fluid">
    ...
  </div>
  <div class="col fixed">
    ...
  </div>
  <div class="col fluid">
    ...
  </div>
</div>
.grid {
  display: -webkit-flex;
  display: flex;
}
.col {
  padding: 30px;
}
.fluid {
  flex: 1;
}
.fixed {
  width: 400px;
}

Flexbox

See demo. I’m hesitant to recommend this as a “real world” solution because the spec for flexbox has changed rather dramatically recently. The code above is the newer syntax which is supported only by Chrome 21+ at the time of this writing (see support charts). There is an older syntax (see demo) that has wider browser support, but will probably someday stop working.

If you are in a position where you know that the middle column will be the longest, you could have the parent container have percentage padding on the right and left sides and absolutely position the left and right columns within it (at the width of that percentage). And if you don’t know that, you could always measure the three columns with JavaScript, and set the parent container’s height to the tallest of the three.

The New

Peter Karlstein asks:

What are the most useful CSS tips, techniques, tricks that you’ve learned recently? Can you present a couple of your recent “Aha!” moments with CSS?

Messing around with the latest flexbox stuff (as I did above) was pretty fun, although not really useful quite yet.

In the past few months I’ve moved entirely to using Compass, which has been tremendously useful. Over time I’ve grown tired of the repetitive and finicky things in CSS. But Sass and Compass make authoring CSS fun again for me.

As far as little CSS “tricks”, I’ve had to use this one several times lately. Essentially, if somehow some super long string of text gets into a container with no spaces, it will break out of the container in a super awkward overlapping fashion. This is most common with user-generated content and users pasting in URL’s. I like applying this class to any user-generated text containers:

.prevent-text-breakouts {
  -ms-word-break: break-all;
      word-break: break-all;
      word-break: break-word;
  -webkit-hyphens: auto;
     -moz-hyphens: auto;
          hyphens: auto;
}

Before:

After:

Also, Uncle Dave’s Ol’ Padded Box is a good one to have in your toolbox.

Relative Font Sizing

Greg Nelson asks:

Do you think there will one day (hopefuly soon) be a way to set a font-size to be in direct relationship to the width of it’s parent element, or some other truly responsive measure? e.g. <p> font size could be a percentage of the width of a sidebar div it sits inside of, so that as screen width’s change (and width of sidebar changes, if it’s also a percentage of <body> width), the size of the font will change too?

Yep, that’s coming! You’ll be able to set font-size with vw and vh units. Those stand for “viewport width” and “viewport height”. 1vw = 1% of the current browser window’s width. Here’s the CSS spec for that. And here’s a tutorial on using them. This is how it will work:

At the time of writing this, there is only support in Chrome 20+ and IE 10. If you need full browser support now (and don’t mind using a bit of JavaScript), you can use FitText.js (best for headers only).

Media Query Efficiency

Mark Roland asks:

When organizing media queries in a CSS file, is there any advantage or disadvantage to how they are grouped?

For instance, is there a browser performance difference between using several media query blocks (e.g. “@media screen and (max-width: 480px) { }” ) so that element styles are defined together (header, nav, footer, etc.) versus placing all of the element styles for the specific media query into one single media query block?

The former allows for easier development, but costs increased file size. Are there browser rendering costs for redundant media queries?

Technically, probably yes. The worst offense is the extra file-size that it causes. Using one is clearly less text than using multiple. But the fact is if you gzip/deflate content (you probably are), that will eat that repetitive code for breakfast and it won’t even increase file-size too much. As far as CSS parsing time, that stuff happens so fast that you really don’t need to think about it.

So on a practical level: don’t worry about it. If you have some time to spend on making your website faster, losslessly optimizing your images will make a way bigger difference.

If anyone is confused on why Mark is asking this, it’s most likely because of the abilility that Sass and LESS have to “nest” media queries (see). This is a really neat feature that makes working with media queries a lot more clean an intuitive, as you the author. However, the final output results in many duplicated media queries. I know that addressing this issue is on the mind of the lead developer from Sass.

Onward!

Keep up the great questions, folks! Got a good one? Send it in, and we’ll be picking the best ones for the next edition.

Image source of picture on front page.


© Chris Coyier for Smashing Magazine, 2012.


Following the Masters: Showcase of Design-related Pinterest Boards to Follow


  

Of late, Pinterest has taken the social networking world by a storm. Pinterest makes it extremely easy to find and share content of your liking and interest. Whether you prefer typography, or are into photography and interior décor, you are sure to find many like-minded individuals on Pinterest who are sharing content related to your topics of interest. Further more, if you like design inspiration and infographics, you should really be on Pinterest.

In this article, we are showcasing some Pinterest users who are sharing awesome stuff using their pin boards – not just any stuff, but content that is especially useful for designers. So take a look down through this collection of design-related Pinterest boards, and start following these along today.

Following the Masters

Dainis Graveris

Dainis Graveris is the Founder-Owner of 1stWebDesigner.com. With over 5000 followers on his Pinterest page, Dainis is surely one of the “must-followâ€� persons on Pinterest. His most notable pin boards include ‘Web Design Trends’, ‘Fonts’, and ‘Technology and Design News’. Also, just in case you are new to Pinterest, Dainis Graveris has a pin board meant just for you – ‘Guides to Pinterest’.

Paul Andrew

Paul Andrew is the Owner of Speckyboy Design Magazine. Apart from usual infographics, he shares interesting stuff such as ‘Books Worth Reading’ and ‘Resources Worth Taking A Look At’, in addition to design inspiration and other such related topics.

Russ Burtner

Russ Burtner is a Senior User Experience Research Scientist by profession. Sounds big, doesn’t it? He mainly shares stuff such as typography, art and photography, along with all genres of design (architectural, interface, industrial as well as product design).

Design Quixotic

Design Quixotic is the pin board of Thea, a graphic designer from NYC. It focuses mainly on design-related aspects, such as typography, graphic/web and product design, logos/icons as well as book covers and wedding invitations.

Trent Martens

Trent Martens basically shares things related to logos, photography, posters and graphic design.

Mattias Ahlvin

Mattias Ahlvin does not share content related entirely to web design, as there are pin boards for topics such as Politics as well. However, there is an interesting and content-rich board about HTML and CSS, along with separate boards for pixel art and WordPress.

Jen Vasseur

Jen Vasseur is a freelance web designer and developer. Major pin boards include those related to design, coding and fonts. Furthermore, there are also separate boards about interesting websites and ‘Websites That Need Help’.

Paula Cevasco

Paula Cevasco is a graphic and user interface designer based in Argentina. On this Pinterest page, you’ll find boards catering to different types of design, such as web, architecture, and so on.

Samantha DeMott

Samantha DeMott is a graphic and web designer based in Washington, DC. The pin boards on her Pinterest page share stuff related to design, especially inspiration and package design. Also, the infographics’ board has a very interesting line-up and is definitely worth checking out.

Sixtyseven

Sixtyseven shares things related to logos and brochure design on Pinterest. There are a couple of other boards too, but they aren’t so well populated.

COLOURlovers

COLOURlovers has over 6000 followers on Pinterest. The pin boards are in perfect harmony with the brand name – BLUElovers, BROWNlovers, GOLDlovers, WHITElovers, and so on. Beyond that, there are genre-based boards as well, such as PHOTOGRAPHYlovers and PRINTlovers. The total number of boards is over 70, and the pin count is well beyond 3000. Obviously, this is one of the most active Pinterest profiles out there!

Graham Smith

Graham Smith is a graphic and logo designer from the UK. With over 2000 Pinterest followers, he shares stuff mostly related to logo design. There are some interesting boards, such as ‘Batman Logo Evolution’ and ‘Vintage Packaging’.

Paolo Bossi

Paolo Bossi, a graphic designer and music producer, pins stuff which is related to design and inspiration – typography, logo design, UI design, identity design and even Photoshop tutorials.

InfoTrust LLC

The Pinterest page for InfoTrust LLC contains boards dealing with social media and design resources. There are also separate boards for premium WordPress themes, Google Analytics and mobile web design.

Ophelia Quixote

Ophelia Quixote has over 1400 followers on Pinterest. Most interesting pin boards included ‘Art I Heart’, ‘Photo Ideas and Inspiration’ and ‘Patterns and Colors’.

Stu Greenham

Stu Greenham uses Pinterest the way it is supposed to be used– to organize and share things he personally likes (or, probably, dislikes). Just along side Typography, you’ll find ‘Favourite Fonts’, and other mutually resonating boards such as ‘Books to Read’ and ‘Books I’ve Read’. Terrific way to personalize social media, isn’t it? There is also a separate pin board pertaining to Facebook Timeline Covers.

Niki Blaker

Niki Blaker, a visual designer, has created boards about typography, animated GIFs and illustrations. Just in case you are looking for some awesome artwork, check out her pin board ‘Mexicana Floral Embroidery’.

Jeff Andrews

Having over 4000 followers, Jeff Andrews has created pin boards related to architecture, design, film and television, typography, photography and many other topics.

Mashable

Mashable has over 40,000 followers on Pinterest. The pin boards cover varied topics, such as space, fashion, lifestyle, humor, business, advertisements, social media, and so on. For web designers and other internet enthusiasts, there are also special boards about Instagram photos and Pinterest itself.

Smashing Magazine

You’ll find eBooks, desktop wallpaper calendars, and other awesome stuff from Smashing Magazine‘s Pinterest boards. Need we say more?

Over to You:

Finding design-related content on the internet is almost like building a personal library. No matter how many books you collect, there are always many more just waiting for you! Just like a good reading pane or library, the above list too can never be complete. Know any Pinterest boards that we missed? Feel free to share in the comments!

(rb)


Designing For Device Orientation: From Portrait To Landscape // UX Design For Mobile


  

The accelerometer embedded in our smart devices is typically used to align the screen depending on the orientation of the device, i.e. when switching between portrait and landscape modes. This capability provides great opportunities to create better user experiences because it offers an additional layout with a simple turn of a device, and without pressing any buttons.

However, designing for device orientation brings various challenges and requires careful thinking. The experience must be as unobtrusive and transparent as possible, and we must understand the context of use for this functionality.

Nearly all mobile and tablet applications would benefit from being designed for device orientation. This article covers some of the basic concepts that designers and developers can use to add device orientation to their process. We’ll present some of the challenges when designing for device orientation, along with some solutions.

Using Device Orientation For A Secondary Display

YouTube’s mobile application is a great example of device orientation design. Portrait mode offers a feature-rich interface for video discovery and the user’s account. Landscape mode provides an immersive experience with a full-screen video player and playback controls. When the video ends, the display switches back to portrait mode, prompting users to quickly tilt the device back and browse for additional videos.

However, using orientation to display a secondary interface can be confusing for users. For instance, in CardMunch (a business-card reader by LinkedIn), users can convert business-card images into address book contacts using the smartphone’s camera. Rotating CardMunch to landscape mode changes the interface altogether to a carousel overview of all of your saved cards.


YouTube’s mobile interface in portrait and landscape modes.

This interface lacks any visual clues about its orientation, and it has limited controls. You are unable to edit or add business cards, making the carousel screen somewhat frustrating and confusing, especially if you’ve launched the app in landscape mode. In addition, the lack of visual clues in this landscape mode will deter most users from rotating the device and discovering the app’s other features.


CardMunch by LinkedIn is missing visual clues about its secondary interface.

Categories Of Orientation Design

To help UX professionals and developers, I have categorized four main patterns of device orientation design.

Fluid

This interface simply adjusts to the new orientation’s size.


In Skype’s mobile interface, the icons change position when the screen moves from portrait to landscape.


Pocket’s mobile interface: same layout, different width.

Extended

This interface adjusts to the screen’s size, adding or subtracting layout components according to the dimensions of the chosen orientation. For example, IMDb for the iPad uses the wider screen in landscape mode to add a filmography on the left. This list is also accessible in portrait mode by clicking the “All filmography� button in the middle-right of the screen.


IMDb for the iPad.

Providing visual elements and functionality in any orientation ultimately gives convenience to the user. However, not forcing the user to hold the device a certain way is crucial, especially if the desired functionality does not appear in the default orientation.

Complementary

With this interface, a changed orientation triggers an auxiliary screen with relevant supplementary information. An example would be a mobile financial application that displays data in the default portrait mode, and then provides a visual graph when the user rotates to landscape mode. The orientations show similar or complementary data and depend on each other.


An example of a complementary design interface

Continuous

Like YouTube, a continuous design enables the user to access a secondary interface by a simple rotation of the device. An example would be using a smartphone as a remote control for a smart TV. Rotating the device to landscape mode would reveal a full program guide, while also maintaining functionality for changing channels, browsing programs and recording future episodes.


A smart remote and program guide.

Considering The Default Orientation

Above & Beyond is an interactive eBook for the iPad about the life and work of the American caricature artist John Kascht. The beautiful art in this book is displayed in both portrait and landscape modes. However, horizontal mode shows important interactive elements that do not appear in portrait mode, such as a way to return to the main menu. Portrait is the iPad’s default orientation, so including this type of added interactivity only in landscape mode might confuse many users.


A page from Above & Beyond. The interactive elements do not appear in the default portrait mode.

While portrait mode shows a detailed look at the art, and the interactive eBook provides some instructions at the beginning, a solution might be to allow users to tap the screen to reveal the menu. The default orientation for most smartphones and for the iPad is portrait. However, landscape is the default for Android, Windows 8 tablets and BlackBerry’s Playbook. To avoid confusion, remember that the primary orientation of your app should always serve the device’s default mode and functionality, not the other way around.

Understanding The Context

When designing an application for smart devices, consider the context and circumstances in which that application will be used, particularly when designing for device orientation. Case in point: interactive cookbooks have become very popular. Hardware and accessory manufacturers are creating devices to help us use the iPad in the kitchen, including a washable stylus for use while cooking.

We can use orientation to create a better experience in a cookbook. Using the iPad’s default portrait orientation, users can flip through the book and view the full recipe and ingredients list for a particular dish. Rotating the device to landscape mode will change the interface to a cook-friendly layout, with large buttons and step-by-step instructions. This cook-friendly interface would also prevent the tablet from auto-dimming, and it would allow users to flip pages by waving their hand in front of the built-in camera to avoid touching the screen with messy hands while cooking.


The Betty Crocker Cookbook for iPad is an example of a cook-friendly interface.

Understanding the context of the kitchen and how people cook with the iPad would make the interactive eBook much more functional. With the added consideration of device orientation, the user experience would be better overall.

Visual Clues About Orientation

An auxiliary screen or added functionality that depends on orientation can sometimes be counterintuitive. Without any visual clues in a particular orientation, a user might miss the added functionality altogether. A classic example of this is the iPhone’s built-in calculator, as pointed out in Salon’s post “How to Change the iPhone Calculator Into a Scientific Calculatorâ€� — functionality that many users do not know about.

When designing for device orientation, visual clues increase findability and makes the user experience intuitive and transparent. Below are a few examples of visual clues for device orientation.

Title Bar

Affixing the title bar to the top of the default position in either orientation is a subtle clue for the user to tilt their head (or device) to read the text in the bar. This technique is essential when using orientation for a secondary display and serves as a gentle reminder about the added functionality.

Note: This method will not give affordance to the added display in the default (portrait) orientation. In this case, I recommend coach marks, a quick tutorial or a walkthrough video (when appropriate) to illustrate that the application is using orientation for a secondary display.

Toggle Switch

Much like the universal icon for sharing or Apple’s familiar action button for sharing, I propose a standard icon to represent device orientation. You can download the icon shown below and use it freely.

The icon should appear at all times and be used as a toggle switch between orientation displays. Using the toggle would not require the user to rotate the device for the secondary view, but it would gradually encourage users to rotate the device to view the secondary interface without pressing the icon. Rotating the device back to the default orientation would automatically adjust the display. Ultimately, this icon would serve as a visual reminder for the added functionality; the user would not need to use this control to switch between orientation displays but would simply rotate the device instead.

Below are illustrations of this toggle icon in use:


Toggle button in the title bar.

If standardized, the orientation icon would give affordance and serve as a visual clue. Here is an illustration of this toggle icon in a corner triangle.


Orientation toggle in corner triangle.

Note: The device orientation icon is not a proven idea, and the value of adding this somewhat redundant UI control is debatable. However, in my opinion, the idea is simple and effective and would enable designers to more fully rely on device orientation to enhance and extend their applications. Hopefully, the proposals here will spark a conversation in the design community and lead to a solution whereby, with a simple turn of the device, essential functionality is added to any application.

The Drawer

The idea here is to show a drawer-like control that users can tap or swipe in order to see the secondary view. Rotating the device would automatically open the drawer, much like a curtain opening. By using an animation to open and close the drawer, the designer can create a memorable effect for displaying data based on orientation.


Illustration of a drawer control.

Conclusion

Designing for device orientation is not new. For example, when rotated to landscape mode, smartphones open a larger virtual keyboard, and the email applications in tablets switch to a master–detail interface. However, device orientation design is widely treated as secondary to the main interface because it is often missed by users who stick to the default orientation, mainly because they are not aware of its availability. By adding simple visual clues to the interface, UX professionals can make the case for using device orientation to enhance their products and, ultimately, for providing more engaging and user-friendly experiences.

(al) (il)


© Avi Itzkovitch for Smashing Magazine, 2012.


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