mobile web - merging responsive and adaptive techniques

53
MOBILE WEB Merging adaptive and responsive techniques

Upload: francisco-ferreira

Post on 17-May-2015

2.500 views

Category:

Technology


0 download

DESCRIPTION

Presentation given at jQuery Europe 2014 Helpers: Widget Based Architecture - http://franciscomsferreira.blogspot.co.at/2014/02/widget-based-architecture-mobile-web.html Less Mixins to leverage browser detection - http://franciscomsferreira.blogspot.co.at/2013/12/less-pathways-using-mixins-browser.html

TRANSCRIPT

Page 1: Mobile Web - Merging responsive and adaptive techniques

MOBILE WEB

Merging adaptive and responsive techniques

Page 2: Mobile Web - Merging responsive and adaptive techniques

FRANCISCO M.S. FERREIRAAgile Software Engineer

@fmsf303

Page 3: Mobile Web - Merging responsive and adaptive techniques

MOBILE WEB

Page 4: Mobile Web - Merging responsive and adaptive techniques

Mobile web 4

What to expect from this talk?

• What is an adaptive web site

• What is a responsive web site

• Responsive web widgets

• Building adaptive pathways with LESS

Page 5: Mobile Web - Merging responsive and adaptive techniques

Mobile web 5

Mobile web

Page 6: Mobile Web - Merging responsive and adaptive techniques

Mobile web 6

Strategies

• Classic (No mobile optimization)

• Adaptive (Different versions for different targets)

• Responsive (Auto adjusting design)

Page 7: Mobile Web - Merging responsive and adaptive techniques

ADAPTIVE VS RESPONSIVE

Page 8: Mobile Web - Merging responsive and adaptive techniques

8

Adaptive web origins

Adaptive vs responsive

Page 9: Mobile Web - Merging responsive and adaptive techniques

9

Adaptive web origins

Adaptive vs Responsive

Page 10: Mobile Web - Merging responsive and adaptive techniques

10

Adaptive web

Adaptive vs Responsive

Page 11: Mobile Web - Merging responsive and adaptive techniques

11

Responsive web origins

Adaptive vs Responsive

Page 12: Mobile Web - Merging responsive and adaptive techniques

12

Responsive web origins

Adaptive vs Responsive

Page 13: Mobile Web - Merging responsive and adaptive techniques

13

Responsive Web

Adaptive vs Responsive

Page 14: Mobile Web - Merging responsive and adaptive techniques

14

Responsive Web

Adaptive vs Responsive

Page 15: Mobile Web - Merging responsive and adaptive techniques

15

Responsive Web

Adaptive vs Responsive

Page 16: Mobile Web - Merging responsive and adaptive techniques

16

Responsive Web

Adaptive vs Responsive

Page 17: Mobile Web - Merging responsive and adaptive techniques

17

Intersection

Adaptive vs Responsive

Page 18: Mobile Web - Merging responsive and adaptive techniques

18

Intersection

Adaptive vs Responsive

Page 19: Mobile Web - Merging responsive and adaptive techniques

19

Intersection

Adaptive vs Responsive

Page 20: Mobile Web - Merging responsive and adaptive techniques

20

Intersection

Adaptive vs Responsive

Page 21: Mobile Web - Merging responsive and adaptive techniques

21

Intersection

Adaptive vs Responsive

• ‘w’ increases– Different user journey– Bigger code base

• ‘w’ decreases– Similar journey– One code base

Page 22: Mobile Web - Merging responsive and adaptive techniques

LESS PATHWAYS

Page 23: Mobile Web - Merging responsive and adaptive techniques

Less pathways 23

Lesscss (.org)

Page 24: Mobile Web - Merging responsive and adaptive techniques

Less pathways 24

Modularity (i.e.: topCategoryDeals.less)

Page 25: Mobile Web - Merging responsive and adaptive techniques

Less pathways 25

Less structure

less/ - main.less - sharedVariables.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

Page 26: Mobile Web - Merging responsive and adaptive techniques

Less pathways 26

Less structure

less/ - main.less - sharedVariables.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

Page 27: Mobile Web - Merging responsive and adaptive techniques

Less pathways 27

Less structure

less/ - main.less - sharedVariables.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

<link type="text/css" rel="stylesheet" href="/css/main.css" />

Page 28: Mobile Web - Merging responsive and adaptive techniques

Less pathways 28

main.less

less/ - main.less - sharedVariables.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

<link type="text/css" rel="stylesheet" href="/css/main.css" />

Page 29: Mobile Web - Merging responsive and adaptive techniques

Less pathways 29

New structure

less/ - main.less - sharedVariables.less - devices/ - mobile.less - desktop.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

Page 30: Mobile Web - Merging responsive and adaptive techniques

Less pathways 30

What about mobile tweaks?

less/ - main.less - sharedVariables.less - devices/ - mobile.less - desktop.less - widgets/ - navigationWidget.less - blogArticleWidget.less - commentBlockWidget.less - commentWidget.less

Page 31: Mobile Web - Merging responsive and adaptive techniques

Less pathways 31

Using less mixins

Page 32: Mobile Web - Merging responsive and adaptive techniques

Less pathways 32

Using less mixins

less/devices/mobile.less

Page 33: Mobile Web - Merging responsive and adaptive techniques

Less pathways 33

Using less mixins

less/devices/mobile.less

less/devices/desktop.less

Page 34: Mobile Web - Merging responsive and adaptive techniques

RESPONSIFYING

Page 35: Mobile Web - Merging responsive and adaptive techniques

35

Grid systems

Responsifying

Page 36: Mobile Web - Merging responsive and adaptive techniques

36

Traditional grid system issues

Responsifying

Page 37: Mobile Web - Merging responsive and adaptive techniques

37

Traditional grid system issues

Responsifying

Page 38: Mobile Web - Merging responsive and adaptive techniques

38

Traditional grid system issues

Responsifying

Mobile

Page 39: Mobile Web - Merging responsive and adaptive techniques

39

Traditional grid system issues

Responsifying

Extra Markup

Page 40: Mobile Web - Merging responsive and adaptive techniques

LET’S TALK WIDGETS

Page 41: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 41

A widget!

Page 42: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 42

Widget golden rule

.widget {

width: 100%;

}

Page 43: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 43

Parent sets child widgets width

.widget {

width: 100%;

> .widget {

width: 33%;

}

}

Page 44: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 44

Very simple media queries

.widget {

width: 100%;

> .widget {

width: 33%;

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

width: 50%;

}

}

}

Page 45: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 45

Everything is a widget

Page 46: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 46

Everything is a widget

Page 47: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 47

Everything is a widget

Page 48: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 48

Everything is a widget

Page 49: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 49

Nearly everything is a widget

Page 50: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 50

Birds eye view

Page 51: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 51

Modularity (i.e.: topCategoryDeals.less)

Page 52: Mobile Web - Merging responsive and adaptive techniques

Let’s talk widgets 52

Modularity (i.e.: topCategoryDeals.less)

Page 53: Mobile Web - Merging responsive and adaptive techniques

?

@fmsf303

franciscomsferreira.blogspot.com