there is no mobile: an introduction to responsive web design

37
There is No Mobile: An Introduction to Responsive Web Design Chris Love http://Love2Dev.com @ChrisLove

Upload: chris-love

Post on 28-Jun-2015

251 views

Category:

Technology


2 download

DESCRIPTION

The web has come a long way. One of the great features of the modern web is responsive web design (RWD). RWD allows developers to create a single web client for all devices & platforms. This presentation is an introduction to key concepts developers need to understand in order to start implementing responsive web design.

TRANSCRIPT

Page 1: There Is No Mobile: An Introduction To Responsive Web Design

There is No Mobile: An Introduction to Responsive Web

DesignChris Love

http://Love2Dev.com@ChrisLove

Page 2: There Is No Mobile: An Introduction To Responsive Web Design
Page 3: There Is No Mobile: An Introduction To Responsive Web Design

Who Am I

• ASP.NET MVP• ASP Insider• Internet Explorer User Agent• Author• Speaker• Tweaker, Lover of Web, JavaScript, CSS & HTML5• @ChrisLove• Love2Dev.com

Page 4: There Is No Mobile: An Introduction To Responsive Web Design

High Performance Single Page Web Applications

• Responsive Design• Touch• Mobile First• SPA• Extensible, Scalable Architecture• Web Build and Workflow• Goes Really Fast!

• ~395 Pages• 20 Chapters• $9.99 http://amzn.to/1a55L89

BUY NOW!

Page 5: There Is No Mobile: An Introduction To Responsive Web Design

Slide Deck & Source Code

• Slide Deck – http://slidesha.re/19NZInK• Source Code – http://GitHub.com/docluv

Page 6: There Is No Mobile: An Introduction To Responsive Web Design

Compare Responsive vs Non- Responsive• Atlanta Journal Constitution – http://ajc.com• Adaptive – http://m.ajc.com

• Boston Globe – http://bostonglobe.com• Responsive

Page 7: There Is No Mobile: An Introduction To Responsive Web Design
Page 8: There Is No Mobile: An Introduction To Responsive Web Design
Page 9: There Is No Mobile: An Introduction To Responsive Web Design
Page 10: There Is No Mobile: An Introduction To Responsive Web Design
Page 11: There Is No Mobile: An Introduction To Responsive Web Design

What is Adaptive?

• Uses Server-Side Device Detection• WURFL

• Separate Site• Usually m.<domain>.com• Requires maintaining 2 Code Bases• In Theory You Can Make a ‘mobile’ optimized version• In Reality A PITA

• Often 3rd party solution that scraped full site for content

Page 12: There Is No Mobile: An Introduction To Responsive Web Design

“this unspoken agreement to pretend that we had a certain size. And that size changed over the years. For a while, we all sort of tacitly agreed that 640 by 480 was the right size, and then later than changed to 800:600, and 1024; we seem to have settled on this 960 pixel as being this like, default. It’s still unknown. We still don’t know the size of the browser; it’s just like this consensual hallucination that we’ve all agreed to participate in: “Let’s assume the browser has a browser width of at least 960 pixels.”

Jeremy Keithbit.ly/1bhH6rw

Page 13: There Is No Mobile: An Introduction To Responsive Web Design

“The emergence of ideas like “responsive design” and “future-friendly thinking” are in part a response to the collective realization that designing products that solve one problem in one context at a time is no longer sustainable. By refocusing our process on systems that are explicitly designed to adapt to a changing environment, we have an opportunity to develop durable, long-lasting designs that renew their usefulness and value over time.”

Wilson Minerbit.ly/1fbq5lB

Page 14: There Is No Mobile: An Introduction To Responsive Web Design
Page 15: There Is No Mobile: An Introduction To Responsive Web Design
Page 16: There Is No Mobile: An Introduction To Responsive Web Design

“Any attempt to draw a line around a particular device class has as much permanence as a literal line in the sand. Pause for a moment and the line blurs. Look away and it will be gone. Let’s take the absolute best case scenario. You’re building a web app for internal users for whom you get to specify what computer is purchased and used. You can specify the browser, the monitor size, keyboard, etc.”

Jason Grigsbybit.ly/KzJH9G

Page 17: There Is No Mobile: An Introduction To Responsive Web Design

“How long do you think that hardware will be able to be found? Three years from now when a computer dies and has to be replaced, what are the chances that the new monitor will be a touchscreen?By making a decision to design solely for a “desktop UI”, you are creating technical debt and limiting the longevity of the app you’re building. You’re designing to a collective hallucination. You don’t have to have a crystal ball to see where things are headed.And once you start accepting the reality that the lines inside form factors are as blurry as the lines between them, then responsiveness becomes a necessity.”

Jason Grigsbybit.ly/KzJH9G

Page 18: There Is No Mobile: An Introduction To Responsive Web Design
Page 19: There Is No Mobile: An Introduction To Responsive Web Design
Page 20: There Is No Mobile: An Introduction To Responsive Web Design

Responsive Web Design

• Introduced by Ethan Marcotte 2010 - bit.ly/178an9e• Web Design Approach To Create An Optimal Viewing Experience

Across All Browser ViewPorts• Fluid Layouts• Media Queries• Minimal if any JavaScript Required

Page 21: There Is No Mobile: An Introduction To Responsive Web Design

Mobile First

• Determine The Most Important Information• Expand From There• Start Responsive Design Mobile First

Page 22: There Is No Mobile: An Introduction To Responsive Web Design

Fluid Layout

• Stretch as the Browser ViewPort Changes• Browser’s Viewable Area Inside the Chrome

• Serve as the Foundation for the Web Application Layout• Great Way To Create Native Like Experience

Page 23: There Is No Mobile: An Introduction To Responsive Web Design
Page 24: There Is No Mobile: An Introduction To Responsive Web Design

Media Queries

@media (min-width: 600px) { /* Selectors & Rules */}

@media (min-width: 820px) { /* Selectors & Rules */ }

@media (min-width: 1080px) { /* Selectors & Rules */}

Page 25: There Is No Mobile: An Introduction To Responsive Web Design

Responsive Navigation

• Use Media Queries to Optimize Rendering• Show and Hide Content Based on ViewPort Dimensions• Create A Mobile Friendly View• Optimize for Large Screens Without Device Detection

Page 26: There Is No Mobile: An Introduction To Responsive Web Design
Page 27: There Is No Mobile: An Introduction To Responsive Web Design

Responsible Web Design

• Practice of Providing Appropriate Content by Context• Primarily to Limit Image and Content Affects over Mobile• Can Involve JavaScript• Can Also be Used as a Design Technique

Page 28: There Is No Mobile: An Introduction To Responsive Web Design

matchMedia

• Allows You To Bind JavaScript Callbacks to MediaQuery Breakpoints• Available in All Modern Browsers (IE 10+)• Eliminated Need to Bind to Resize Event

Page 29: There Is No Mobile: An Introduction To Responsive Web Design

matchMedia

window.matchMedia("(min-width: 400px)").addListener(function (e) { if(e.matches) {

console.info("the view port is at least 400 pixels wide"); }else{

console.info("the view port is not at least 400 pixels wide"); }

});

Page 30: There Is No Mobile: An Introduction To Responsive Web Design
Page 31: There Is No Mobile: An Introduction To Responsive Web Design

The Image Problem

• Images Account for Majority of Downloaded Content• Screen Diversity Means Variety of Image Sizes & Quality• Screen Size• Screen Resolution• Bandwidth Consideration• Art Direction

Page 32: There Is No Mobile: An Introduction To Responsive Web Design

The Image Problem – Proposed Solutions• Picture Element – • Already Killed • No Wait It is Racing to Standardization Now

• Srcset – • Current Specification Path• No It looks Dead Now

• Src-N – • New Comer• Yesterday’s News

Page 34: There Is No Mobile: An Introduction To Responsive Web Design

PICTURE ELEMENT

<picture> <source media="(min-width: 650px)" srcset="images/kitten-large.png"> <source media="(min-width: 465px)" srcset="images/kitten-medium.png"> <!-- img tag for browsers that do not support picture element --> <img src="images/kitten-small.png" alt="a cute kitten"> </picture>

Page 35: There Is No Mobile: An Introduction To Responsive Web Design

The Image Problem – What To Do Now?• Use Nested Elements• CSS background-image• Display: none

• JavaScript Hacks?????

• Legacy Browsers Use Core Site

Page 36: There Is No Mobile: An Introduction To Responsive Web Design
Page 37: There Is No Mobile: An Introduction To Responsive Web Design

Thank You!

• Responsive Design• Touch• Mobile First• SPA• Extensible, Scalable Architecture• Web Build and Workflow• Goes Really Fast!

• ~395 Pages• 20 Chapters• $9.99 http://amzn.to/1a55L89

BUY NOW!