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

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Último (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

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