Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Responsive Backbone

Responsive Backbone

Responsive design is the forward-thinking alternative to building out separate applications or relying on device-specific templates in your web application. But be careful, as organizing the many pieces of a modern RD app can become just as unwieldy. In this session, we learn the tools, tips, and tricks to organize your Backbone application gracefully without the sweat, and dispel common misunderstandings about RD.

To support this presentation a fully responsive Backbone application was created and open-sourced here: http://dontbreak.me/ source: https://github.com/BrainSwap/dontbreakme

Mauvis Ledford

June 01, 2012
Tweet

More Decks by Mauvis Ledford

Other Decks in Technology

Transcript

  1. Don’t Break the Chain 6 Open-source responsive Backbone app made

    just for you! h-ps://github.com/Brainswap/dontbreakme  
  2. What is Responsive Design? •  A flexible grid •  Flexible

    media (images, videos) •  Media queries •  Avoid declaring non-percentage widths Actually… Responsive Design is a mindset not a technology or methodology 7
  3. What is Responsive Design? •  Origins: Responsive Architecture *Image from

    http://www.archdaily.com/15014/ad-futures-4-sparc/ 8
  4. What is Responsive Design? 9 Don't get set into one

    form, adapt it and build your own, and let it grow, be like water […] You put water into a bottle it becomes the bottle; You put it in a teapot it becomes the teapot. Now water can flow or it can crash. Be water, my friend. Bruce Lee A Warrior's Journey (2000)
  5. Responsive design is •  Your data as water; everyone is

    holding containers •  Accessibility continued 10
  6. Argument against Designing Responsively 16 Responsive design just doesn’t work.

    … We’re looking at the ‘entrenched’ use case [for desktop users], the coffee- and-couch use case [for tablet users], the two-minute use case [for mobile phone users]. Kiran Prasad Director of Engineering, Mobile LinkedIn 95%  Web  view!  
  7. Wait, didn’t Facebook go native? 20 Zuckerberg: More people use

    Facebook on mobile web than on Android and iPhone combined. *  Source:  Mark  Zuckerberg,  Disrupt  SF,  September  2012.   •  Facebook’s native mobile web app was atrociously slow. •  Mobile and hybrid web apps like LinkedIn and Financial Times do not suffer the same issues. •  The addition of native iOS does not solve Facebook problem for non- iOS audience. •  Solution: Buy the world an iPhone or improve Facebook’s mobile web app (which they are actively doing.)
  8. Basecamp for mobile 22 Launched  9/12   37 Signals: Devices

    and platforms will come and go, but the web browser is here to stay.
  9. The magic equation 31 target / context = result …

    * 100 260  /  960  =  0.27083333333333  
  10. How do you make images bendy and flexy? 32 Many

    options for making media flex.
  11. Magic formula + media queries 35 http://www.dontbreak.me Media queries get

    you adjustable widths. Ems control vertical layout. ßSecret  sauce   ßSecret  sauce  
  12. Now that you know RD, let’s dive into some Responsive

    Backbone! 36 http://www.dontbreak.me •  Views •  Models •  Collections •  Routes •  *Templates First a quick primer. Backbone consists of:
  13. Backbone architecture 37 •  ./js/models/ •  ├── month.js •  └──

    user.js •  .js/collections/ •  └── months.js Models and collections Clone  the  code  at  h-ps://github.com/BrainSwap/dontbreakme  
  14. Backbone architecture 38 •  ./js/views/ •  ├── app •  │

    └── app.js •  ├── base.js •  ├── modals •  │ ├── about.js •  │ ├── base.js •  │ ├── login.js •  │ ├── settings.js •  │ └── signup.js •  ├── months •  │ └── months.js •  └── partials •  ├── footer.js •  ├── header.js •  └── month.js Views (inc. partials and modals) •  ./js/views/ •  ├── app •  ├── base.js •  ├── modals •  ├── months •  └── partials Clone  the  code  at  h-ps://github.com/BrainSwap/dontbreakme  
  15. Backbone architecture 39 CSS •  css/ •  ├── _base.scss • 

    ├── _mixins.scss •  ├── devices •  ├── features •  ├── helpers •  └── pages •  css/ •  ├── _base.scss •  ├── _mixins.scss •  ├── devices •  │ ├── _high-res.scss •  │ ├── _mobile-landscape.scss •  │ ├── _mobile-portrait.scss •  │ └── _tablet-portrait.scss •  ├── features •  │ ├── _feature-calendar.scss •  │ ├── _feature-header.scss •  │ ├── _feature-modal.scss •  │ └── _feature-spinner.scss •  ├── helpers •  │ └── _html5boilerplate.scss •  └── pages •  └── _page-app.scss Clone  the  code  at  h-ps://github.com/BrainSwap/dontbreakme  
  16. Backbone architecture 40 CSS •  css/ •  ├── _base.scss • 

    ├── _mixins.scss •  ├── devices •  ├── features •  ├── helpers •  └── pages
  17. Thanks and Resources! Books Responsive Web Design by Ethan Marcotte

    Responsive Web Design with HTML5 and CSS3 by Ben Frain Github projects: dontbreakme Mandible2 NodeInterval Feedback: [email protected] @krunkosaurus 42