SlideShare una empresa de Scribd logo
1 de 14
Using Responsive Design in the Mobile Web 
HTML5DevConf 
Chris Perkins - Intel 
Intel Confidential — Do Not Forward
2 
Introductory Equations 
Someone told me that each equation I included in the book would halve the sales – Stephen Hawking 
 Speaker = Chris Perkins 
 Layout + Mobile Web = Challenging 
 Design Choices x Technologies x Libraries x Devices > Number.MAX_VALUE
3 
Responsive Design 
Power has to be insecure to be responsive – Ralph Nader 
 Designing a layout that works on a variety of screen sizes, orientations, and 
devices. The design responds to its environment. 
 vs. Adaptive Design 
 Includes 
 @media queries 
 %, em (vw & vh) coordinates 
 redirects 
 javascript
@media queries 
4 
The Basics 
 @media 
 min-width: / max-width 
 orientation: landscape / portrait 
 and 
 https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries 
 device-width, aspect-ratio, etc. 
 only, not 
 print, screen, handheld, all, …
Retina Images 
5 
 background-image css property 
 Q: what about <img> tag? 
 A: Use JS. Google “retina <img>” 
<img src=“little_baby.jpg” data-src2x=“big_baby.jpg”>
6 
Landscape / Portrait Only 
You don’t change the course of history by turning the faces of portraits to the wall – Jawaharlal Nehru 
 Cordova config.xml (for Cordova CLI or PhoneGapBuild) 
 <preference name="orientation" value="portrait" /> 
 Intel XDK 
 Projects Pane Settings (once for each desired platform) 
 Only for Builds (not Emulator or Previewing)
layout 
7 
@media & float 
 Floating boxes 
 float:left 
 min-width:250px 
 margin:0px 
 box-sizing:border-box 
 @media queries set width 
 25% for 1000px or greater 
– 4 x 250 = 1000 
 33% for 750 – 1000 
– 3 x 250 = 750
8 
@media & float : Frameworks and Tools 
- 
 Grid Systems 
 Zurb Foundation (foundation.zurb.com) 
 Twitter Bootstrap 
 960.gs 
 Many others 
 Tools 
 Adobe Edge Reflow 
 Intel XDK (App Designer)
layout 
9 
flexbox 
 Much Simpler. 
 Just works. 
 Supposedly less well supported 
– Android 4.3 and earlier use “old” spec. 
– May require –webkit prefix 
– Crosswalk OK 
– IE 11 OK. IE 10 uses 2012 spec. 
– http://caniuse.com/#search=flexbox
javascript & @media 
10 
- 
 window.matchMedia(‘(max-width: 400px)’) 
 { 
– media: {String}, 
– matches:{Boolean}, 
– removeListener:{Function}, 
– addListener:{Function} } 
 ‘(max-width:400px) and 
(orientation:landscape)’ etc. OK 
 But no @media
11 
redirect 
JavaScript is only redirect solution for Cordova/PhoneGap apps 
 Issues 
 A full “restart” of app 
– At start: palatable 
– While running: difficult 
– OK for phone versus tablet. 
– But bad choice for portrait vs. landscape. 
 Burden of transferring application state 
– via localStorage etc 
 deviceready 
 Summary: Single Page App is still your best friend.
Vertical sizing 
12 
- 
 Sizing of element vs text 
 vh, vmax/vmin not backward compatible on 
Android 
 em & rem 
 Zoom via meta 
– <meta name="viewport" content="initial-scale=2"> 
– Not well supported. 
– Tricky. 
 @viewport ? 
– Draft. Unsupported.
13 
Links 
- 
 https://github.com/cperkinsintel/responsive_design_pres 
 http://xdk-software.intel.com/
Intel Confidential — Do Not Forward

Más contenido relacionado

Más de Intel® Software

Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...Intel® Software
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...Intel® Software
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...Intel® Software
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI ResearchAWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI ResearchIntel® Software
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview SlidesIntel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview SlidesIntel® Software
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019Intel® Software
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019Intel® Software
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...Intel® Software
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Intel® Software
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...Intel® Software
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...Intel® Software
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino SlidesAIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino SlidesIntel® Software
 
AIDC India - AI Vision Slides
AIDC India - AI Vision SlidesAIDC India - AI Vision Slides
AIDC India - AI Vision SlidesIntel® Software
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Intel® Software
 
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...Intel® Software
 
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...Intel® Software
 
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...Intel® Software
 
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Intel® Software
 

Más de Intel® Software (20)

Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI ResearchAWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI Research
 
Intel Developer Program
Intel Developer ProgramIntel Developer Program
Intel Developer Program
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview SlidesIntel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview Slides
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
 
AIDC India - AI on IA
AIDC India  - AI on IAAIDC India  - AI on IA
AIDC India - AI on IA
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino SlidesAIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino Slides
 
AIDC India - AI Vision Slides
AIDC India - AI Vision SlidesAIDC India - AI Vision Slides
AIDC India - AI Vision Slides
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
 
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...
Intel® Open Image Denoise: Optimized CPU Denoising | SIGGRAPH 2019 Technical ...
 
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
 
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...
Ray Tracing with Intel® Embree and Intel® OSPRay: Use Cases and Updates | SIG...
 
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
 

Último

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Using Responsive Design in the Mobile Web

  • 1. Using Responsive Design in the Mobile Web HTML5DevConf Chris Perkins - Intel Intel Confidential — Do Not Forward
  • 2. 2 Introductory Equations Someone told me that each equation I included in the book would halve the sales – Stephen Hawking  Speaker = Chris Perkins  Layout + Mobile Web = Challenging  Design Choices x Technologies x Libraries x Devices > Number.MAX_VALUE
  • 3. 3 Responsive Design Power has to be insecure to be responsive – Ralph Nader  Designing a layout that works on a variety of screen sizes, orientations, and devices. The design responds to its environment.  vs. Adaptive Design  Includes  @media queries  %, em (vw & vh) coordinates  redirects  javascript
  • 4. @media queries 4 The Basics  @media  min-width: / max-width  orientation: landscape / portrait  and  https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries  device-width, aspect-ratio, etc.  only, not  print, screen, handheld, all, …
  • 5. Retina Images 5  background-image css property  Q: what about <img> tag?  A: Use JS. Google “retina <img>” <img src=“little_baby.jpg” data-src2x=“big_baby.jpg”>
  • 6. 6 Landscape / Portrait Only You don’t change the course of history by turning the faces of portraits to the wall – Jawaharlal Nehru  Cordova config.xml (for Cordova CLI or PhoneGapBuild)  <preference name="orientation" value="portrait" />  Intel XDK  Projects Pane Settings (once for each desired platform)  Only for Builds (not Emulator or Previewing)
  • 7. layout 7 @media & float  Floating boxes  float:left  min-width:250px  margin:0px  box-sizing:border-box  @media queries set width  25% for 1000px or greater – 4 x 250 = 1000  33% for 750 – 1000 – 3 x 250 = 750
  • 8. 8 @media & float : Frameworks and Tools -  Grid Systems  Zurb Foundation (foundation.zurb.com)  Twitter Bootstrap  960.gs  Many others  Tools  Adobe Edge Reflow  Intel XDK (App Designer)
  • 9. layout 9 flexbox  Much Simpler.  Just works.  Supposedly less well supported – Android 4.3 and earlier use “old” spec. – May require –webkit prefix – Crosswalk OK – IE 11 OK. IE 10 uses 2012 spec. – http://caniuse.com/#search=flexbox
  • 10. javascript & @media 10 -  window.matchMedia(‘(max-width: 400px)’)  { – media: {String}, – matches:{Boolean}, – removeListener:{Function}, – addListener:{Function} }  ‘(max-width:400px) and (orientation:landscape)’ etc. OK  But no @media
  • 11. 11 redirect JavaScript is only redirect solution for Cordova/PhoneGap apps  Issues  A full “restart” of app – At start: palatable – While running: difficult – OK for phone versus tablet. – But bad choice for portrait vs. landscape.  Burden of transferring application state – via localStorage etc  deviceready  Summary: Single Page App is still your best friend.
  • 12. Vertical sizing 12 -  Sizing of element vs text  vh, vmax/vmin not backward compatible on Android  em & rem  Zoom via meta – <meta name="viewport" content="initial-scale=2"> – Not well supported. – Tricky.  @viewport ? – Draft. Unsupported.
  • 13. 13 Links -  https://github.com/cperkinsintel/responsive_design_pres  http://xdk-software.intel.com/
  • 14. Intel Confidential — Do Not Forward

Notas del editor

  1. Introduce Self: Chris Perkins. Work for Intel, on Intel XDK Have developed tools for developers or designers, including SiteGrinder, PhotoWebber and others Comment on slide. I cannot begin to cover, much less enumerate, all the choices, possible solutions, in an hour. Instead, going to focus on just one corner: Responsive Design. IMPORTANT: If you are developing for the mobile web, you need to be aware of the world your app will live in when on the phone. Not the world it is in while on your desktop. You get your app into the App Stores, and the first user to download it will likely have an older Android or iOS install and it’s built-in system webview is old and fragile. It wasn’t current when the phone was released, much less now. All your hard-earned mad-latest CSS skillz wither when facing these impassive bricks. The user cannot update that webview by simply updating their browser app on the phone. They must upgrade the underlying OS, and for many phones the manufacturer or carrier has either forgotten or prevented them from doing so.
  2. It was trendy a few years ago to distinguish Responsive Design from Adaptive Design. But, honestly, everyone is so tired these days no one cares. Excepting possibly some few pedants. NOTE: vh coordinates buggy on iOS. And vw, vh unsupported before Android 4.4 (except crosswalk).
  3. color-change demo Any CSS Property can be used. Float, font-size, NOTE: Media Queries are well supported. Everywhere but IE8.
  4. Retina-image demo Obviously, can be combined with and (min-width:400px) etc Will both images be loaded?
  5. Hey, since this is the Mobile Web and if you don’t care about browsers, don’t even bother with the rest of my talk.
  6. Layout demo Body margin:0 -- full bleed. Easier calculation. Min-width:250 means less thinking. All the media queries are expressed in multiples of that minimum width. We will use actual “width” in the media queries themselves. Margin:0 very important. Much much harder to think about with real margins. Use nested containers if you need real margins. Box-sizing:border-box. In this demo I’m using light blue borders as fake margins. This stunt will only work with box-sizing:border-box. Otherwise we are back to thinking again.
  7. Everything from the previous slide is well trodden ground. Many have come before and have simplified it with tools and libraries.
  8. Layout-flexbox demo. Use Chrome “Live Layout” mode It has been said that flexbox is finally CSS layout done right, and that it is an embarrassment that it has taken Much simpler. Just works. Note that we didn’t even need a media query in this example. (Note we might want @media (max-width:400px){ .container { flex-direction:column } } ) In my experience, this actually works pretty well across a wide variety of platforms. Recommend testing and planning for testing. Phone updates can’t be counted on. (w/ exception of Crosswalk)
  9. Notes: No ‘@media’ part. Very handy. Important
  10. redirect project demo For true web apps (served) the story may be different. Sessions/Cookies Phone versus Tablet is generally safe, because use can’t “change” their device by flipping it over or shaking it. Note: best to use _both_ check-at-start and listen-for-change .