hammering responsive web design into shape

60
Hammering Responsive Web Design Into Shape @KenTabor Thursday, October 17, 13

Upload: ken-tabor

Post on 27-Jan-2015

107 views

Category:

Technology


0 download

DESCRIPTION

This BigDesign 2013 session helps you develop and more importantly debug responsive web design. Why? Because it’s not easy. These are nuts and bolts hands-on concepts to help you get through one of the most difficult things we can tackle building websites and webapps.

TRANSCRIPT

Page 1: Hammering Responsive Web Design Into Shape

Hammering Responsive Web Design Into Shape

@KenTabor

Thursday, October 17, 13

Page 2: Hammering Responsive Web Design Into Shape

Shared

bit.ly/KenBigD13

Thursday, October 17, 13

Page 3: Hammering Responsive Web Design Into Shape

I’m Not Selling RWD

Assuming you already buy into responsive, fluid, what-have-you, design

Thursday, October 17, 13

Page 4: Hammering Responsive Web Design Into Shape

Challenge: Many Devices

Now let’s focus on the challenge of testing a multitude of form-factors

Thursday, October 17, 13

Page 5: Hammering Responsive Web Design Into Shape

Freedom!

Production servers are a drag for testing

Thursday, October 17, 13

Page 6: Hammering Responsive Web Design Into Shape

Install a Web Server

Get you some Apache for starters

Lots of solid how-to tutorials online

Thursday, October 17, 13

Page 7: Hammering Responsive Web Design Into Shape

Apache Setup

Tell Apache where to serve files from

Thursday, October 17, 13

Page 8: Hammering Responsive Web Design Into Shape

Editing Config Files

NotePad++ on Win

TextWrangler on OSX

Thursday, October 17, 13

Page 9: Hammering Responsive Web Design Into Shape

httpd.conf

DocumentRoot "/Users/ken/trees"<Directory "/Users/ken/trees">

Thursday, October 17, 13

Page 10: Hammering Responsive Web Design Into Shape

httpd-vhosts.conf

<VirtualHost *:80> DocumentRoot "/Users/ken/trees" ServerName localhost</VirtualHost>

Thursday, October 17, 13

Page 11: Hammering Responsive Web Design Into Shape

Localhost, the Best Host

Rapid turn around and total control

Thursday, October 17, 13

Page 12: Hammering Responsive Web Design Into Shape

Laptop + Device => #Joy

Can we attach mobile devices to our development laptop? Yes! Apache helps.

Thursday, October 17, 13

Page 13: Hammering Responsive Web Design Into Shape

Devices + Localhost

Laptop is hard-wired to router

iPad and iPhone both on wifi router

Flat & common topology is key

Thursday, October 17, 13

Page 14: Hammering Responsive Web Design Into Shape

System Prefs => Sharing

Thursday, October 17, 13

Page 15: Hammering Responsive Web Design Into Shape

iPhone Calling MacBook

http://Kens-MacBook-Air.local

Thursday, October 17, 13

Page 16: Hammering Responsive Web Design Into Shape

Browsing the File Server

Choose files as per Apache file sharing including your website/app

Thursday, October 17, 13

Page 17: Hammering Responsive Web Design Into Shape

iPhone Perspective?

Thursday, October 17, 13

Page 18: Hammering Responsive Web Design Into Shape

Thursday, October 17, 13

Page 19: Hammering Responsive Web Design Into Shape

Advanced: OSX Hotspot

Create a wireless hotspot allowing mobile devices direct connect to laptop

Thursday, October 17, 13

Page 20: Hammering Responsive Web Design Into Shape

Win7 Device Connect

Easy stuff, just flatten the connections

Thursday, October 17, 13

Page 21: Hammering Responsive Web Design Into Shape

Devices + Localhost

Laptop is hard-wired to router

iPad and iPhone both on wifi router

Thursday, October 17, 13

Page 22: Hammering Responsive Web Design Into Shape

Connection

Laptop has Apache, firewall off

Website files in VirtualHost directory

Get the ip address, iPhone and iPad hit it

Thursday, October 17, 13

Page 23: Hammering Responsive Web Design Into Shape

Thursday, October 17, 13

Page 24: Hammering Responsive Web Design Into Shape

Who Am I?

I’m a front-end product engineer

At Sabre Holdings building TripCase

Thursday, October 17, 13

Page 25: Hammering Responsive Web Design Into Shape

Thursday, October 17, 13

Page 26: Hammering Responsive Web Design Into Shape

Internet Inspirations

mediaqueri.es

Thursday, October 17, 13

Page 27: Hammering Responsive Web Design Into Shape

Internet Resources

responsive.is

Thursday, October 17, 13

Page 28: Hammering Responsive Web Design Into Shape

responsive.is

Thursday, October 17, 13

Page 29: Hammering Responsive Web Design Into Shape

responsive.is

Thursday, October 17, 13

Page 30: Hammering Responsive Web Design Into Shape

Internet Resources

screenqueri.es

Thursday, October 17, 13

Page 31: Hammering Responsive Web Design Into Shape

screenqueri.es

Thursday, October 17, 13

Page 32: Hammering Responsive Web Design Into Shape

screenqueri.es

Thursday, October 17, 13

Page 33: Hammering Responsive Web Design Into Shape

Responsive Testing Repo

Easily preview your site on form factors from a convenient localhost page

Thursday, October 17, 13

Page 34: Hammering Responsive Web Design Into Shape

Responsive Testing Repo

github.com/mattkersley/Responsive-Design-Testing

Thursday, October 17, 13

Page 35: Hammering Responsive Web Design Into Shape

Localhost Install

Thursday, October 17, 13

Page 36: Hammering Responsive Web Design Into Shape

ResponsizerJS

Drop it into your web site helping resize browser window when matching devices

Thursday, October 17, 13

Page 37: Hammering Responsive Web Design Into Shape

Responsizer GitHub

github.com/KDawg/Responsizer.js

Thursday, October 17, 13

Page 38: Hammering Responsive Web Design Into Shape

Responsizer index.html

<script src="resources/code/Responsizer.js" type="text/javascript"></script>

Thursday, October 17, 13

Page 39: Hammering Responsive Web Design Into Shape

Responsizer Measuring

Inject it into any site to learn from them

Thursday, October 17, 13

Page 40: Hammering Responsive Web Design Into Shape

Injecting Responsizer

Google Chrome

View => Developer Tools => JavaScript Console

Thursday, October 17, 13

Page 41: Hammering Responsive Web Design Into Shape

Injecting Responsizer

$('body').append('<script type="text/javascript" src="http://localhost/Responsizer.js/Responsizer.js>"</script>')

Thursday, October 17, 13

Page 42: Hammering Responsive Web Design Into Shape

How Big Are Your Users?

How do we know what size devices our customers use?

Thursday, October 17, 13

Page 43: Hammering Responsive Web Design Into Shape

Google Analytics

If you’re using Google Analytics you have a wealth of information to report

Thursday, October 17, 13

Page 44: Hammering Responsive Web Design Into Shape

Analytics Dashboard

Thursday, October 17, 13

Page 45: Hammering Responsive Web Design Into Shape

Analytics Informs

Using this data informs your interface design with fact-based reality

Thursday, October 17, 13

Page 46: Hammering Responsive Web Design Into Shape

Sass is CSS Done Better

sass-lang.com

Thursday, October 17, 13

Page 47: Hammering Responsive Web Design Into Shape

Sass - What is it?

Meta language, lovely syntactic sugar, compiles to CSS, makes dev life joyful

Thursday, October 17, 13

Page 48: Hammering Responsive Web Design Into Shape

Sass Media Queries

.popup { left: 25%; position: fixed; width: 50%; z-index: 20;

@media screen and (max-width: 320px) { left: 10%; width: 80% }

@media screen and (min-width: 1024px) { font-size: 2em; left: 15%; width: 70%; }}

Thursday, October 17, 13

Page 49: Hammering Responsive Web Design Into Shape

Sass Makes It Look Good

The media query nesting Sass affords leads to organized and rational code

Thursday, October 17, 13

Page 50: Hammering Responsive Web Design Into Shape

Fun with PhantomJS

phantomjs.org

Headless Webkit browser

Thursday, October 17, 13

Page 51: Hammering Responsive Web Design Into Shape

Imagemagick Processing

imagemagick.org

Selection of command-line image tools

Thursday, October 17, 13

Page 52: Hammering Responsive Web Design Into Shape

Install Both Tools

brew install phantomjsbrew install imagemagick

Thursday, October 17, 13

Page 53: Hammering Responsive Web Design Into Shape

PhantomJS Photos

Take screenshots vs online and localhost

See what sites look like on devices

Thursday, October 17, 13

Page 54: Hammering Responsive Web Design Into Shape

PhantomJS - screenie.js

var webpage = require('webpage');var page;

page = webpage.create();page.viewportSize = {width: 1024, height: 768};page.clipRect = {top: 0, left: 0, width: 1024, height: 768};

page.open('http://www.microsoft.com', function() { page.render('screenie_1024_768.png'); phantom.exit();});

phantomjs screenie.js

Thursday, October 17, 13

Page 55: Hammering Responsive Web Design Into Shape

Imagemagick Comparing

Use it to compare two images producing a third showing what’s different

Thursday, October 17, 13

Page 56: Hammering Responsive Web Design Into Shape

Revealing Changes

compare image1.png image2.png image3.png

Thursday, October 17, 13

Page 57: Hammering Responsive Web Design Into Shape

Compare Design Drift

Thursday, October 17, 13

Page 58: Hammering Responsive Web Design Into Shape

imagemagick insanity

Can this be automated?

Does visual history help debugging?

Can we detect design diverging?

Thursday, October 17, 13

Page 59: Hammering Responsive Web Design Into Shape

Questions?

Thursday, October 17, 13

Page 60: Hammering Responsive Web Design Into Shape

Thank-Youbit.ly/KenBigD13

@KenTabor

Thursday, October 17, 13