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

前端七年之路

kaiye
February 01, 2013

 前端七年之路

给上海1号店前端团队的分享

kaiye

February 01, 2013
Tweet

More Decks by kaiye

Other Decks in Technology

Transcript

  1. MOBILE INCH RESOLUTION PPI DPR iPhone 3gs iPhone 4 iPhone

    4s iPhone 5 Android LDPI Android MDPI Android HDPI Android XDPI Windows Phone7 3.5 320x480 163 1 3.5 640x960 326 2 3.5 640x960 326 2 4 640x1136 326 2 3.2 240x320 120 0.75 3.2 320x480 160 1 3.7 480x800 240 1.5 4.7 1280x768 320 2 3.5/3.8/4.3 480x800 160 1 尺寸/分辨率/PPI/Retina
  2. .class { /* 假设 img.png = 320x480px */ ! background:url(img.png)

    no-repeat 0 0; ! background-size:320px auto; } @media screen and (-webkit-min-device-pixel-ratio:1.5) { .class { background-image:url([email protected]); /* 480x720 */} } @media screen and (-webkit-min-device-pixel-ratio:2) { ! .class { background-image:url([email protected]); /* 640x960 */} } http://yekai.net/demo/background-position.html
  3. DEBUG FRAMEWORK SUPPORTED TARGET PALTFORM SUPPORTED PANELS Weinre Jsconsole Aardwolf

    WebKit Remote Debugging protocol Chrome v8 debugger protocol DragonFly Iphone app (JSConsole app or Bugaboo) UCweb browser dev (android) Ios4+, android, other webkit Weinre Ios4.2+, android2.2.2+, webos Jsconsole Ios, android, WinPhone 7, BlackBerry OS 6+ Aardwolf webkit(pc) WebKit Remote Debugging protocol V8 javascript engine Chrome v8 debugger protocol Opera mobile DragonFly Ios Iphone app (JSConsole app or Bugaboo) Ucweb android only UCweb browser dev (android)
  4. DEBUG • iOS6 Remote Debug 需要iOS6/Mac/Safari/USB or Wifi • Chrome

    Dev Tools 本地调试阶段,模拟UA • Weinre 支持Win/Mac/Linux 支持Android/iOS 需要搭建服务器环境 • Proxy + Fiddler 请求抓包
  5. TIPS • 充分利用CSS3 / HTML5 / Feature ::before / ::after

    / transform <input type=”email” /> Smart App Banners • 禁止选中等 -webkit-user-select:none;user-select:none; 禁止长按链接后的处理 -webkit-touch-callout:none; 禁止电话号码显示 <meta name="format-detection" content="telephone=no"/> • 性能问题 使用canvas+dataURI+localStorage保存图片 减少DOM嵌套,图片数量 CSS3 transform卡顿问题 -webkit-backface-visibility:hidden;
  6. 肩膀 • 《朋友网touch版项目分享》 by 小李刀刀 • 《Rethink - Mobile Web

    Rebuild》 by seektan • 《终端开发技巧分享》 by hertzhu • 《朋友网触屏版开发分享》 by woodsrong
  7. Cache • 离线存储与本地存储 MANIFEST LocalStorage / UserData • 长Cache Cache-Control:

    max-age=31536000 • AJAX缓存 • 服务器缓存 反向代理缓存 / CMEM Cache