SlideShare uma empresa Scribd logo
1 de 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/

Mais conteúdo relacionado

Semelhante a YUI for Mobile - HTML5DevConf 11

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 2Joseph Khan
 
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 YUIGonzalo Cordero
 
The Death of a Mouse
The Death of a MouseThe Death of a Mouse
The Death of a MouseGeert Bevin
 
3D Touch by Karol Kozub, Macoscope
3D Touch by Karol Kozub, Macoscope3D Touch by Karol Kozub, Macoscope
3D Touch by Karol Kozub, MacoscopeMacoscope
 
Hack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurHack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurSumana Hariharan
 
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 listSmall Screen Design
 
UI Dynamics
UI DynamicsUI Dynamics
UI DynamicsSV.CO
 
Advance ui development and design
Advance ui  development and design Advance ui  development and design
Advance ui development and design Rakesh Jha
 
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, PepperDroidConTLV
 

Semelhante a 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
 

Último

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

YUI for Mobile - HTML5DevConf 11

Notas do Editor

  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