an app is not enough

80
Responsive Web Design An app is not enough Joakim Kemeny @joakimkemeny

Upload: joakimkemeny

Post on 30-Oct-2014

276 views

Category:

Documents


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: An app is not enough

Responsive Web DesignAn app is not enough

Joakim Kemeny@joakimkemeny

Page 2: An app is not enough

Resp

onsi

ve W

eb D

esig

n

Page 3: An app is not enough
Page 4: An app is not enough
Page 5: An app is not enough
Page 6: An app is not enough
Page 7: An app is not enough
Page 8: An app is not enough

Ignore mobileVisitors will use a computer anyway

1

Page 9: An app is not enough

Ignore mobileVisitors will use a computer anyway

1 Ignore mobileVisitors will use a computer anyway

1

Create m.company.comMobile visitors are only interested in asubset of the information

2

Page 10: An app is not enough

Ignore mobileVisitors will use a computer anyway

1 Ignore mobileVisitors will use a computer anyway

1

Create m.company.comMobile visitors are only interested in asubset of the information

2

Create an appRedirect all mobile visitors to the app stores

3

Page 11: An app is not enough

Ignoring mobile is…

Page 12: An app is not enough

Ignoring mobile is…Ignoring mobile is…

Stupid!

Get the facts at www.lukew.com

Page 13: An app is not enough

Ignore mobileVisitors will use a computer anyway

1 Ignore mobileVisitors will use a computer anyway

1

Create m.company.comMobile visitors are only interested in asubset of the information

2

Create an appRedirect all mobile visitors to the app stores

3

Page 14: An app is not enough

Creating m.company.com is…Creating m.company.com is…

Page 15: An app is not enough
Page 16: An app is not enough
Page 17: An app is not enough

More examples at wtfmobileweb.com

Page 18: An app is not enough

Creating m.company.com is…Creating m.company.com is…

Page 19: An app is not enough

Creating m.company.com is…Creating m.company.com is…Creating m.company.com is…

Not great!

Page 20: An app is not enough

Ignore mobileVisitors will use a computer anyway

1 Ignore mobileVisitors will use a computer anyway

1

Create m.company.comMobile visitors are only interested in asubset of the information

2

Create an appRedirect all mobile visitors to the app stores

3

Page 21: An app is not enough

Creating an app is…Creating an app is…

Page 22: An app is not enough

Create an App or a Site?

Will users use it every day?

Should it talk to the users?

Does it need device access?

Page 23: An app is not enough

Create an App or a Site?

Will users use it every day?

Should it talk to the users?

Does it need device access?

Page 24: An app is not enough

Create an App or a Site?

Will users use it every day?

Should it talk to the users?

Does it need device access?

Page 25: An app is not enough

Create an App or a Site?

Page 26: An app is not enough

Create an App or a Site?Create an App or a Site?

Page 27: An app is not enough

Create an App or a Site?Create an App or a Site?

Page 28: An app is not enough

3997 different Android devices

Source opensignalmaps.com/reports/fragmentation.php

Page 29: An app is not enough

Android screen resoultions

2:7

Source opensignalmaps.com/reports/fragmentation.php

Page 30: An app is not enough

Pixel density

Page 31: An app is not enough

Pixel densityPixel densityimg.png [email protected]

Page 32: An app is not enough

Pixel densityPixel densityimg.png [email protected]

ldpi mdpi hdpi xhdpi

Page 33: An app is not enough

Pixel densityPixel densityimg.png [email protected]

ldpi mdpi hdpi xhdpi

tvdpi

Page 34: An app is not enough

Creating an app is…Creating an app is…

Page 35: An app is not enough

Creating an app is…Creating an app is…Creating an app is…

Not enough!

Page 36: An app is not enough

ResponsiveWeb Design

Page 37: An app is not enough

ResponsiveWeb DesignResponsiveWeb Design

Old concept…

Page 38: An app is not enough

ResponsiveWeb DesignResponsiveWeb Design

Old concept…

…reinvented by Ethan MarcotteA List Apart, issue 306, 2010

Page 39: An app is not enough

Step 0.1 I know what I'm doing

<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8">

<!-- Don't zoom out, use the actual width --> <meta name="viewport" content="width=device-width">

0 1 2 3

Page 40: An app is not enough

Step 0.2 Travel back in time

div { width: 100%;}

0 1 2 3

Page 41: An app is not enough

Step 0.2 Travel back in time

div {

width: 100%;

border: 4px solid black;

padding: 15px;

}

0 1 2 3

Page 42: An app is not enough

Step 0.2 Travel back in time

div {

width: 100%;

border: 4px solid black;

padding: 15px;

}

* {

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

}

0 1 2 3See paulirish.com/2012/box-sizing-border-box-ftw

Page 43: An app is not enough

Flexible Grid

0 1 2 3

Page 44: An app is not enough

http://responsive.joakimkemeny.se/demo/demo1/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 45: An app is not enough

http://responsiv…

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

HTML5 Conf

Page 46: An app is not enough

Creating a flexible grid

.wrapper {

width: 880px;

}

.content {

width: 546px;

}

aside {

width: 334px;

}

0 1 2 3

Page 47: An app is not enough

Creating a flexible grid

.wrapper {

width: 880px;

}

.content {

width: 546px;

}

aside {

width: 334px;

}

0 1 2 3

Creating a flexible grid

.wrapper {

max-width: 880px;

width: 95%; /* 880px */

}

.content {

width: 62.0454545%; /* 546px / 880px */

}

aside {

width: 37.9545455%; /* 334px / 880px */

}

0 1 2 3

Page 48: An app is not enough

$blue: #3bbfce;

$border: 1px solid $blue;

$margin: 20px;

nav {

color: darken($blue,

10%);

margin: $margin / 2;

}

ul {

li {

border-left: $border;

&:first-child {

border-left: 0;

}

}

}

Step 0.3 Use a CSS preprocessor

Variables Functions Operations Nesting Mixins

0 1 2 3

Page 49: An app is not enough

$blue: #3bbfce;

$border: 1px solid $blue;

$margin: 20px;

nav {

color: darken($blue,

ul {

li {

border-left: $border;

&:first-child {

border-left: 0;

}

Step 0.3 Use a CSS preprocessor

Variables Functions Operations Nesting Mixins

Sasssass-lang.com

LESSlesscss.org

Page 50: An app is not enough

Creating a flexible grid

.wrapper {

width: 880px;

}

.content {

width: 546px;

}

aside {

width: 334px;

}

0 1 2 3

Creating a flexible grid

.wrapper {

max-width: 880px;

width: 95%; /* 880px */

.content {

width: percentage(546px / 880px);

}

aside {

width: percentage(334px / 880px);

}

}

0 1 2 3

Page 51: An app is not enough

http://responsive.joakimkemeny.se/demo/demo3/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 52: An app is not enough

http://responsiv…

Information

Sed ut perspiciatisunde omnis iste natus

Register

Name Time

MariaOlsson

15:01:01

JohanSvensson

15:52:01

Elin Boo 15:54:01

HTML5Conf

Information Speakers

Page 53: An app is not enough

Flexible images

0 1 2 3

Page 54: An app is not enough

Creating flexible images

img, embed, object, video {

max-width: 100%;

}

.ie6 {

img, object {

width: 100%;

}

}

Great tool modernizr.com 0 1 2 3

Page 55: An app is not enough

http://responsive.joakimkemeny.se/demo/demo4/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 56: An app is not enough

http://responsiv…

Information

Sed ut perspiciatisunde omnis iste natuserror sit voluptatemaccusantiumdoloremquelaudantium, totamrem aperiam, eaqueipsa quae ab illoinventore veritatis etquasi architectobeatae vitae dicta sunt

Register

Name Time

MariaOlsson

15:01:01

JohanSvensson

15:52:01

Elin Boo 15:54:01

HTML5Conf

Information Speakers

Page 57: An app is not enough

Media Queries

0 1 2 3

Page 58: An app is not enough

Using Media Queries

@media screen and (max-width: 480px) {

body {

background-color: red;

}

}

@media screen and (orientation: landscape) …

@media screen and (-webkit-min-device-pixel-ratio: 2) …

0 1 2 3

Page 59: An app is not enough

Where are the breakpoints?

320px Phones in portrait mode

480px Phones in landscape mode

600px Smaller tablets in portrait mode

768px Larger tablets in portrait mode

1024px Larger tablets in landscape mode & smaller laptops

1200px Widescreen displays

0 1 2 3

Page 60: An app is not enough

Where are the breakpoints?

320px Phones in portrait mode

480px Phones in landscape mode

600px Smaller tablets in portrait mode

768px Larger tablets in portrait mode

1024px Larger tablets in landscape mode & smaller laptops

1200px Widescreen displays

0 1 2 3

Where are the breakpoints?

200 – 4096

0 1 2 3

Page 61: An app is not enough

Using Media Queries

#content {

.content {

float: left;

padding-right: 30px;

width: percentage(546px / 880px);

}

aside {

float: right;

padding-left: 30px;

width: percentage(334px / 880px);

}

@media screen and (max-width: 599px) {

.content {

float: none;

padding: 0 0 20px 0;

width: 100%;

}

aside {

float: none;

Page 62: An app is not enough

padding-left: 30px;

width: percentage(334px / 880px);

}

@media screen and (max-width: 599px) {

.content {

float: none;

padding: 0 0 20px 0;

width: 100%;

}

aside {

float: none;

padding: 20px 0 0 0;

width: 100%;

}

}

}

0 1 2 3

Page 63: An app is not enough

http://responsive.joakimkemeny.se/demo/demo5/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 64: An app is not enough

http://responsiv…

Information

Sed ut perspiciatis unde omnis iste natuserror sit voluptatem accusantiumdoloremque laudantium, totam remaperiam, eaque ipsa quae ab illo inventoreveritatis et quasi architecto beatae vitaedicta sunt explicabo. Nemo enim ipsamvoluptatem quia voluptas sit aspernatur autodit aut fugit, sed quia consequuntur magnidolores eos qui ratione voluptatem sequi

HTML5Conf

Information Speakers

Page 65: An app is not enough

Using Media Queries

#header {

h1 {

float: left;

margin-left: 130px;

@media screen and (max-width: 767px) {

margin-left: 160px;

}

@media screen and (max-width: 479px) {

float: none;

margin-left: 0;

}

}

nav {

float: right;

@media screen and (max-width: 767px) {

clear: left;

float: left;

Page 66: An app is not enough

margin-left: 0;

}

}

nav {

float: right;

@media screen and (max-width: 767px) {

clear: left;

float: left;

margin-left: 160px;

a {

background: rgba(255, 255, 255, 0.40);

}

}

@media screen and (max-width: 479px) {

float: none;

margin-left: 0;

}

}

}

Page 67: An app is not enough

http://responsive.joakimkemeny.se/demo/demo6/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 68: An app is not enough

http://responsiv…

Information

Sed ut perspiciatis unde omnis iste natuserror sit voluptatem accusantiumdoloremque laudantium, totam remaperiam, eaque ipsa quae ab illo inventoreveritatis et quasi architecto beatae vitaedicta sunt explicabo. Nemo enim ipsamvoluptatem quia voluptas sit aspernatur autodit aut fugit, sed quia consequuntur magnidolores eos qui ratione voluptatem sequinesciunt.

Price

HTML5 ConfInformation Speakers

Page 69: An app is not enough

http://responsive.joakimkemeny.se/demo/demo7/index.html

Information

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantiumdoloremque laudantium, totam rem aperiam, eaque ipsa quae ab illoinventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit autfugit, sed quia consequuntur magni dolores eos qui ratione voluptatemsequi nesciunt.

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 Conf Information Speakers

Page 70: An app is not enough

http://responsiv…

Information

Sed ut perspiciatis unde omnis iste natuserror sit voluptatem accusantiumdoloremque laudantium, totam remaperiam, eaque ipsa quae ab illo inventoreveritatis et quasi architecto beatae vitaedicta sunt explicabo. Nemo enim ipsamvoluptatem quia voluptas sit aspernatur autodit aut fugit, sed quia consequuntur magnidolores eos qui ratione voluptatem sequinesciunt.

Price

HTML5 ConfInformation Speakers

Page 71: An app is not enough

http://responsiv…

Information

Sed ut perspiciatis unde omnis iste natuserror sit voluptatem accusantiumdoloremque laudantium, totam remaperiam, eaque ipsa quae ab illo inventoreveritatis et quasi architecto beatae vitaedicta sunt explicabo. Nemo enim ipsamvoluptatem quia voluptas sit aspernatur autodit aut fugit, sed quia consequuntur magnidolores eos qui ratione voluptatem sequinesciunt.

Price

Register

Name Time

Maria Olsson 15:01:01

Johan Svensson 15:52:01

Elin Boo 15:54:01

HTML5 ConfInformation Speakers

Page 72: An app is not enough

Challenges

Page 73: An app is not enough

ChallengesChallengesImages

Great guide css-tricks.com/which-responsive-images-solution-should-you-use

Page 74: An app is not enough

ChallengesChallengesImages Ads

Performance

Get the data lukew.com/ff/entry.asp?1681

Page 75: An app is not enough

Conclusions

Page 76: An app is not enough

ConclusionsConclusionsTHE way to create sites 2013…

Page 77: An app is not enough

ConclusionsConclusionsTHE way to create sites 2013…

…but it doesn't always replace apps

Page 78: An app is not enough

ConclusionsConclusionsWe are back in 1997

Page 79: An app is not enough

ConclusionsConclusionsWe are back in 1997

Framework Twitter

You should checkout twitter.github.com/bootstrap and follow @brad_frost

Page 80: An app is not enough

Responsive Web DesignThank you for coming!

Joakim [email protected]/joakimkemeny