49
RESPONSIVE WEB DESIGN <frontenders/> VALENCIA Javier Arques 11 abril 2013

Responsive web design - frontenders Valencia

Embed Size (px)

DESCRIPTION

Presentación de Javier Arques para el Frontenders Valencia del 11 de abril de 2013. Una introducción al Responsive Web Design con ejemplos prácticos. Web de ejemplo: http://servidordeprueba.net/webs/responsive-talk/ Ficheros de ejemplo: https://github.com/frontenders/responsive-talk Frontenders: http://valencia.frontenders.me/

Citation preview

Page 1: Responsive web design - frontenders Valencia

RESPONSIVE WEB DESIGN

<frontenders/> VALENCIA

Javier Arques11 abril 2013

Page 3: Responsive web design - frontenders Valencia
Page 4: Responsive web design - frontenders Valencia

TIPOS DE WEB MÓVIL

DEDICADA RDW RESS

Page 5: Responsive web design - frontenders Valencia

TIPOS DE WEB MÓVIL

DEDICADA RDW RESS

Más rápidas Mejor UX/UI

Múltiples URL’s Redirecciones Contenido duplicado Diferente UX/UI

URL y HTML propio

Page 6: Responsive web design - frontenders Valencia

TIPOS DE WEB MÓVIL

DEDICADA RDW RESS

Más rápidas Mejor UX/UI

Múltiples URL’s Redirecciones Contenido duplicado Diferente UX/UI

Google ❤ RWDUn sitio para todo, sin

redirecciones

Peor optimizadasPeor UI/UX

URL y HTML propio misma URL y HTML

Page 7: Responsive web design - frontenders Valencia

TIPOS DE WEB MÓVIL

DEDICADA RDW RESS

Más rápidas Mejor UX/UI

Múltiples URL’s Redirecciones Contenido duplicado Diferente UX/UI

Google ❤ RWDUn sitio para todo, sin

redirecciones

Peor optimizadasPeor UI/UX

URL y HTML propio misma URL y HTML misma URL HTML&CSS propio

Igual que DEDICADA

Más código Detección del

dispositivo en el servidor

Page 8: Responsive web design - frontenders Valencia

*imagen: http://bradfrostweb.com/blog/post/this-is-the-web/

RESPONSIVE WEB DESIGN

Page 9: Responsive web design - frontenders Valencia
Page 10: Responsive web design - frontenders Valencia
Page 12: Responsive web design - frontenders Valencia

ETHAN MARCOTTE

http://unstoppablerobotninja.com/entry/on-being-responsive/

1FLEXIBLE LAYOUT

2FLEXIBLE MEDIA

3MEDIA QUERIES

Page 13: Responsive web design - frontenders Valencia

1 FLEXIBLE LAYOUT

Page 14: Responsive web design - frontenders Valencia
Page 15: Responsive web design - frontenders Valencia

FLEXIBILIZA TU LAYOUT

Contenido fluido (%)

Tamaño en porcentaje = tamaño/total x 100

300px / 960px x 100 = 31.25%

box-sizing: border-box. Incluye el padding y el borde en el ancho total (IE8+)

Page 17: Responsive web design - frontenders Valencia

TIPOGRAFÍA

Usar em, rem, %

body{ font-size: 100%} // 16px

em = tamaño en px / 16px

24px / 16px = 1.5em

Page 18: Responsive web design - frontenders Valencia

servidordeprueba.net/webs/responsive-talk/v1/

Page 19: Responsive web design - frontenders Valencia

960px

465px

300px

217px

30px

300px 660px

Page 20: Responsive web design - frontenders Valencia

48.4375%

31.25%

22.60%

3.125%

31.25% 68.75%

.wrapper{! max-width: 960px;! width: 90%;}

Page 22: Responsive web design - frontenders Valencia

2 FLEXIBLE MEDIA

Page 23: Responsive web design - frontenders Valencia

FLEXIBLE IMAGES CSS

Imagen se ajusta al ancho del contendor

img, embed, object, video { max-width: 100%; overflow: hidden; height: auto;}

Page 25: Responsive web design - frontenders Valencia

JS RESPONSIVE IMAGES

picturefill.js

https://github.com/scottjehl/picturefill

Page 26: Responsive web design - frontenders Valencia

SERVER RESPONSIVE IMAGES

.htaccesspara redireccionar todas las imágenes a adaptive-images.php

adaptive-images.phpcreará las imágenes y las cacheará

javascriptcreará una cookie que guarde el tamaño de tu pantalla

http://adaptive-images.com/

Page 27: Responsive web design - frontenders Valencia

RESPONSIVE VIDEO

https://github.com/davatron5000/FitVids.js

Plugin de jQuery que adapta el tamaño de los embeds de Youtube, Vimeo, Blip.tv, ..

Page 28: Responsive web design - frontenders Valencia

3 MEDIA QUERIES

Page 29: Responsive web design - frontenders Valencia

MEDIA QUERIES

CSS 2.1@media {media type: screen, handheld, print, all, tv, ...} {media features: width, orientation, ...}

@media print { * { font-family: serif}}

HTML

<link rel="stylesheet" media="{media type} {media features}" href="example.css" />

<link rel="stylesheet" type="text/css" media="print" href="serif.css">

Page 30: Responsive web design - frontenders Valencia

width (permite min,max)

@media screen and (min-width: 400px) and (max-width: 700px) { … }

device width (permite min,max)

@media screen and (device-width: 800px) { … }

orientation@media all and (orientation:portrait) { … }@media all and (orientation:landscape) { … }

MEDIA TYPES MEDIA FEATURES

all

braille

embossed

handheld

print

projection

screen

speech

tty

tv

Page 31: Responsive web design - frontenders Valencia

TAMAÑOS BÁSICOS

/* Landscape phones and down */@media (max-width: 480px) { ... }

/* Landscape phone to portrait tablet */@media (max-width: 767px) { ... }

/* Portrait tablet to landscape and desktop */@media (min-width: 768px) and (max-width: 979px) { ... }

/* Large desktop */@media (min-width: 1200px) { ... }

Page 32: Responsive web design - frontenders Valencia

RESOLUCIONES

320 < 480 < 720 < 768 < 900 < 1024 < 1200

Page 33: Responsive web design - frontenders Valencia

MEDIA QUERY SUPPORT

IE >= 9

SOPORTADO POR TODOS LOS

NAVEGADORES MÓVILES

respond.jshttps://github.com/scottjehl/Respond

Page 34: Responsive web design - frontenders Valencia

NUESTRO EJEMPLOCON MEDIA QUERIES

Page 36: Responsive web design - frontenders Valencia

TABLET PORTRAIT (MAX-WIDTH: 768)

Page 37: Responsive web design - frontenders Valencia

SMARTPHONE (MAX-WIDTH: 480)

Page 38: Responsive web design - frontenders Valencia

HEADER (MAX-WIDTH: 480)

Page 39: Responsive web design - frontenders Valencia

GRID (MAX-WIDTH: 480PX)

Page 40: Responsive web design - frontenders Valencia

MÁS COSASRECURSOS Y OTRAS MOVIDAS

Page 41: Responsive web design - frontenders Valencia

VIEWPORT

<meta name="viewport" content="width=device-width, initial-scale=1">

los navegadores de los smartphone emulan la resolución del escritorio (800-980px)

Page 42: Responsive web design - frontenders Valencia

MOBILE FIRST

Page 43: Responsive web design - frontenders Valencia

http://mobitest.akamai.com/

Page 44: Responsive web design - frontenders Valencia

BRAD FROST

http://bradfrost.github.io/this-is-responsive/

Page 46: Responsive web design - frontenders Valencia

“INSPIRACIÓN”

Awwwards www.awwwards.com/

Mediaqueri.es

Speckyboy speckyboy.com/

Hongkiat www.hongkiat.com/blog/

Codrops ympanus.net/codrops/

Smashing Magazine www.smashingmagazine.com/

Themeforest themeforest.net/

Page 47: Responsive web design - frontenders Valencia

Responsive Web Design por Ethan Marcotte http://alistapart.com/article/responsive-web-design

SIXREVISIONS: A comparison of Methods for Building Mobile-Opimized Websites http://sixrevisions.com/mobile/methods-mobile-websites/

MASHABLE: 85 Top Responsive Web Design Tools de Mashable http://mashable.com/2013/03/18/web-design-tools/

The Responsinator (testing): http://www.responsinator.com/

RESS: Responsive Design + Server Side Components http://www.lukew.com/ff/entry.asp?1392

RECURSOS

Page 48: Responsive web design - frontenders Valencia
Page 49: Responsive web design - frontenders Valencia