Slide 1

Slide 1 text

yahoo.com/tablet Matt Seeley, @innerhtml

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

0 2 4 6 8 Q3 2010 Q4 2010 Q1 2011 7.33 4.19 3.27 iPads sold in millions Sources: http://www.apple.com/pr/library/2011/01/18results.htm l http://www.apple.com/pr/library/2010/10/18results.htm l http://www.apple.com/pr/library/2010/07/20results.html

Slide 4

Slide 4 text

Text

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Galaxy Tab iPad

Slide 7

Slide 7 text

today module @font-face viewport topics:

Slide 8

Slide 8 text

today module

Slide 9

Slide 9 text

huge images = huge download 1024 x 400

Slide 10

Slide 10 text

Title of the Story

Brief descriptio n More

... use the simplest DOM possible

Slide 11

Slide 11 text

function set (idx, isVisible) { var story = stories.children[idx] , src; if (story) { src = story.getAttribute("data-img"); story.style.backgroundImage = isVisible ? "url(" + src + ")" : ""; } } use the simplest JavaScript possible

Slide 12

Slide 12 text

Title of the Story

Brief descriptio n More

...

Slide 13

Slide 13 text

reqs HTML elems desktop 42 216 kB 1013 iPad 22 33 kB 473 iPhone 39 106 kB 1254 Steve Souders, Mobile comparison of Top 11 Source: http://www.stevesouders.com/blog/2011/03/14/mobile-comparison-of-top-11/

Slide 14

Slide 14 text

@font-face

Slide 15

Slide 15 text

@angry-face

Slide 16

Slide 16 text

SVG for iPad Truetype for Android

Slide 17

Slide 17 text

@font-face { font-family: "Gotham Medium"; font-weight: normal; font-style: normal ; src: url(gothmed.ttf) format(truetype), url(gothmed.svg#f) format(svg); } minimum CSS for iPad & Galaxy Tab

Slide 18

Slide 18 text

ouch! late loading font resources

Slide 19

Slide 19 text

"GET /gothmmed.ttf) %20format(truetype), %20url(gothmmed.svg HTTP/ 1.1" 404 < 9

Slide 20

Slide 20 text

@font-face { font-family: "Gotham Medium" ; font-weight: normal ; font-style: normal ; src: url(data:font/truetype;base64,DATA ) format(truetype), url(gothmed.svg#f) format(svg); } use a data URI, just one :(

Slide 21

Slide 21 text

most SVG data URIs are too long

Slide 22

Slide 22 text

data:image/svg+xml;charset=utf-8 , SVG as a data URI

Slide 23

Slide 23 text

fi le sizes as data URIs 127K 30K /[!-~]/ character subset

Slide 24

Slide 24 text

character subset /[!-~]/ only one works

Slide 25

Slide 25 text

li { font-face: "Gotham Medium"; /* harmful for SVG! */ text-overflow:ellipsis; }

Slide 26

Slide 26 text

li { font-face: "Gotham Medium"; /* harmful for SVG! */ text-overflow:ellipsis; } Fred Flintst... Barney Rub... George Jets... Yogi Bear this is what you expect

Slide 27

Slide 27 text

li { font-face: "Gotham Medium"; /* harmful for SVG! */ text-overflow:ellipsis; } ... ... ... Yogi Bear this is what you get

Slide 28

Slide 28 text

Think twice really-really-long before using @font-face

Slide 29

Slide 29 text

viewport Source: http://www. fl ickr.com/photos/dahlstroms/4083220012/

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

7” 9.7”

Slide 32

Slide 32 text

600 x 1024 768 x 1024

Slide 33

Slide 33 text

170 ppi 132 ppi

Slide 34

Slide 34 text

10mm

Slide 35

Slide 35 text

40px on iPad 10mm 8mm

Slide 36

Slide 36 text

10mm 6mm 40px on Galaxy Tab

Slide 37

Slide 37 text

size input controls to be touched dots are too small to touch!

Slide 38

Slide 38 text

fi tting the viewport Source: http://www. fl ickr.com/photos/midorisyu/3124671617/

Slide 39

Slide 39 text

device-width device-height orientation

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Slide 42

Slide 42 text

@medi a only scree n and (device-width: 768px ) and (orientation: portrait) { /* styles go here * / }

Slide 43

Slide 43 text

iPad device-width is always 768px

Slide 44

Slide 44 text

@medi a only scree n and (device-width: 768px ) and (orientation: portrait) { /* iPad in portrait! * / }

Slide 45

Slide 45 text

@medi a only scree n and (device-width: 768px ) and (orientation: landscape) { /* iPad in landscape! * / }

Slide 46

Slide 46 text

Galaxy Tab device-width i s 600px or 1024px

Slide 47

Slide 47 text

Keyboard Hidden Keyboard Visible Portrait 887 500 Landscape 501 235 Galaxy Tab device-height i s really broken

Slide 48

Slide 48 text

// wtf galaxy tab? screen.height == window.innerHeight Galaxy Tab screen.height i s really broken too

Slide 49

Slide 49 text

Source: http://www. fl ickr.com/photos/krupptastic/4988425044/

Slide 50

Slide 50 text

When the keyboard is open, the Galaxy Tab matches ‘landscape’ @media queries regardless of orientation

Slide 51

Slide 51 text

@media only screen and (orientation:portrait) { .wtf-galaxy { pitch:low; } } @media only screen and (device-width:600px) { /* Galaxy Tab portrait * / } @media only screen and (device-width:1024px) { /* Galaxy Tab landscape * / }

Slide 52

Slide 52 text

#deepbreath

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

@innerhtml Galaxy Tab tests & note s http://goo.gl/I2pkN http://goo.gl/DJDME SlideShar e http://goo.gl/I2pkN