350 likes | 439 Vues
Touch Your Application. Chris Love @ChrisLove Love2Dev.com. Who Am I. ASP.NET MVP ASP Insider Internet Explorer User Agent Author Speaker Tweaker, Lover of Web, JavaScript, CSS & HTML5 @ChrisLove Love2Dev.com. High Performance Single Page Web Applications. BUY NOW !.
E N D
Touch Your Application Chris Love @ChrisLove Love2Dev.com #devconnections
Who Am I • ASP.NET MVP • ASP Insider • Internet Explorer User Agent • Author • Speaker • Tweaker, Lover of Web, JavaScript, CSS & HTML5 • @ChrisLove • Love2Dev.com
High Performance Single Page Web Applications BUYNOW! • Responsive Design • Touch • Mobile First • SPA • Extensible, Scalable Architecture • Web Build and Workflow • Goes Really Fast! • ~395 Pages • 20 Chapters • $9.99 http://amzn.to/1a55L89
Slide Deck & Source Code • Slide Deck – http://slideshare.com/docluv • Source Code – http://github.com/docluv
Touch • Touch Is Not New • Mobile Devices Have Made Touch Common
Import Touch Design Considerations • Make Data Actionable • Make Actionable Items Easy to Touch • Provide Enough Margin between Touch Points to Eliminate Touch Error • Simple is often Better
Touch Guidelines • iOS Human Interface guidelines - http://bit.ly/UYh3Vh • Windows Phone Design and Interaction Guidelines - http://bit.ly/1nUhREj • Windows Store UI Guidelines Touch Interactions - http://bit.ly/1nUhTMg • Unbuntu - Designing for Finger UIs – http://bit.ly/1suY2s1 • Android Touch Feedback Guidelines - http://bit.ly/1nUi0HB • Guidelines for Building Touch Friendly Sites - http://bit.ly/1qqAFfh
Hover • There is Currently No Hover Event Related To Touch • This May Eventually Change • Internet Explorer Supports Tap + Hold to Trigger Hover Event • Always Provide Secondary, Touch Friendly Mechanism To Trigger Hover Actions
Touch Your Application • Content Must Be Touchable • Account for Fat Fingers • Support APIs • Mouse • Touch (Apple) • Pointer (MSFT & W3C)
Touch Your Application • The Average Human Finger is 11mm in Diameter • Fingers Range from 8mm -19mm • Baby to Large Man
Touch Your Application • Touch Points Need Margin • Or Separation From Neighbors
Touch Gestures • Pan • Pinch/Zoom • Swipe • Tap • Tap + Hold • Rotate
Touch-action • CSS Property to Help Determine How Touch is Handled • Auto • None • Pan-x • Pan-y • Can disable Auto-zoom • Enable Scrolling • http://bit.ly/Thlyc0
Scrolling Content overflow: scroll; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; -ms-scroll-chaining: none; -ms-scroll-translation: vertical-to-horizontal;
Scrollable Lists • Vertical • Horizontal • Momentum • Rubber band or Bounce Effect
Data Element Container Scroll View Container
<div class="xy-scroller-wrapper"> <div class="movie-poster-div movie-poster-grid"> <!– The wrapping element should have known width Assigned --> [Data Elements] </div> </div>
.x-scroller-wrapper, .xy-scroller-wrapper, .y-scroller-wrapper { /* properties */ } .x-scroller-wrapper { } .y-scroller-wrapper { } @media (min-width:600px) { .xy-scroller-wrapper { /* Adjust Rules from vertical to horizontal scroll */ } }
Input Modalities • Mouse • Touch • Pen • Non-Touch • Keyboard • Voice • Eye Tracking & Assistive Technologies
Input Modality APIs • Mouse • Touch • Patented By Apple • W3C http://bit.ly/SZEGee • Pointer • Created by Microsoft • http://bit.ly/1o0uxaO • Kinect
Mouse API • MouseDown • MouseUp • MouseOver • MouseMove • MouseEnter • MouseCancel • Click, etc • Multiple Buttons
Apple’s Touch API • TouchStart • TouchEnd • TouchMove • TouchCancel
Apple’s Gesture API • Rotate • Scale • http://bit.ly/SZFC2e • onGestureChange: function(e) { e.preventDefault(); e.target.style.webkitTransform = 'scale(' + e.scale + startScale + ') rotate(' + e.rotation + startRotation + 'deg)';}
Pointer Events • Created By Internet Explorer Team • Abstracts Mouse, Touch, Pen into Common API • W3C Standard http://bit.ly/1we8qmu • Public Domain, not Patented
Pointer Events • Pointerdown • Pointerup • Pointercancel • Pointermove • Pointerover • Pointerout • Pointerenter • Pointerleave • Gotpointercapture • lostpointercapture
MSGestureEvent • Similar to Apple’s Gesture Events • Scale • Rotate • http://bit.ly/1lIaqzJ
MSGestureEvent • MSGestureChange • MSGestureEnd • MSGestureHold • MSGestureStart • MSGestureTap • MSInertiaStart
Touch Libraries HammerJS - http://bit.ly/1kXXT6X HandJS – Pointer Events Polyfil http://bit.ly/1wduAFn DeepTissue – http://deeptissuejs.com
DeepTissue MOUSE TOUCH POINTERS
DeepTissue • Abstracts Touch & Mouse APIs • Abstracts Input Modality Gestures • http://deeptissuejs.com
DeepTissue var dt = deeptissue(".sgl-tap"); dt.tap(function (evt) { tl.textContent = "Single Tap\n" + tl.textContent; console.log(evt.type); console.log(evt.screenX); console.log(evt.screenY); });
INPUT TYPE=XXXX • New Input Types Drive On-Screen Keyboards • Drives Native Validation • Tel, email, url, number, etc
Rate with Mobile App: Rate This Session Now! Tell Us What You Thought of This Session Select the session from the Agenda or Speakers menus Select the Actions tab Click Rate Session Be Entered to WIN Prizes! Rate Using Our Website: Register at www.devconnections.com/logintoratesession Go to www.devconnections.com/ratesession Select this session from the list and rate it