SlideShare a Scribd company logo
1 of 76
YUI Mobile
Gonzalo Cordero
  @goonieiam
Agenda

• Intro, demo & design principles
• Deconstruction of a hybrid application
• Conclusion
YUI3 Mobile example
YUI3 Mobile example
pulldown event
YUI3 Mobile example
pulldown event   ScrollView module
YUI3 Mobile example
pulldown event   ScrollView module   touch-events + CSS3
YUI().use(“Intro”)
  “Use”
One       statement to rule them all
YUI().use(“Features”)

Those features you’re thinking about are not unique to
                        mobile
Touch
Gestures
Touch
  Gestures

 Transitions
Offline Cache
  History
YUI().use(“Constraints”
           )

    Neither are the constraints...
k-weight
run-time performance
  screen real estate
YUI 3
YUI 3
YUI 3
YUI().use(“Mobile”)

  Everything you need
   is already available.
1. Load & Delivery
YUI - Everything is a
        module
YUI().use(“Loader”)
YUI().use(“Loader”)
    Feature based loading
YUI().use(“Loader”)
    Feature based loading


    On demand loading
YUI().use(“Loader”)
    Feature based loading


    On demand loading


   Dependency calculation
YUI().use(“Loader”)
    Feature based loading


    On demand loading


   Dependency calculation


    Manual or Automatic
YUI().use(“Loader”)
Manual:
   use(“selector-native”,”transition-native”)
Automatic:
   use(“Node”) //This won’t load any of the
   IE6 stuff if the request comes from a
   phone.
YUI().use(“The best”)


 and it just about to get
      even better...
YUI().use(“Remote
     loader”)
  Feature based loading


  Dependency calculation


       Cache layer
2. Navigating in style
YUI().use(“Transition”)
YUI().use(“Transition”)
YUI().use(“Transition”)
YUI().use(“Transition”)

• Cross-Browser support
• Vendor prefixes
• Hardware acceleration(CSS3)
YUI().use(“Transition”)
    function Tedious () {

        node.style.WebkitTransitionProperty = 'left, top' ;

        node.style.WebkitTransitionDuration = '1s, 2s' ;

        node.style.WebkitTransitionTimingFunction = 'ease-
    out, ease-in' ;

        node.style.top = ‘100px’;

        node.style.left = ‘200px’;
}
YUI().use(“Transition”)
function NotTedious() {
  node.transition({
    left: {
       duration: 1,
       easing: 'ease-out',
       value: ‘200px’
    },
    top: {
       duration: 2,
       easing: 'ease-in',
       value: ‘100px’
  } });
}
3. Reacting to gestures
DragDrop           ScrollView

mouse move touch   mouse
                   move       touch
                               flick
DragDrop                      ScrollView

mouse move touch              mouse
                              move       touch
                                          flick


                   Gestures
DragDrop                          ScrollView

mouse move touch                  mouse
                                  move       touch
                                              flick


                       Gestures


        move

mouse          touch
DragDrop                          ScrollView

        move                      move           flick


                       Gestures


        move                              flick

mouse          touch              mouse          touch
YUI().use(“gestures”)
YUI.use(“event-flick”)
movieCarousel.on("flick", onMovieFlick, {
// only notify me if the flick covered
// more than 20px and was faster than 0.8px/ms
    minDistance:20,
    minVelocity:0.8,
    axis : “x”
});

function onMovieFlick (e) {
   //Go to the next movie
}
YUI().use(“event-
          move”)

• It provides a set of synthetic events to
  detect gestures
• gesturemovestart, gesturemove,
  gesturemoveend.
movieCarousel.delegate("gesturemovestart", function(e) {

    var item = e.currentTarget,
        swipeEnd,
        isSwipeLeft,
        swipeStart;

    item.setData("swipeStart", e.pageX);
    item.once("gesturemoveend", function(e) {

        swipeStart = item.getData("swipeStart");
        swipeEnd = e.pageX;
        isSwipeLeft = (swipeStart - swipeEnd) >
MIN_SWIPE;

          if (isSwipeLeft) {
              //Go to the previous movie
          } else {
             //Go to the next movie
          }
    });
YUI().use(“scrollview”)

• Provides scrollable content for touch
  enabled devices.
• Two plugins: ScrollViewScrollbars &
  ScrollViewPaginator
YUI().use(“scrollview”)
YUI().use(“scrollview”)
How to?
        <ul id=”movies”>
            <li>
                 <img src=”movie.jpeg”
alt=”somemovie”>
            </li>
        </ul>
YUI({...}).use("scrollview", function(Y){

 var scrollview = new Y.ScrollView({
         srcNode:"#movies",
         flick : {minVelocity:0.8},
         deceleration : 0.98,
         bounce: 0.1,
         width:"20em"
 });

});
4. Putting all the pieces
         together
YUI().use(“app”)

      Simple MVC framework for
     writing single-page Applications
YUI({up,up,down,down,left,right}).use(“controller”)
YUI().use(“controller”)

• Provides URL based page routing
• Bookmark-able
• Configurable
YUI().use(“controller”)
YUI().use(“controller”)
YUI().use(“controller”)
Example:
    var controller = new Y.Controller({
      root: '/yahoolocal',

      routes: [
        {path:             '/', callback: loadHome},
        {path:         '/save', callback: showSavedItems },
        {path: '/showSettings', callback: showSettings}
      ]
    });
Route callbacks

 req {
  params,
  path,
  query,
  next()
 }
Controller methods
        save
                   callback
route
                   function




        replace
route             newRoute
YUI().use(“model”)
YUI().use(“model”)


 Defines and manages the
    attributes of the
       application
YUI().use(“model”)

   Properties&Methods

              Sync


            Attributes

  Setters      Getters   change events
YUI().use(“model”)
          Load



          Sync



   save          share
YUI().use(“view”)
YUI().use(“views”)

Represents a renderable piece of an
  application's user interface, and
 provides hooks for easily handling
               events
Y.eventsView = Y.Base.create('eventsView', Y.View,
[], {

  container: '<ul class="eventsContainer"></ul>',

  template: '<li>{eventData}</li>',

  events: {

  },
  initializer: function () {
       //The initializer function will run when a view
is instantiated
  },
  render: function () {
     //The render function is responsible for
rendering the view to the page, react to UI changes
  }
}
});
YUI().use(“Widgets”)

  So YUI is the king of widgets....

  Where are my mobile widgets?!
YUI().use(“Gallery”)
        In the meantime...

    Got a cool idea? Build it!

   http://yuilibrary.com/gallery/
Final thoughts


• YUI3 is well suited for both Hybrid and
  Mobile web apps.
• Everything you need is already availble
YUI().use(“Thank you”)

          @goonieiam


        http://yuilibrary.com
    http://yuilibrary.com/theater/

More Related Content

Similar to YUI for Mobile - HTML5DevConf 11

Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ - Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Yuji Hato
 
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
NAVER Engineering
 
Creating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUICreating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUI
Gonzalo Cordero
 
Flash Lite & Touch: build an iPhone-like dynamic list
Flash Lite & Touch: build an iPhone-like dynamic listFlash Lite & Touch: build an iPhone-like dynamic list
Flash Lite & Touch: build an iPhone-like dynamic list
Small Screen Design
 

Similar to YUI for Mobile - HTML5DevConf 11 (20)

SwiftでUIKitDynamics
SwiftでUIKitDynamicsSwiftでUIKitDynamics
SwiftでUIKitDynamics
 
Replicating the Swipe Gesture iPhone Gallery for mobile web– HTML5 – Part 2
Replicating the Swipe Gesture iPhone Gallery for mobile web– HTML5 – Part 2Replicating the Swipe Gesture iPhone Gallery for mobile web– HTML5 – Part 2
Replicating the Swipe Gesture iPhone Gallery for mobile web– HTML5 – Part 2
 
004
004004
004
 
TechGarage Hackaton
TechGarage HackatonTechGarage Hackaton
TechGarage Hackaton
 
Fundamental JQuery
Fundamental JQueryFundamental JQuery
Fundamental JQuery
 
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ - Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
 
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
[TECHCON 2019: MOBILE - iOS]5.사용자 경험을 높이는 애니메이션 만들기
 
Creating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUICreating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUI
 
The Death of a Mouse
The Death of a MouseThe Death of a Mouse
The Death of a Mouse
 
3D Touch by Karol Kozub, Macoscope
3D Touch by Karol Kozub, Macoscope3D Touch by Karol Kozub, Macoscope
3D Touch by Karol Kozub, Macoscope
 
JQuery
JQueryJQuery
JQuery
 
Hack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurHack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT Kharagpur
 
Flash Lite & Touch: build an iPhone-like dynamic list
Flash Lite & Touch: build an iPhone-like dynamic listFlash Lite & Touch: build an iPhone-like dynamic list
Flash Lite & Touch: build an iPhone-like dynamic list
 
UI Dynamics
UI DynamicsUI Dynamics
UI Dynamics
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 
Ui kit dynamics(1)
Ui kit dynamics(1)Ui kit dynamics(1)
Ui kit dynamics(1)
 
Advance ui development and design
Advance ui  development and design Advance ui  development and design
Advance ui development and design
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
 
ev
evev
ev
 
The Pied Piper of Selenium
The Pied Piper of SeleniumThe Pied Piper of Selenium
The Pied Piper of Selenium
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

YUI for Mobile - HTML5DevConf 11

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n