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

Viewport Trickery (v1.0)

Viewport Trickery (v1.0)

Putting responsive UIs atop desktop-only sites.

Presented at MelbMobile on 05/08/2015

Jessica Stokes

August 05, 2015
Tweet

More Decks by Jessica Stokes

Other Decks in Technology

Transcript

  1. Bugherd • Needs to work on desktop and mobile sites

    • Responsive or not • On any device • Mobile browsers are liars • …for kinda reasonable reasons • position: fixed; // more-or-less useless on mobile
  2. New Bugherd • Simple layer over Stack, our task management

    product • Just buttons and an issue report UI • Mobile-compatible, day 1
  3. Solution? • Detect real zoom level and viewport position •

    Scale and position the whole UI to suit
  4. Viewporter • Tools for working with all sorts of browser

    viewports • getScaleFactor getMobileScaleFactor for zoom detection • getViewportCoordinates for viewport location • Demo at https://macropodhq.github.io/viewporter https://github.com/macropodhq/viewporter | https://git.io/vOlJ9
  5. PostCSS px to em • Makes your UI scalable •

    Pixel measurements become ems • Base font size, 16px by default • Designers developers work in pixels for precision https://github.com/macropodhq/postcss-px-to-em | https://git.io/vOlUr
  6. Jessica Stokes Cybersorceress jessicastokes.net | @ticky • Viewporter is available

    at https://git.io/vOlJ9 • PostCSS px to em is available at https://git.io/vOlUr • Go make something cool with them!