making your site mobile-friendly - thoughtworks manchester geeknights 17.11.2010

48
Making your site mobile-friendly TIPS AND TECHNIQUES FOR A BETTER MOBILE PRESENCE Patrick H. Lauke / ThoughtWorks Manchester GeekNights / 17 November 2010

Upload: patrick-lauke

Post on 09-May-2015

2.000 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

Making your site mobile-friendly TIPS AND TECHNIQUES FOR A BETTER MOBILE PRESENCE

Patrick H. Lauke / ThoughtWorks Manchester GeekNights / 17 November 2010

Page 2: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

mobile web is increasingly important

Page 3: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

we need a site that works on iPhone

Page 4: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

...works on iPhone...oh, and iPad

Page 5: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

“remove iPhone from ass”Peter-Paul Koch, The iPhone obsession

www.quirksmode.org/blog/archives/2010/02/the_iphone_obse.html

Page 6: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

make your site work on all (most) mobile devices

Page 7: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 8: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

1. do nothing

Page 9: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

not WAP or text anymore...

Page 10: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

mobile browserswill work ok-ish

Page 11: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

“But the mobile context...”

Page 12: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

2. separate mobile site(m.flickr.com, mobile.mysite.com, ...)

Page 13: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

beware browser sniffingphoto: http://www.flickr.com/photos/timdorr/2096272747/

Page 14: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

offer users choice:desktop or mobile?

Page 15: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 16: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 17: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 18: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 19: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 20: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 21: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 22: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 23: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

refactored for small screen,not dumbed down for mobile

Page 24: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

3. single adaptive site

Page 25: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

nothing new...fluid layout, progressive enhancement, graceful degradation

Page 26: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS 2 Media Types(screen, print, handheld)

Page 27: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS 2.1 Media Types

<link rel="stylesheet" ... media="print" href="...">@import url("...") print;@media print { // insert CSS rules here}

Page 28: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS 3 Media Queries“...the new hotness” Jeffrey Zeldman

http://www.zeldman.com/2010/04/08/best-aea-yet/

Page 29: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS 3 Media Queries

● build and extend CSS 2.1 Media Types● more granular control of capabilities● width, height, orientation, color, resolution, …

http://www.w3.org/TR/css3-mediaqueries/

Page 30: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS 3 Media Queries

<link rel="stylesheet" ... media="screen and (max-width:480px)" href="...">@import url("...") screen and (max-width:480px);@media screen and (max-width:480px) { // insert CSS rules here}

Page 31: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 32: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 33: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 34: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

viewport meta

Page 35: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

viewport meta

● on desktop viewport = visible area of browser● mobile browsers have “virtual viewport”● viewport meta gives hints

http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html

Page 36: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

viewport meta

<meta name="viewport" content="width=device-width"><meta name="viewport" content="width=320, initial-scale=2.3,user-scalable=no">

Page 37: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 38: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 39: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010
Page 40: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

minimise dataand server requests

(minify JavaScript, combine CSS, …)

Page 41: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

minimise data

● data transfer over network can be slow● compress images (PNGCrush)● optimise your HTML (death to div-itis)● minify JavaScript● combine CSS

Page 42: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

minimise server requests

● each request has overhead● limit to concurrent requests● caching not reliable (e.g. iPhone > 25Kb)

Page 43: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

CSS spritesDave Shea, A List Apartwww.alistapart.com/articles/sprites

Page 44: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

width: 50px; height: 50px;background: url(icons.gif) no-repeat -51px 0;

Page 45: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

data URLshttp://software.hixie.ch/utilities/cgi/data/data

Page 46: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

data URLs

<img width="48" height="48" alt="Redux gravatar" src="data:image/jpeg,%FF%D8%FF%E0%00%10JFIF%00%01%01%01%00H%00H%00%00%FF% … ">h1 {

background: url("data:image/jpeg,%FF%D8%FF%E0%00%10JFIF%00%01 … ") no-repeat left top;}

Page 47: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

1. do nothing2. separate mobile site3. single adaptive site

Page 48: Making your site mobile-friendly - ThoughtWorks Manchester GeekNights 17.11.2010

www.opera.com/[email protected]

people.opera.com/patrickl/presentations/mcr-geeknights_17.11.2010/mcr-geeknights_17.11.2010.pdf