SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
Can Media Queries Save Us All?



                       Presented by Tim Kadlec - @tkadlec




                                              http://flic.kr/p/6iMxyT
Friday, May 27, 2011
No*
                       *at least not by themselves




                                                     http://flic.kr/p/7DzC2S
Friday, May 27, 2011
So what’s the problem?




                                           http://flic.kr/p/6Jnxr1
Friday, May 27, 2011
She is.




                       http://flic.kr/p/7c8Nkq
Friday, May 27, 2011
So is this person...   So is the cat



                              http://flic.kr/p/7QPvjg
Friday, May 27, 2011
“         One of the interesting estimates is
                 that there are about 35 billion
                 devices connected to the Internet.
                 Soon, there will be so many that
                 we’ll stop counting.

                                         - Eric Schmidt



Friday, May 27, 2011
http://flic.kr/p/8PGKvr
Friday, May 27, 2011
Option #1: Ignore




                        http://flic.kr/p/coTdy
Friday, May 27, 2011
Option #2: Separate Sites




                                         http://flic.kr/p/8rWoUd
Friday, May 27, 2011
Slight Detour...




                                http://flic.kr/p/9i3TMD
Friday, May 27, 2011
How do we define mobile?




                                http://flic.kr/p/7Er6af
Friday, May 27, 2011
Text
Friday, May 27, 2011
Is this a mobile device?




Friday, May 27, 2011
Is this mobile use?

Friday, May 27, 2011
Form != Function




                                          Text
Friday, May 27, 2011
Option #2: Separate Sites




Friday, May 27, 2011
Option #3: Adapt

                                http://flic.kr/p/2LZPkH
Friday, May 27, 2011
http://www.alistapart.com/articles/responsive-web-design/


                                                                              Text
Friday, May 27, 2011
Friday, May 27, 2011
Device Classification
                       • By device type (feature phones, smart
                         phones, desktop, tv, tablets)

                       • By capabilities ((X)HTML, CSS,
                         Javascript)

                       • By UI mode (touch, pointer)
                       • By resolution
                       • Holistic approach
Friday, May 27, 2011
Don’t Get Too Granular




                                           http://flic.kr/p/99UEu4
Friday, May 27, 2011
/* base styles - optimized for desktop */

                 @media (max-width: 600px) {....}

                 @media (max-width: 400px) {....}

                 @media (min-width: 1300px) {....}




Friday, May 27, 2011
“The absence of
       support for @media
       queries is in fact the                                                        Hi!
       first @media query”




                http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu
Friday, May 27, 2011
Start with this




Friday, May 27, 2011
/* base styles - optimized for small screens */

                 @media (min-width: 400px) {
                 ....
                 }

                 @media (min-width: 600px) {
                 ....
                 }

                 @media (min-width: 1300px) {
                 ....
                 }

Friday, May 27, 2011
http://filamentgroup.com/lab/
                  respondjs_fast_css3_media_queries_for_internet_explorer_6_8_and_more/


                                                                                          Text
Friday, May 27, 2011
/* base styles - optimized for small screens */

                 @media (min-width: 400px) {
                 ....
                 }/*/mediaquery*/

                 @media (min-width: 600px) {
                 ....
                 }/*/mediaquery*/

                 @media (min-width: 1300px) {
                 ....
                 }/*/mediaquery*/


Friday, May 27, 2011
Performance




                         http://flic.kr/p/713QR9
Friday, May 27, 2011
58% of mobile users expect websites
                 to load as quickly, almost as quickly
                 or faster on their mobile phone,
                 compared to the computer they use
                 at home




Friday, May 27, 2011
http://www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/


                                                                      Text
Friday, May 27, 2011
Original Resized K Saved % Saved
                   Holmes      34.7K   8.1K    26.6K    76.6%
                   Watson      39.0K   8.4K    30.6K    78.4%
                   Mycroft     30.5K   6.7K    23.8K    78.0%
                   Moriarty    43.4K   8.2K    35.2K    81.1%
                    Adler      26.0K   6.6K    19.4K    74.6%
                   Winter      34.7K   7.8K    26.9K    77.5%
                    Total     208.3K   45.8K   162.5K   78.0%



Friday, May 27, 2011
Responsive Images



Friday, May 27, 2011
<img src='http://src.sencha.io/http://
                 mysite.com/myimage.png' alt='My image'/>

                 <img src='http://src.sencha.io/x50/http://
                 mysite.com/myimage.png' alt='My image'/>



                         http://docs.sencha.com/io/src/

Friday, May 27, 2011
Responsive Images Script



                       <img src="small.jpg?full=large.jpg">




               https://github.com/filamentgroup/Responsive-Images


Friday, May 27, 2011
Assets
                       Responsive Images



Friday, May 27, 2011
By Width


                       if (screen.width >= 320) {
                           // bring the hotness
                       }




Friday, May 27, 2011
By Media Query


                   if (matchMedia('only screen and
                     (max-width: 480px)').matches) {
                       // bring the hotness
                   }

                       https://github.com/paulirish/matchMedia.js/


Friday, May 27, 2011
By Some Combination


                       if (localStorage.supported &&
                         screen.width >= 320) {
                            //bring the hotness
                       }



Friday, May 27, 2011
Combine with Device Detection




                          He said
                          what?




                                    http://flic.kr/p/81vbku
Friday, May 27, 2011
http://flic.kr/p/3HMbN
Friday, May 27, 2011
Summary
                       • Device Classification
                       • Mobile First
                       • Resize Images - don’t just scale
                       • Responsive assets
                       • Pair with device detection
                       • Challenge traditional assumptions
Friday, May 27, 2011
Thank you!

    Tim Kadlec
    http://www.timkadlec.com
    Twitter: @tkadlec




                               http://flic.kr/p/7MhBfD
Friday, May 27, 2011
Sources
                       •   http://www.businessinsider.com/chart-of-the-day-pc-usage-2011-2

                       •   http://www.slideshare.net/OnDevice/the-mobile-only-internet-generation

                       •   http://www.comscore.com/Press_Events/Press_Releases/2011/1/Web-
                           based_Email_Shows_Signs_of_Decline_in_the_U.S._While_Mobile_Email_Usage_on_the_Ris
                           e

                       •   http://internet2go.net/news/data-and-forecasts/pew-85-us-adults-have-mobile-phones-
                           one-ten-high-earners-own-tablets

                       •   http://www.bulletbits.com/slow-sites-and-bad-press/

                       •   http://techcrunch.com/2011/01/25/eric-schmidt-at-dld11-google-will-add-1000-new-
                           employees-in-europe/

                       •   http://www.lukew.com/ff/entry.asp?1258

                       •   http://www.slideshare.net/Gomez_Inc/gomez-mobile-web-experience-survey-why-the-
                           mobile-web-is-disappointing-end-users




Friday, May 27, 2011

Contenu connexe

Similaire à Can Media Queries Save Us All?

让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端
lifesinger
 
[DCTPE2011] 7) Mobile Drupal(英/中雙語)
[DCTPE2011] 7) Mobile Drupal(英/中雙語)[DCTPE2011] 7) Mobile Drupal(英/中雙語)
[DCTPE2011] 7) Mobile Drupal(英/中雙語)
Drupal Taiwan
 
SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践
lifesinger
 
And suddenly I see ... IDC IT Security Brussels 2011
And suddenly I see ... IDC IT Security Brussels 2011And suddenly I see ... IDC IT Security Brussels 2011
And suddenly I see ... IDC IT Security Brussels 2011
wremes
 
Explorable Microscopy OSCon Talk 7/28/11
Explorable Microscopy OSCon Talk 7/28/11Explorable Microscopy OSCon Talk 7/28/11
Explorable Microscopy OSCon Talk 7/28/11
annerwright
 

Similaire à Can Media Queries Save Us All? (20)

The State of Front End Web Development 2011
The State of Front End Web Development 2011The State of Front End Web Development 2011
The State of Front End Web Development 2011
 
让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端
 
Txcto09short
Txcto09shortTxcto09short
Txcto09short
 
Networks and online journalism
Networks and online journalismNetworks and online journalism
Networks and online journalism
 
Mobile drupal: building a mobile theme
Mobile drupal: building a mobile themeMobile drupal: building a mobile theme
Mobile drupal: building a mobile theme
 
[DCTPE2011] 7) Mobile Drupal(英/中雙語)
[DCTPE2011] 7) Mobile Drupal(英/中雙語)[DCTPE2011] 7) Mobile Drupal(英/中雙語)
[DCTPE2011] 7) Mobile Drupal(英/中雙語)
 
Ember.js - scratching the surface
Ember.js - scratching the surfaceEmber.js - scratching the surface
Ember.js - scratching the surface
 
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
 
Feature Bits at LSSC10
Feature  Bits at LSSC10Feature  Bits at LSSC10
Feature Bits at LSSC10
 
2011 The Year of Web apps
2011 The Year of Web apps2011 The Year of Web apps
2011 The Year of Web apps
 
SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践
 
Campus Party 2010
Campus Party 2010Campus Party 2010
Campus Party 2010
 
Blog saisd
Blog saisdBlog saisd
Blog saisd
 
HTML XHTML HTML5
HTML XHTML HTML5HTML XHTML HTML5
HTML XHTML HTML5
 
Tim stone.html5.rjug.20110316
Tim stone.html5.rjug.20110316Tim stone.html5.rjug.20110316
Tim stone.html5.rjug.20110316
 
And suddenly I see ... IDC IT Security Brussels 2011
And suddenly I see ... IDC IT Security Brussels 2011And suddenly I see ... IDC IT Security Brussels 2011
And suddenly I see ... IDC IT Security Brussels 2011
 
Explorable Microscopy OSCon Talk 7/28/11
Explorable Microscopy OSCon Talk 7/28/11Explorable Microscopy OSCon Talk 7/28/11
Explorable Microscopy OSCon Talk 7/28/11
 
一秒間にソーシャルとモバイルで何が起きているか
一秒間にソーシャルとモバイルで何が起きているか一秒間にソーシャルとモバイルで何が起きているか
一秒間にソーシャルとモバイルで何が起きているか
 
Mobile apps using drupal as base system SumitK DrupalCon Chicago
Mobile apps using drupal as base system   SumitK DrupalCon ChicagoMobile apps using drupal as base system   SumitK DrupalCon Chicago
Mobile apps using drupal as base system SumitK DrupalCon Chicago
 
Scaling atlassian os v4
Scaling atlassian os v4Scaling atlassian os v4
Scaling atlassian os v4
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

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
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
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...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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...
 
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...
 

Can Media Queries Save Us All?

  • 1. Can Media Queries Save Us All? Presented by Tim Kadlec - @tkadlec http://flic.kr/p/6iMxyT Friday, May 27, 2011
  • 2. No* *at least not by themselves http://flic.kr/p/7DzC2S Friday, May 27, 2011
  • 3. So what’s the problem? http://flic.kr/p/6Jnxr1 Friday, May 27, 2011
  • 4. She is. http://flic.kr/p/7c8Nkq Friday, May 27, 2011
  • 5. So is this person... So is the cat http://flic.kr/p/7QPvjg Friday, May 27, 2011
  • 6. One of the interesting estimates is that there are about 35 billion devices connected to the Internet. Soon, there will be so many that we’ll stop counting. - Eric Schmidt Friday, May 27, 2011
  • 8. Option #1: Ignore http://flic.kr/p/coTdy Friday, May 27, 2011
  • 9. Option #2: Separate Sites http://flic.kr/p/8rWoUd Friday, May 27, 2011
  • 10. Slight Detour... http://flic.kr/p/9i3TMD Friday, May 27, 2011
  • 11. How do we define mobile? http://flic.kr/p/7Er6af Friday, May 27, 2011
  • 13. Is this a mobile device? Friday, May 27, 2011
  • 14. Is this mobile use? Friday, May 27, 2011
  • 15. Form != Function Text Friday, May 27, 2011
  • 16. Option #2: Separate Sites Friday, May 27, 2011
  • 17. Option #3: Adapt http://flic.kr/p/2LZPkH Friday, May 27, 2011
  • 20. Device Classification • By device type (feature phones, smart phones, desktop, tv, tablets) • By capabilities ((X)HTML, CSS, Javascript) • By UI mode (touch, pointer) • By resolution • Holistic approach Friday, May 27, 2011
  • 21. Don’t Get Too Granular http://flic.kr/p/99UEu4 Friday, May 27, 2011
  • 22. /* base styles - optimized for desktop */ @media (max-width: 600px) {....} @media (max-width: 400px) {....} @media (min-width: 1300px) {....} Friday, May 27, 2011
  • 23. “The absence of support for @media queries is in fact the Hi! first @media query” http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu Friday, May 27, 2011
  • 24. Start with this Friday, May 27, 2011
  • 25. /* base styles - optimized for small screens */ @media (min-width: 400px) { .... } @media (min-width: 600px) { .... } @media (min-width: 1300px) { .... } Friday, May 27, 2011
  • 26. http://filamentgroup.com/lab/ respondjs_fast_css3_media_queries_for_internet_explorer_6_8_and_more/ Text Friday, May 27, 2011
  • 27. /* base styles - optimized for small screens */ @media (min-width: 400px) { .... }/*/mediaquery*/ @media (min-width: 600px) { .... }/*/mediaquery*/ @media (min-width: 1300px) { .... }/*/mediaquery*/ Friday, May 27, 2011
  • 28. Performance http://flic.kr/p/713QR9 Friday, May 27, 2011
  • 29. 58% of mobile users expect websites to load as quickly, almost as quickly or faster on their mobile phone, compared to the computer they use at home Friday, May 27, 2011
  • 31. Original Resized K Saved % Saved Holmes 34.7K 8.1K 26.6K 76.6% Watson 39.0K 8.4K 30.6K 78.4% Mycroft 30.5K 6.7K 23.8K 78.0% Moriarty 43.4K 8.2K 35.2K 81.1% Adler 26.0K 6.6K 19.4K 74.6% Winter 34.7K 7.8K 26.9K 77.5% Total 208.3K 45.8K 162.5K 78.0% Friday, May 27, 2011
  • 33. <img src='http://src.sencha.io/http:// mysite.com/myimage.png' alt='My image'/> <img src='http://src.sencha.io/x50/http:// mysite.com/myimage.png' alt='My image'/> http://docs.sencha.com/io/src/ Friday, May 27, 2011
  • 34. Responsive Images Script <img src="small.jpg?full=large.jpg"> https://github.com/filamentgroup/Responsive-Images Friday, May 27, 2011
  • 35. Assets Responsive Images Friday, May 27, 2011
  • 36. By Width if (screen.width >= 320) { // bring the hotness } Friday, May 27, 2011
  • 37. By Media Query if (matchMedia('only screen and (max-width: 480px)').matches) { // bring the hotness } https://github.com/paulirish/matchMedia.js/ Friday, May 27, 2011
  • 38. By Some Combination if (localStorage.supported && screen.width >= 320) { //bring the hotness } Friday, May 27, 2011
  • 39. Combine with Device Detection He said what? http://flic.kr/p/81vbku Friday, May 27, 2011
  • 41. Summary • Device Classification • Mobile First • Resize Images - don’t just scale • Responsive assets • Pair with device detection • Challenge traditional assumptions Friday, May 27, 2011
  • 42. Thank you! Tim Kadlec http://www.timkadlec.com Twitter: @tkadlec http://flic.kr/p/7MhBfD Friday, May 27, 2011
  • 43. Sources • http://www.businessinsider.com/chart-of-the-day-pc-usage-2011-2 • http://www.slideshare.net/OnDevice/the-mobile-only-internet-generation • http://www.comscore.com/Press_Events/Press_Releases/2011/1/Web- based_Email_Shows_Signs_of_Decline_in_the_U.S._While_Mobile_Email_Usage_on_the_Ris e • http://internet2go.net/news/data-and-forecasts/pew-85-us-adults-have-mobile-phones- one-ten-high-earners-own-tablets • http://www.bulletbits.com/slow-sites-and-bad-press/ • http://techcrunch.com/2011/01/25/eric-schmidt-at-dld11-google-will-add-1000-new- employees-in-europe/ • http://www.lukew.com/ff/entry.asp?1258 • http://www.slideshare.net/Gomez_Inc/gomez-mobile-web-experience-survey-why-the- mobile-web-is-disappointing-end-users Friday, May 27, 2011