SlideShare a Scribd company logo
1 of 72
Download to read offline
Responsive websites.
Toolbox

@appspirina



WARSAW, 29.03.2012
Agenda
 • Feature detection   • Responsive images
 • Media Queries 101   • Micro libraries
 • Viewport Tricks     • jQuery plugins
 • Performance         • Mobile Wordpress
 • CSS frameworks      • Browser testing
PROGRESSIVE
 enhancement
      vs

  PIXEL
  perfection
Source: Justin Avery (CC BY-SA 3.0)




  Interfaces don’t have to
look the same everywhere.
  TV already solved this problem.
“Android WebKit
      is the closest thing to being
the IE6 of mobile development for me.”
      Dion Almaer, A day in the life of Android WebKit dealings




                                        http://www.flickr.com/photos/thebetancourts/899849126/
We know          There are
    features:       constraints:

✦   screen size      ✦   screen size
✦   local storage    ✦   no touch
✦   touch            ✦   poor JavaScript
✦   canvas           ✦   no canvas
✦   SVG              ✦   isMSIE


                                  Hat tip: Yiibu
Feature detect
Media Queries 101

                    http://www.flickr.com/photos/seeminglee/3967329241/
Party like it’s 1998!


<link rel="stylesheet" media="screen, projection" href="normal.css">
<link rel="stylesheet" media="print" href="print.css">


CSS2 media types
CSS3 Media Queries

<link rel="stylesheet" type="text/css"
      href="example.css" media="screen and (color)">




                          Media type          Expression
Better CSS3 Media Queries
Increase maintainability with @import:

 @import url("example.css") screen and (color);




Save HTTP requests:

 @media screen and (color) {
     body { background: #f00; }
 }
max/min
                -width or
                -device-width?

✦   former updates on orientation change, latter doesn’t
✦   only max/min-width will be visible in desktop browser
Detect high DPI screens
Just retina display:

<link rel="stylesheet"
      media="only screen and (-webkit-min-device-pixel-ratio: 2)"
      type="text/css" href="highdpi.css" />
“Remove iPhone from ass.”
                PPK, The iPhone obsession



                       http://www.flickr.com/photos/redux/5065152716/
Detect high DPI screens
 Saves HTTP request, non-iOS-specific:

 @media
 only screen   and   (-webkit-min-device-pixel-ratio: 1.5),
 only screen   and   (-o-min-device-pixel-ratio: 3/2),
 only screen   and   (min--moz-device-pixel-ratio: 1.5),
 only screen   and   (min-device-pixel-ratio: 1.5) {
   /* Styles   */
 }
Detect iPad orientation

<link rel="stylesheet"
      media="all and (orientation: landscape)"
      href="landscape.css">


<link rel="stylesheet"
      media="all and (orientation: portrait)"
      href="portrait.css">
Test it!
 • Screenfly
 • Responsive Design
  Testing

 • Responsive Design
  Test Bookmarklet
Browser support



— caniuse.com
Need support
 for IE6-8?
respond.js
https://github.com/scottjehl/Respond
Viewport Tricks

                  http://www.flickr.com/photos/neilkrug/3934372897/
Viewport demystified
<meta name="viewport" content="width=device-width, initial-scale=1.0">




width=500                Custom width setting


minimum-scale=1.0        Prevents from zooming out


maximum-scale=1.0        Prevents from zooming in. Useful with forms

user-scalable=no         Use cautiously. Mostly for mobile-specific designs
Hey girl,


when I see you,
my iPhone
gets 2x initial zoom
Home screen icon

<link rel="apple-touch-icon" href="apple-touch-icon.png">



                pported by Andr oid 2.1+, too!
             su
Home screen icon
iOS adds by default:

• Rounded corners
                       <link rel="apple-touch-icon-precomposed"

• Drop shadow                href="apple-touch-icon-precomposed.png">


• Reflective shine
                          prevents addition of iO
                                                      S effects
Home screen icon
  144 × 144              iPad ‘Retina’ display

  114 × 114              iPhone ‘Retina’ display

   72 × 72               iPad, iPad 2

   57 × 57               non-Retina iOS and others


 Complete snippet:

 http://mathiasbynens.be/notes/touch-icons
Hiding address bar
 After adding as a bookmark:

 <meta name="apple-mobile-web-app-capable" content="yes">




 Cross-browser solution:

  https://github.com/scottjehl/Hide-Address-Bar
iOS viewport scaling bug




     Portrait      Landscape
iOS viewport scaling bug fix
  if (navigator.userAgent.match(/iPhone/i) ||
  navigator.userAgent.match(/iPad/i)) {
    var viewportmeta = document.querySelector('meta
  [name="viewport"]');
    if (viewportmeta) {
      viewportmeta.content = 'width=device-width, minimum-scale=1.0,
  maximum-scale=1.0';
      document.body.addEventListener('gesturestart', function() {
        viewportmeta.content = 'width=device-width, minimum-
  scale=0.25, maximum-scale=1.6';
      }, false);
    }
  }


  — http://adactio.com/journal/4470/
Performance




              http://www.flickr.com/photos/frinky/2548934532/
Mobile first, stupid!
Decrease dependencies
Load resources conditionally
The Boston Globe used the following methodology:



       ASSETS                             DESIGN
        depend on                         depends on
        screen                              window
      dimensions                          dimensions
Optimize performance
 ✦   Mobile perf bookmarklet
 ✦   YSlow for mobile bookmarklet
Use CSS Data URL generators
or… built-in editor tools
(e.g. implemented in Sublime)
Mobile-friendly frameworks
                       http://www.flickr.com/photos/dunechaser/3385957841/
Develop your own!




Starbucks style guide:
http://www.starbucks.com/static/reference/styleguide/
6 takes to responsive images




                        http://www.flickr.com/photos/mightyboybrian/3457507731/
max-
       width:
      100%;
Doesn’t provide resources optimization
lowsrc
Defined as obsolete in HTML5
   Needs 2 http requests
Standard
JavaScript
replacement

Uses up the most resources
1px
                    gif

Relies on JS for displaying content. Poor idea.
data-highsrc

  developed by Filament Group
     used on Boston Globe
Adaptive-images.com
by Matt Wilcox




 ✦   PHP solution
 ✦   quick to set up
 ✦   doesn’t work with CDNs
Micro libraries




                  http://www.flickr.com/photos/lrargerich/4999906554/
jQuery Plugins




                 http://www.flickr.com/photos/vidyo/6109749573/
Wordpress goes mobile

                        http://www.flickr.com/photos/andivszf/5306544164/
1. Complete plugins
✦   WPTouch
✦   Wordpress Mobile Pack
✦   MobilePress




                            WPTouch plugin used on
                            Stephen Fry’s website
2. Responsive themes
✦   Twenty ten fully responsive
    equivalent available
✦   List of responsive themes
    at Free Themes Directory grows constantly
✦   Lots of responsive premium themes
    on Forest, WooThemes and Themify




                                                http://responsivetwentyten.com/
3. Theme switchers

Theme switchers usually base on user agent sniffing
to serve users separate WordPress theme.

 ✦   Wordpress Mobile Pack
 ✦   Mobile Smart
 ✦   Device Theme Switcher
4. Responsive design helpers

✦   Mobble
                      if (is_mobile()) {
✦   Dropdown Menus       echo "Dude, you rock."
                      }
✦   WP Fluid Images
Browser Testing




                  http://www.flickr.com/photos/blakespot/6860486028/
There are
             38 to solve your
                EMULATORS  *
                                        99

                 P R O B LEMS
* http://www.mobilexweb.com/emulators
Testing on
REAL
DEVICES
is crucial.
Building your pool of devices
 ✦   Analyze your website’s traffic
 ✦   Review the local platform landscape
 ✦   Check against device-specific factors
     (form, screen size, performance, DPI)
 ✦   Compare with project-specific factors
     (location-based?)



— Stephanie Rieger,
http://stephanierieger.com/strategies-for-choosing-test-devices/
Thanks!

                                          Q&A


Wojtek Zając (@theanxy)
                                                    This work is licensed
http://www.slideshare.net/wojciechzajac                under a Creative
                                                    Commons Attribution
                                                    3.0 Unported License
Credit where it’s due
Based on the brilliant research and works by:
• Scott Jehl           • Matt Wilcox            • Yiibu.com
• Patrick H. Lauke     • Brad Frost
• Russ Weakley         • Rachel McCollin
& others.


First slide photo: http://www.flickr.com/photos/johnmcnab/5758738799/
Stephanie Rieger: http://www.flickr.com/photos/29022619@N03/6116794697/

More Related Content

What's hot

Photo Sharing In Advising
Photo Sharing In AdvisingPhoto Sharing In Advising
Photo Sharing In AdvisingLaura Pasquini
 
Beyond Responsive Web Design
Beyond Responsive Web DesignBeyond Responsive Web Design
Beyond Responsive Web Designarborwebsolutions
 
New Rules of The Responsive Web
New Rules of The Responsive WebNew Rules of The Responsive Web
New Rules of The Responsive WebMatt Carver
 
Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...MilanAryal
 
Responsive Design & Mobile First
Responsive Design & Mobile FirstResponsive Design & Mobile First
Responsive Design & Mobile FirstLuke Brooker
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceAndy Davies
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordRuss Weakley
 
New and Emerging Technologies Listing
New and Emerging Technologies ListingNew and Emerging Technologies Listing
New and Emerging Technologies ListingDavid Peter
 
Web Performance Optimierung - DWX13
Web Performance Optimierung - DWX13Web Performance Optimierung - DWX13
Web Performance Optimierung - DWX13Walter Ebert
 
Going Fast on the Mobile Web
Going Fast on the Mobile WebGoing Fast on the Mobile Web
Going Fast on the Mobile WebJason Grigsby
 
5 single page application principles developers need to know
5 single page application principles developers need to know5 single page application principles developers need to know
5 single page application principles developers need to knowChris Love
 
Webview: The fifth element
Webview: The fifth elementWebview: The fifth element
Webview: The fifth elementFernando Cejas
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance WebsitesParham
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsNathan Smith
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Jon Arne Sæterås
 
The Browser Wars and Google's Chrome Sword
The Browser Wars and Google's Chrome SwordThe Browser Wars and Google's Chrome Sword
The Browser Wars and Google's Chrome SwordAlex Marsh
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Patrick Lauke
 

What's hot (19)

Photo Sharing In Advising
Photo Sharing In AdvisingPhoto Sharing In Advising
Photo Sharing In Advising
 
Beyond Responsive Web Design
Beyond Responsive Web DesignBeyond Responsive Web Design
Beyond Responsive Web Design
 
New Rules of The Responsive Web
New Rules of The Responsive WebNew Rules of The Responsive Web
New Rules of The Responsive Web
 
Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...
 
Responsive Design & Mobile First
Responsive Design & Mobile FirstResponsive Design & Mobile First
Responsive Design & Mobile First
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web Experience
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzword
 
New and Emerging Technologies Listing
New and Emerging Technologies ListingNew and Emerging Technologies Listing
New and Emerging Technologies Listing
 
Web Performance Optimierung - DWX13
Web Performance Optimierung - DWX13Web Performance Optimierung - DWX13
Web Performance Optimierung - DWX13
 
TPR4
TPR4TPR4
TPR4
 
Going Fast on the Mobile Web
Going Fast on the Mobile WebGoing Fast on the Mobile Web
Going Fast on the Mobile Web
 
5 single page application principles developers need to know
5 single page application principles developers need to know5 single page application principles developers need to know
5 single page application principles developers need to know
 
Webview: The fifth element
Webview: The fifth elementWebview: The fifth element
Webview: The fifth element
 
Design+Performance
Design+PerformanceDesign+Performance
Design+Performance
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance Websites
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013
 
The Browser Wars and Google's Chrome Sword
The Browser Wars and Google's Chrome SwordThe Browser Wars and Google's Chrome Sword
The Browser Wars and Google's Chrome Sword
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010
 

Viewers also liked

HTML5 i mikroformaty dla pragmatyków
HTML5 i mikroformaty dla pragmatykówHTML5 i mikroformaty dla pragmatyków
HTML5 i mikroformaty dla pragmatykówWojtek Zając
 
HTML5 and microformats for pragmatists
HTML5 and microformats for pragmatistsHTML5 and microformats for pragmatists
HTML5 and microformats for pragmatistsWojtek Zając
 
[PL] Rozpocznij karierę... Dzisiaj!
[PL] Rozpocznij karierę... Dzisiaj![PL] Rozpocznij karierę... Dzisiaj!
[PL] Rozpocznij karierę... Dzisiaj!Wojtek Zając
 
Antologia Webdevelopera (9.12.2006)
Antologia Webdevelopera (9.12.2006)Antologia Webdevelopera (9.12.2006)
Antologia Webdevelopera (9.12.2006)Wojtek Zając
 
Font embedding for the web
Font embedding for the webFont embedding for the web
Font embedding for the webWojtek Zając
 
Top Mistakes in Web Accessibility
Top Mistakes in Web AccessibilityTop Mistakes in Web Accessibility
Top Mistakes in Web AccessibilityWojtek Zając
 

Viewers also liked (6)

HTML5 i mikroformaty dla pragmatyków
HTML5 i mikroformaty dla pragmatykówHTML5 i mikroformaty dla pragmatyków
HTML5 i mikroformaty dla pragmatyków
 
HTML5 and microformats for pragmatists
HTML5 and microformats for pragmatistsHTML5 and microformats for pragmatists
HTML5 and microformats for pragmatists
 
[PL] Rozpocznij karierę... Dzisiaj!
[PL] Rozpocznij karierę... Dzisiaj![PL] Rozpocznij karierę... Dzisiaj!
[PL] Rozpocznij karierę... Dzisiaj!
 
Antologia Webdevelopera (9.12.2006)
Antologia Webdevelopera (9.12.2006)Antologia Webdevelopera (9.12.2006)
Antologia Webdevelopera (9.12.2006)
 
Font embedding for the web
Font embedding for the webFont embedding for the web
Font embedding for the web
 
Top Mistakes in Web Accessibility
Top Mistakes in Web AccessibilityTop Mistakes in Web Accessibility
Top Mistakes in Web Accessibility
 

Similar to Responsive websites. Toolbox

Responsive Websites
Responsive WebsitesResponsive Websites
Responsive WebsitesJoe Seifi
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5Ron Reiter
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Webmikeleeme
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12touchtitans
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Tirthesh Ganatra
 
Proactive Responsive Design
Proactive Responsive DesignProactive Responsive Design
Proactive Responsive DesignNathan Smith
 
Responsivedesign 7-3-2012
Responsivedesign 7-3-2012Responsivedesign 7-3-2012
Responsivedesign 7-3-2012Thomas Carney
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Mobile First Responsive Design
Mobile First Responsive DesignMobile First Responsive Design
Mobile First Responsive DesignJason Grigsby
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Adam Lu
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalFour Kitchens
 
移动端Web app开发
移动端Web app开发移动端Web app开发
移动端Web app开发Zhang Xiaoxue
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive DesignValtech UK
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Nicholas Zakas
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oiljameswillweb
 

Similar to Responsive websites. Toolbox (20)

Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Web
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12
 
Responsive design
Responsive designResponsive design
Responsive design
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)
 
Proactive Responsive Design
Proactive Responsive DesignProactive Responsive Design
Proactive Responsive Design
 
Responsivedesign 7-3-2012
Responsivedesign 7-3-2012Responsivedesign 7-3-2012
Responsivedesign 7-3-2012
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Mobile First Responsive Design
Mobile First Responsive DesignMobile First Responsive Design
Mobile First Responsive Design
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with Drupal
 
移动端Web app开发
移动端Web app开发移动端Web app开发
移动端Web app开发
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive Design
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Responsive websites. Toolbox

  • 2. Agenda • Feature detection • Responsive images • Media Queries 101 • Micro libraries • Viewport Tricks • jQuery plugins • Performance • Mobile Wordpress • CSS frameworks • Browser testing
  • 3. PROGRESSIVE enhancement vs PIXEL perfection
  • 4. Source: Justin Avery (CC BY-SA 3.0) Interfaces don’t have to look the same everywhere. TV already solved this problem.
  • 5. “Android WebKit is the closest thing to being the IE6 of mobile development for me.” Dion Almaer, A day in the life of Android WebKit dealings http://www.flickr.com/photos/thebetancourts/899849126/
  • 6. We know There are features: constraints: ✦ screen size ✦ screen size ✦ local storage ✦ no touch ✦ touch ✦ poor JavaScript ✦ canvas ✦ no canvas ✦ SVG ✦ isMSIE Hat tip: Yiibu
  • 8.
  • 9. Media Queries 101 http://www.flickr.com/photos/seeminglee/3967329241/
  • 10. Party like it’s 1998! <link rel="stylesheet" media="screen, projection" href="normal.css"> <link rel="stylesheet" media="print" href="print.css"> CSS2 media types
  • 11. CSS3 Media Queries <link rel="stylesheet" type="text/css" href="example.css" media="screen and (color)"> Media type Expression
  • 12. Better CSS3 Media Queries Increase maintainability with @import: @import url("example.css") screen and (color); Save HTTP requests: @media screen and (color) { body { background: #f00; } }
  • 13. max/min -width or -device-width? ✦ former updates on orientation change, latter doesn’t ✦ only max/min-width will be visible in desktop browser
  • 14. Detect high DPI screens Just retina display: <link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)" type="text/css" href="highdpi.css" />
  • 15. “Remove iPhone from ass.” PPK, The iPhone obsession http://www.flickr.com/photos/redux/5065152716/
  • 16. Detect high DPI screens Saves HTTP request, non-iOS-specific: @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { /* Styles */ }
  • 17. Detect iPad orientation <link rel="stylesheet" media="all and (orientation: landscape)" href="landscape.css"> <link rel="stylesheet" media="all and (orientation: portrait)" href="portrait.css">
  • 18. Test it! • Screenfly • Responsive Design Testing • Responsive Design Test Bookmarklet
  • 20. Need support for IE6-8? respond.js https://github.com/scottjehl/Respond
  • 21. Viewport Tricks http://www.flickr.com/photos/neilkrug/3934372897/
  • 22. Viewport demystified <meta name="viewport" content="width=device-width, initial-scale=1.0"> width=500 Custom width setting minimum-scale=1.0 Prevents from zooming out maximum-scale=1.0 Prevents from zooming in. Useful with forms user-scalable=no Use cautiously. Mostly for mobile-specific designs
  • 23. Hey girl, when I see you, my iPhone gets 2x initial zoom
  • 24. Home screen icon <link rel="apple-touch-icon" href="apple-touch-icon.png"> pported by Andr oid 2.1+, too! su
  • 25. Home screen icon iOS adds by default: • Rounded corners <link rel="apple-touch-icon-precomposed" • Drop shadow href="apple-touch-icon-precomposed.png"> • Reflective shine prevents addition of iO S effects
  • 26. Home screen icon 144 × 144 iPad ‘Retina’ display 114 × 114 iPhone ‘Retina’ display 72 × 72 iPad, iPad 2 57 × 57 non-Retina iOS and others Complete snippet: http://mathiasbynens.be/notes/touch-icons
  • 27. Hiding address bar After adding as a bookmark: <meta name="apple-mobile-web-app-capable" content="yes"> Cross-browser solution: https://github.com/scottjehl/Hide-Address-Bar
  • 28. iOS viewport scaling bug Portrait Landscape
  • 29. iOS viewport scaling bug fix if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) { var viewportmeta = document.querySelector('meta [name="viewport"]'); if (viewportmeta) { viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0'; document.body.addEventListener('gesturestart', function() { viewportmeta.content = 'width=device-width, minimum- scale=0.25, maximum-scale=1.6'; }, false); } } — http://adactio.com/journal/4470/
  • 30. Performance http://www.flickr.com/photos/frinky/2548934532/
  • 33. Load resources conditionally The Boston Globe used the following methodology: ASSETS DESIGN depend on depends on screen window dimensions dimensions
  • 34. Optimize performance ✦ Mobile perf bookmarklet ✦ YSlow for mobile bookmarklet
  • 35. Use CSS Data URL generators or… built-in editor tools (e.g. implemented in Sublime)
  • 36. Mobile-friendly frameworks http://www.flickr.com/photos/dunechaser/3385957841/
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Develop your own! Starbucks style guide: http://www.starbucks.com/static/reference/styleguide/
  • 43. 6 takes to responsive images http://www.flickr.com/photos/mightyboybrian/3457507731/
  • 44. max- width: 100%; Doesn’t provide resources optimization
  • 45. lowsrc Defined as obsolete in HTML5 Needs 2 http requests
  • 47. 1px gif Relies on JS for displaying content. Poor idea.
  • 48. data-highsrc developed by Filament Group used on Boston Globe
  • 49. Adaptive-images.com by Matt Wilcox ✦ PHP solution ✦ quick to set up ✦ doesn’t work with CDNs
  • 50. Micro libraries http://www.flickr.com/photos/lrargerich/4999906554/
  • 51.
  • 52.
  • 53.
  • 54. jQuery Plugins http://www.flickr.com/photos/vidyo/6109749573/
  • 55.
  • 56.
  • 57.
  • 58.
  • 59. Wordpress goes mobile http://www.flickr.com/photos/andivszf/5306544164/
  • 60. 1. Complete plugins ✦ WPTouch ✦ Wordpress Mobile Pack ✦ MobilePress WPTouch plugin used on Stephen Fry’s website
  • 61. 2. Responsive themes ✦ Twenty ten fully responsive equivalent available ✦ List of responsive themes at Free Themes Directory grows constantly ✦ Lots of responsive premium themes on Forest, WooThemes and Themify http://responsivetwentyten.com/
  • 62. 3. Theme switchers Theme switchers usually base on user agent sniffing to serve users separate WordPress theme. ✦ Wordpress Mobile Pack ✦ Mobile Smart ✦ Device Theme Switcher
  • 63. 4. Responsive design helpers ✦ Mobble if (is_mobile()) { ✦ Dropdown Menus echo "Dude, you rock." } ✦ WP Fluid Images
  • 64. Browser Testing http://www.flickr.com/photos/blakespot/6860486028/
  • 65.
  • 66.
  • 67. There are 38 to solve your EMULATORS * 99 P R O B LEMS * http://www.mobilexweb.com/emulators
  • 68.
  • 70. Building your pool of devices ✦ Analyze your website’s traffic ✦ Review the local platform landscape ✦ Check against device-specific factors (form, screen size, performance, DPI) ✦ Compare with project-specific factors (location-based?) — Stephanie Rieger, http://stephanierieger.com/strategies-for-choosing-test-devices/
  • 71. Thanks! Q&A Wojtek Zając (@theanxy) This work is licensed http://www.slideshare.net/wojciechzajac under a Creative Commons Attribution 3.0 Unported License
  • 72. Credit where it’s due Based on the brilliant research and works by: • Scott Jehl • Matt Wilcox • Yiibu.com • Patrick H. Lauke • Brad Frost • Russ Weakley • Rachel McCollin & others. First slide photo: http://www.flickr.com/photos/johnmcnab/5758738799/ Stephanie Rieger: http://www.flickr.com/photos/29022619@N03/6116794697/