SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Mobile, Media & Touch
                             One guy’s opinion about CSS Media Queries & Mobile Detection




                                  Tim Wright | csskarma.com | @csskarma
Thursday, October 21, 2010
About me
                • Code	
  monkey	
  /	
  designer	
  at	
  USC
                • Blogger	
  on	
  CSSKarma
                • Writer	
  for	
  Smashing	
  Magazine	
  &	
  SitePoint
                • Avid	
  tweeter	
  under	
  @csskarma
                • Couch	
  potato



Thursday, October 21, 2010
What we’ll cover
                • Current	
  state
                 • Device	
  detection	
  (up	
  &	
  downsides)
                 • Screen	
  detection	
  (up	
  &	
  downsides)
                • Future	
  state
                 • Another	
  way
                 • Touch	
  detection
                 • Combining	
  techniques
                 • Fallbacks
Thursday, October 21, 2010
The	
  current	
  
             state	
  of	
  
            detection


Thursday, October 21, 2010
Device	
  Detection.
                                          Server-side, with PHP




Thursday, October 21, 2010
What	
  we’re	
  looking	
  for
               <?php
                echo $_SERVER['HTTP_USER_AGENT']
               ?>



               Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-
               US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/
               6.0.472.63 Safari/534.3




Thursday, October 21, 2010
Server-­‐side	
  detection	
  code
               <?php
               //setting the variables
               $ipod = stripos($_SERVER['HTTP_USER_AGENT'],"ipod");
               $iphone = stripos($_SERVER['HTTP_USER_AGENT'],"iphone");
               $ipad = stripos($_SERVER['HTTP_USER_AGENT'],"ipad");


               //detecting device
               if ($ipod == true || $iphone == true || $ipad == true){
                   echo "<p>Apple Touch Product</p>";
                   } else {
                   echo "<p>Screen</p>";
               }
               ?>




Thursday, October 21, 2010
The	
  upside
                     • Speed
                     • Support
                     • Established	
  standard




Thursday, October 21, 2010
The	
  downside
                     • Scalability
                     • Maintainability
                     • Established	
  standard




Thursday, October 21, 2010
Let’s	
  see	
  one




                   www.csskarma.com/presentations/cssla/server


Thursday, October 21, 2010
Screen	
  Detection.
                                          CSS Media Queries




Thursday, October 21, 2010
What	
  are	
  they?




Thursday, October 21, 2010
Media	
  query	
  code
      Embedding
      @media screen and (min-width:320px) and (max-width:480px){

                 // styles here

      }



      Linking
      <link rel=”stylesheet” href=”mobile.css” media=”screen and
      (min-width:320px) and (max-width:480px)”>




Thursday, October 21, 2010
Property	
  options
                     • print,	
  screen,	
  etc.
                     • device-­‐aspect-­‐ratio
                     • orientation
                             portrait/landscape



                     • color	
  (color	
  monitor/screen)
                     • monochrome
                     • min-­‐color-­‐index
                             256



                     • min	
  &	
  max	
  width
                     • min	
  &	
  max	
  device	
  width
                     • (-­‐webkit-­‐)min-­‐device-­‐pixel-­‐ratio
                             1.5	
  is	
  iPhone	
  4


Thursday, October 21, 2010
The	
  upside
                     • Scalability
                     • Altering	
  readability	
  &	
  the	
  interface
                             line-­‐height


                     • Great	
  for	
  design
                     • Hotness




Thursday, October 21, 2010
The	
  downside
                     • Screen	
  size?	
  (netbooks)
                     • Maintainability
                             http://stuffandn
                             onsense.co.uk/blog/about/hardboiled_css3_media_queries



                     • Support
                             http://www.themaninblue.com/experiment/ResolutionLayout/
                             http://code.google.com/p/css3-­‐mediaqueries-­‐js/




Thursday, October 21, 2010
Let’s	
  see	
  one




                   www.csskarma.com/presentations/cssla/screen


Thursday, October 21, 2010
The	
  future	
  
               state	
  of	
  
              detection


Thursday, October 21, 2010
Building	
  Interaction




Thursday, October 21, 2010
Progressive	
  Enhancement	
  
                             Timeline




Thursday, October 21, 2010
What	
  we	
  lose	
  with	
  touch




Thursday, October 21, 2010
What	
  we	
  lose	
  with	
  touch




Thursday, October 21, 2010
Thursday, October 21, 2010
Scouring	
  safari	
  developer	
  docs
                     • “Touch”	
  event	
  object
                     • A	
  butt-­‐load	
  of	
  gesture	
  events
                     • Kick	
  ass	
  demos
                             suuurrreee,	
  where	
  are	
  they?




Thursday, October 21, 2010
Touch	
  Detection.
                                        Building a rich interface




Thursday, October 21, 2010
The	
  “Touch”	
  event	
  object
                             if(window.Touch){

                                 // you’re good


                             } else {

                                 // you’re kinda lame


                             }


Thursday, October 21, 2010
Gesture	
  Events
                ontouchstart
                ontouchmove
                ontouchend
                ontouchcancel
                gesturestart
                gesturechange
                gestureend
                orientationchange




Thursday, October 21, 2010
Default	
  Behaviors




Thursday, October 21, 2010
Preventing	
  Default	
  Behaviors
     var elem = document.getElementById(‘thingy’);
     elem.addEventListener(‘touchstart’, touchStart, false);




     function touchstart(event){
               event.preventDefault();
     }




Thursday, October 21, 2010
Let’s	
  see	
  one




                   www.csskarma.com/presentations/cssla/detect


Thursday, October 21, 2010
Combining	
  Techniques.
                                          Creating the super-experience




Thursday, October 21, 2010
Media	
  Queries
                                       +
                             Touch	
  Detection
                                       =
                                      <3


Thursday, October 21, 2010
Let’s	
  see	
  one




                  www.csskarma.com/presentations/cssla/combo


Thursday, October 21, 2010
Fallbacks.
                                 Never forgetting about the little guy




Thursday, October 21, 2010
Build	
  it	
  backwards.




Thursday, October 21, 2010
Build	
  it	
  Backwards
     body{ /* boring crap */ }


     @media screen and (min-width:1px){
         /* exciting junk */
     }




Thursday, October 21, 2010
What we covered
                • Current	
  state
                 • Device	
  detection	
  (up	
  &	
  downsides)
                 • Screen	
  detection	
  (up	
  &	
  downsides)
                • Future	
  state
                 • Another	
  way
                 • Touch	
  detection
                 • Combining	
  techniques
                 • Fallbacks
Thursday, October 21, 2010
Resources
                     • Hardboiled	
  CSS	
  Media	
  Queries
                             http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries



                     • Mobile	
  detection	
  script
                             http://detectmobilebrowsers.mobi/



                     • Safari	
  developer	
  documentation
                             http://developer.apple.com/library/safari/navigation/



                     • Proportional	
  Leading
                             http://forabeautifulweb.com/blog/about/proportional_leading_with_css3_media_queries/



                     • Responsive	
  Web	
  Design
                             http://www.alistapart.com/articles/responsive-­‐web-­‐design/




Thursday, October 21, 2010
Real Life Example
                     • Netflix
                     • Yahoo!	
  Mobile
                     • Yahoo!	
  Sports




Thursday, October 21, 2010
Questions?



Thursday, October 21, 2010
Thanks!
                             e-­‐mail:	
  timwright@csskarma.com
                             twitter:	
  @csskarma
                             slides:	
  csskarma.com/presentations/cssla




Thursday, October 21, 2010

Contenu connexe

Similaire à Mobile, Media & Touch

Agile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYCAgile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYC
Chef Software, Inc.
 
Responsive Design for the Web
Responsive Design for the WebResponsive Design for the Web
Responsive Design for the Web
jonbuda
 
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP GroupDeveloping Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
minddog
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
rit2011
 

Similaire à Mobile, Media & Touch (20)

Scaling webappswithrabbitmq
Scaling webappswithrabbitmqScaling webappswithrabbitmq
Scaling webappswithrabbitmq
 
Agile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYCAgile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYC
 
Mars - ESUG 2010
Mars - ESUG 2010Mars - ESUG 2010
Mars - ESUG 2010
 
Responsive Design for the Web
Responsive Design for the WebResponsive Design for the Web
Responsive Design for the Web
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3
 
Jquery Introduction
Jquery IntroductionJquery Introduction
Jquery Introduction
 
Mobile Development with uPortal and Infusion
Mobile Development with uPortal and InfusionMobile Development with uPortal and Infusion
Mobile Development with uPortal and Infusion
 
Go! Go! Gadgets. Writing an OpenSocial Application
Go! Go! Gadgets.  Writing an OpenSocial ApplicationGo! Go! Gadgets.  Writing an OpenSocial Application
Go! Go! Gadgets. Writing an OpenSocial Application
 
PLNOG 5: Adam Jacob - Choose your own PLNOGventure
PLNOG 5: Adam Jacob - Choose your own PLNOGventurePLNOG 5: Adam Jacob - Choose your own PLNOGventure
PLNOG 5: Adam Jacob - Choose your own PLNOGventure
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
 
A Match Made In The Cloud
A Match Made In The CloudA Match Made In The Cloud
A Match Made In The Cloud
 
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP GroupDeveloping Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
 
Oc Cloud Obscurity
Oc Cloud ObscurityOc Cloud Obscurity
Oc Cloud Obscurity
 
HTML 5: The Future of the Web
HTML 5: The Future of the WebHTML 5: The Future of the Web
HTML 5: The Future of the Web
 
Blue light services - Emergency Services on a Smaller Budget
 Blue light services - Emergency Services on a Smaller Budget Blue light services - Emergency Services on a Smaller Budget
Blue light services - Emergency Services on a Smaller Budget
 
Reef - ESUG 2010
Reef - ESUG 2010Reef - ESUG 2010
Reef - ESUG 2010
 
Is these a bug
Is these a bugIs these a bug
Is these a bug
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 

Plus de Tim Wright

Keys to Responsive Design
Keys to Responsive DesignKeys to Responsive Design
Keys to Responsive Design
Tim Wright
 
Environmental Design Vol. 2
Environmental Design Vol. 2Environmental Design Vol. 2
Environmental Design Vol. 2
Tim Wright
 
Environmental Design on The Web
Environmental Design on The WebEnvironmental Design on The Web
Environmental Design on The Web
Tim Wright
 
Color & Typography
Color & TypographyColor & Typography
Color & Typography
Tim Wright
 
Design process
Design processDesign process
Design process
Tim Wright
 

Plus de Tim Wright (17)

An Introduction to HTTP/2
An Introduction to HTTP/2An Introduction to HTTP/2
An Introduction to HTTP/2
 
Assistive Technology, Experience Design, and Life
Assistive Technology, Experience Design, and LifeAssistive Technology, Experience Design, and Life
Assistive Technology, Experience Design, and Life
 
Building an Atomic Design System
Building an Atomic Design SystemBuilding an Atomic Design System
Building an Atomic Design System
 
Creating Contextual Applications with Maslow & The Device API
Creating Contextual Applications with Maslow & The Device APICreating Contextual Applications with Maslow & The Device API
Creating Contextual Applications with Maslow & The Device API
 
USC dot EDU: A Responsive Design Case Study
USC dot EDU: A Responsive Design Case StudyUSC dot EDU: A Responsive Design Case Study
USC dot EDU: A Responsive Design Case Study
 
Keys to Responsive Design
Keys to Responsive DesignKeys to Responsive Design
Keys to Responsive Design
 
Bringing Environmental Design to the Web
Bringing Environmental Design to the WebBringing Environmental Design to the Web
Bringing Environmental Design to the Web
 
Environmental Design Vol. 2
Environmental Design Vol. 2Environmental Design Vol. 2
Environmental Design Vol. 2
 
Environmental Design on The Web
Environmental Design on The WebEnvironmental Design on The Web
Environmental Design on The Web
 
Form design
Form designForm design
Form design
 
Color & Typography
Color & TypographyColor & Typography
Color & Typography
 
Design process
Design processDesign process
Design process
 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5
 
Implementing a Scalable Mobile Strategy
Implementing a Scalable Mobile StrategyImplementing a Scalable Mobile Strategy
Implementing a Scalable Mobile Strategy
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
Standardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web StandardsStandardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web Standards
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Mobile, Media & Touch

  • 1. Mobile, Media & Touch One guy’s opinion about CSS Media Queries & Mobile Detection Tim Wright | csskarma.com | @csskarma Thursday, October 21, 2010
  • 2. About me • Code  monkey  /  designer  at  USC • Blogger  on  CSSKarma • Writer  for  Smashing  Magazine  &  SitePoint • Avid  tweeter  under  @csskarma • Couch  potato Thursday, October 21, 2010
  • 3. What we’ll cover • Current  state • Device  detection  (up  &  downsides) • Screen  detection  (up  &  downsides) • Future  state • Another  way • Touch  detection • Combining  techniques • Fallbacks Thursday, October 21, 2010
  • 4. The  current   state  of   detection Thursday, October 21, 2010
  • 5. Device  Detection. Server-side, with PHP Thursday, October 21, 2010
  • 6. What  we’re  looking  for <?php echo $_SERVER['HTTP_USER_AGENT'] ?> Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en- US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/ 6.0.472.63 Safari/534.3 Thursday, October 21, 2010
  • 7. Server-­‐side  detection  code <?php //setting the variables $ipod = stripos($_SERVER['HTTP_USER_AGENT'],"ipod"); $iphone = stripos($_SERVER['HTTP_USER_AGENT'],"iphone"); $ipad = stripos($_SERVER['HTTP_USER_AGENT'],"ipad"); //detecting device if ($ipod == true || $iphone == true || $ipad == true){ echo "<p>Apple Touch Product</p>"; } else { echo "<p>Screen</p>"; } ?> Thursday, October 21, 2010
  • 8. The  upside • Speed • Support • Established  standard Thursday, October 21, 2010
  • 9. The  downside • Scalability • Maintainability • Established  standard Thursday, October 21, 2010
  • 10. Let’s  see  one www.csskarma.com/presentations/cssla/server Thursday, October 21, 2010
  • 11. Screen  Detection. CSS Media Queries Thursday, October 21, 2010
  • 12. What  are  they? Thursday, October 21, 2010
  • 13. Media  query  code Embedding @media screen and (min-width:320px) and (max-width:480px){ // styles here } Linking <link rel=”stylesheet” href=”mobile.css” media=”screen and (min-width:320px) and (max-width:480px)”> Thursday, October 21, 2010
  • 14. Property  options • print,  screen,  etc. • device-­‐aspect-­‐ratio • orientation portrait/landscape • color  (color  monitor/screen) • monochrome • min-­‐color-­‐index 256 • min  &  max  width • min  &  max  device  width • (-­‐webkit-­‐)min-­‐device-­‐pixel-­‐ratio 1.5  is  iPhone  4 Thursday, October 21, 2010
  • 15. The  upside • Scalability • Altering  readability  &  the  interface line-­‐height • Great  for  design • Hotness Thursday, October 21, 2010
  • 16. The  downside • Screen  size?  (netbooks) • Maintainability http://stuffandn onsense.co.uk/blog/about/hardboiled_css3_media_queries • Support http://www.themaninblue.com/experiment/ResolutionLayout/ http://code.google.com/p/css3-­‐mediaqueries-­‐js/ Thursday, October 21, 2010
  • 17. Let’s  see  one www.csskarma.com/presentations/cssla/screen Thursday, October 21, 2010
  • 18. The  future   state  of   detection Thursday, October 21, 2010
  • 20. Progressive  Enhancement   Timeline Thursday, October 21, 2010
  • 21. What  we  lose  with  touch Thursday, October 21, 2010
  • 22. What  we  lose  with  touch Thursday, October 21, 2010
  • 24. Scouring  safari  developer  docs • “Touch”  event  object • A  butt-­‐load  of  gesture  events • Kick  ass  demos suuurrreee,  where  are  they? Thursday, October 21, 2010
  • 25. Touch  Detection. Building a rich interface Thursday, October 21, 2010
  • 26. The  “Touch”  event  object if(window.Touch){ // you’re good } else { // you’re kinda lame } Thursday, October 21, 2010
  • 27. Gesture  Events ontouchstart ontouchmove ontouchend ontouchcancel gesturestart gesturechange gestureend orientationchange Thursday, October 21, 2010
  • 29. Preventing  Default  Behaviors var elem = document.getElementById(‘thingy’); elem.addEventListener(‘touchstart’, touchStart, false); function touchstart(event){ event.preventDefault(); } Thursday, October 21, 2010
  • 30. Let’s  see  one www.csskarma.com/presentations/cssla/detect Thursday, October 21, 2010
  • 31. Combining  Techniques. Creating the super-experience Thursday, October 21, 2010
  • 32. Media  Queries + Touch  Detection = <3 Thursday, October 21, 2010
  • 33. Let’s  see  one www.csskarma.com/presentations/cssla/combo Thursday, October 21, 2010
  • 34. Fallbacks. Never forgetting about the little guy Thursday, October 21, 2010
  • 36. Build  it  Backwards body{ /* boring crap */ } @media screen and (min-width:1px){ /* exciting junk */ } Thursday, October 21, 2010
  • 37. What we covered • Current  state • Device  detection  (up  &  downsides) • Screen  detection  (up  &  downsides) • Future  state • Another  way • Touch  detection • Combining  techniques • Fallbacks Thursday, October 21, 2010
  • 38. Resources • Hardboiled  CSS  Media  Queries http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries • Mobile  detection  script http://detectmobilebrowsers.mobi/ • Safari  developer  documentation http://developer.apple.com/library/safari/navigation/ • Proportional  Leading http://forabeautifulweb.com/blog/about/proportional_leading_with_css3_media_queries/ • Responsive  Web  Design http://www.alistapart.com/articles/responsive-­‐web-­‐design/ Thursday, October 21, 2010
  • 39. Real Life Example • Netflix • Yahoo!  Mobile • Yahoo!  Sports Thursday, October 21, 2010
  • 41. Thanks! e-­‐mail:  timwright@csskarma.com twitter:  @csskarma slides:  csskarma.com/presentations/cssla Thursday, October 21, 2010