SlideShare uma empresa Scribd logo
1 de 24
User Interface
Development with
Mulberry
Dan Imal • Boston Front End Developer Meetup • January 2012
Mulberry
makes mobile HTML5 app
development pleasant
We eat our own dogfood
Mobile can be
weird
Mulberry
normalizes it
Mobile App Weirdness

No overflow: scroll until iOS 5
Memory leaks
Jittery animations
<video> and <audio> broken on Android in
PhoneGap
etc., etc.
Mobile App UI is
different

Mobile apps have
different UI patterns from
the desktop


Application development
is hard
Mulberry provides a vocabulary
for creating common mobile
layouts and user interactions in a
maintainable way using a few
simple conventions
Sassy Stylesheets
                                      .component.image-scroller ol.indicator
                                      {
.component.image-scroller {             text-align: center;
  ol.indicator {                      }
    text-align: center;
                                      .component.image-scroller ol.indicator
        li {                          li {
          display: inline;              display: inline;
                                        color: white;
            &.active {                }
              color: $active-color;
            }                         .component.image-scroller ol.indicator
        }                             li.active {
    }                                   color: #666666;
}                                     }
Mixins
@mixin left($dist) {
  float: left;           #data {
  margin-left: $dist;      float: left;
}                          margin-left: 10px;
                         }
#data {
  @include left(10px);   #some-other-data {
}                          float: left;
                           margin-left: 20px;
#some-other-data {       }
  @include left(20px);
}
CSS2                                                      CSS3                              Sass
<div class="rnd">
                                                           .component.awesome-sauce {       .component.awesome-sauce {
    <span class="tr"></span>
        <!-- Content of div here -->
                                                             -moz-border-radius: 10px;        @include border-radius(10px);
    <span class="bl"></span>                                 -moz-border-radius: 10px;      }
    <span class="br"></span>                                 -webkit-border-radius: 10px;
</div>                                                       border-radius: 10px;
                                                           }
<style>
.rnd {
    background: #189034 url(img/rnd4.gif) no-repeat
-10px -10px;
    width: 30em;             /* must have a width for
IE6 (not necessarily fixed, but not "auto") */
    height: auto;
    position: relative;
    padding: 20px;
    overflow: hidden;        /* fix for ie 6 */
}


.tr, .bl, .br {
    position : absolute;
    width: 10px;
    height: 10px;
    display: block;
    background: transparent url(img/rnd4.gif) no-
repeat;
    overflow: hidden;        /* fix for ie 6 */
}


/* fix for IE 6 - alternatively this can be placed in
an IE6 conditional comment/css */
* html .bl, * html .br, * html .tr { margin: 0 -1px
-1px 0; }


.tr { background-position: 0 -10px; top: 0; right: 0; }
.bl { background-position: -10px 0; bottom: 0; left:
0; }
.br { right: 0; bottom: 0; }
</style>
The old problems are not
problems anymore

The new problem is
application structure
The Mulberry
  Vocabulary


             }
  Viewport

     Page         Containers
   Screens
   Regions


Components
             }   beep boop, etc.
Page



   Screens

       Region


   Region




       Region
images-and-text-phone:
  screens:
    - name: index
      regions:
      - className: page-nav
        components:
        - PageNav

      - className: image-gallery
        components:
        - ImageGallery

      - scrollable: true
        components:
        - ChildNodes
        - BodyText

    - name: detail
      regions:
      - className: header
        components:
        - DetailTitle

      - components:
        - ZoomableImageGallery
images-and-text-phone:             .page.images-and-text-phone {
  screens:                           .screen.index {
    - name: index                      @include flex-row-container;
      regions:
      - className: page-nav                .region.page-nav {
        components:                          @include fixed-flex-region;
        - PageNav                          }

      - className: image-gallery           .region.image-gallery {
        components:                          @include background-shadow;
        - ImageGallery
                                               .component.image-gallery {
      - scrollable: true                         // TODO: make awesome
        components:                            }
        - ChildNodes                       }
        - BodyText                     }
                                   }
    - name: detail
      regions:
      - className: header
        components:
        - DetailTitle

      - components:
        - ZoomableImageGallery
Dealing with changes in
application state

.screen.detail {
  .component.detail-title {
    @include fade-on(hidden);
  }
}
<body class="phone ios”>
  ...
  <li class="page node page-node-image_gallery
      images-and-text-phone">
    ...
  </li>
</body>
@touradev @mrdanimal
@rmurphey
mulberry.toura.com
bit.ly/toura-mulberry
bit.ly/toura-mulberry-demos
Components
 .component.image-gallery {
   .phone & {
     padding: 15px 0 15px 0;
   }

     .tablet & {
       padding: 15px 0 25px 0;
     }

     ol.indicator {
       .phone & {
         padding: 10px 0 0 0;
         margin-bottom: -10px;

             li {
               font-size: 40px;
             }
         }

         .tablet & {
           padding: 14px 0 0 0;
           margin-bottom: -20px;

             li {
               font-size: 60px;
             }
         }
     }
 }
The Building Blocks
Components are the smallest, discrete reusable
chunks of the user interface.
Containers are used to specify the arrangement and
interaction of components.
   Pages correspond to a unique URL. They contain
   one or more Screens and broker the interaction
   between them.
   Screens are a container for Regions and the expose
   an API for Pages to hide and show them.
   Regions are containers for components. They are
   normally styled as columns, rows, and provide basic
   structure for layout.
fixed height


horizontal swiper




 vertical scrolling
Mobile can be
weird
Mulberry
normalizes it

Mais conteúdo relacionado

Semelhante a User Interface Development with Mulberry

Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosMatteo Papadopoulos
 
Building the new AppExchange using Responsive Design
Building the new AppExchange using Responsive DesignBuilding the new AppExchange using Responsive Design
Building the new AppExchange using Responsive DesignSalesforce Developers
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando Gallego
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 
Refresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End StoryRefresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End StoryRachael L Moore
 
UIWebViewでつくるUI
UIWebViewでつくるUIUIWebViewでつくるUI
UIWebViewでつくるUIcocopon
 
SnapyX
SnapyXSnapyX
SnapyXekino
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpMiroslav Miskovic
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpMiroslav Miskovic
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpMiroslav Miskovic
 
Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobilepeychevi
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and ContainerOum Saokosal
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Binu Paul
 
Responsive layouts by Maqbool
Responsive layouts by MaqboolResponsive layouts by Maqbool
Responsive layouts by MaqboolNavin Agarwal
 

Semelhante a User Interface Development with Mulberry (20)

CSS3 pronti all'uso
CSS3 pronti all'usoCSS3 pronti all'uso
CSS3 pronti all'uso
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
Building the new AppExchange using Responsive Design
Building the new AppExchange using Responsive DesignBuilding the new AppExchange using Responsive Design
Building the new AppExchange using Responsive Design
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
Refresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End StoryRefresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End Story
 
Html5
Html5Html5
Html5
 
UIWebViewでつくるUI
UIWebViewでつくるUIUIWebViewでつくるUI
UIWebViewでつくるUI
 
SnapyX
SnapyXSnapyX
SnapyX
 
SnapyX - ParisJS
SnapyX - ParisJSSnapyX - ParisJS
SnapyX - ParisJS
 
Class 10
Class 10Class 10
Class 10
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press php
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press php
 
Posts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press phpPosts ‹ teslaecoenergy — word press php
Posts ‹ teslaecoenergy — word press php
 
Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobile
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and Container
 
Disruptive code
Disruptive codeDisruptive code
Disruptive code
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7
 
Responsive layouts by Maqbool
Responsive layouts by MaqboolResponsive layouts by Maqbool
Responsive layouts by Maqbool
 

Último

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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 DiscoveryTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
+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...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

User Interface Development with Mulberry

  • 1. User Interface Development with Mulberry Dan Imal • Boston Front End Developer Meetup • January 2012
  • 2. Mulberry makes mobile HTML5 app development pleasant
  • 3. We eat our own dogfood
  • 5. Mobile App Weirdness No overflow: scroll until iOS 5 Memory leaks Jittery animations <video> and <audio> broken on Android in PhoneGap etc., etc.
  • 6. Mobile App UI is different Mobile apps have different UI patterns from the desktop Application development is hard
  • 7. Mulberry provides a vocabulary for creating common mobile layouts and user interactions in a maintainable way using a few simple conventions
  • 8. Sassy Stylesheets .component.image-scroller ol.indicator { .component.image-scroller { text-align: center; ol.indicator { } text-align: center; .component.image-scroller ol.indicator li { li { display: inline; display: inline; color: white; &.active { } color: $active-color; } .component.image-scroller ol.indicator } li.active { } color: #666666; } }
  • 9. Mixins @mixin left($dist) { float: left; #data { margin-left: $dist; float: left; } margin-left: 10px; } #data { @include left(10px); #some-other-data { } float: left; margin-left: 20px; #some-other-data { } @include left(20px); }
  • 10. CSS2 CSS3 Sass <div class="rnd"> .component.awesome-sauce { .component.awesome-sauce {     <span class="tr"></span>         <!-- Content of div here --> -moz-border-radius: 10px; @include border-radius(10px);     <span class="bl"></span> -moz-border-radius: 10px; }     <span class="br"></span> -webkit-border-radius: 10px; </div> border-radius: 10px; } <style> .rnd {     background: #189034 url(img/rnd4.gif) no-repeat -10px -10px;     width: 30em;             /* must have a width for IE6 (not necessarily fixed, but not "auto") */     height: auto;     position: relative;     padding: 20px;     overflow: hidden;        /* fix for ie 6 */ } .tr, .bl, .br {     position : absolute;     width: 10px;     height: 10px;     display: block;     background: transparent url(img/rnd4.gif) no- repeat;     overflow: hidden;        /* fix for ie 6 */ } /* fix for IE 6 - alternatively this can be placed in an IE6 conditional comment/css */ * html .bl, * html .br, * html .tr { margin: 0 -1px -1px 0; } .tr { background-position: 0 -10px; top: 0; right: 0; } .bl { background-position: -10px 0; bottom: 0; left: 0; } .br { right: 0; bottom: 0; } </style>
  • 11. The old problems are not problems anymore The new problem is application structure
  • 12. The Mulberry Vocabulary } Viewport Page Containers Screens Regions Components } beep boop, etc.
  • 13.
  • 14. Page Screens Region Region Region
  • 15. images-and-text-phone: screens: - name: index regions: - className: page-nav components: - PageNav - className: image-gallery components: - ImageGallery - scrollable: true components: - ChildNodes - BodyText - name: detail regions: - className: header components: - DetailTitle - components: - ZoomableImageGallery
  • 16. images-and-text-phone: .page.images-and-text-phone { screens: .screen.index { - name: index @include flex-row-container; regions: - className: page-nav .region.page-nav { components: @include fixed-flex-region; - PageNav } - className: image-gallery .region.image-gallery { components: @include background-shadow; - ImageGallery .component.image-gallery { - scrollable: true // TODO: make awesome components: } - ChildNodes } - BodyText } } - name: detail regions: - className: header components: - DetailTitle - components: - ZoomableImageGallery
  • 17. Dealing with changes in application state .screen.detail { .component.detail-title { @include fade-on(hidden); } }
  • 18.
  • 19. <body class="phone ios”> ... <li class="page node page-node-image_gallery images-and-text-phone"> ... </li> </body>
  • 21. Components .component.image-gallery { .phone & { padding: 15px 0 15px 0; } .tablet & { padding: 15px 0 25px 0; } ol.indicator { .phone & { padding: 10px 0 0 0; margin-bottom: -10px; li { font-size: 40px; } } .tablet & { padding: 14px 0 0 0; margin-bottom: -20px; li { font-size: 60px; } } } }
  • 22. The Building Blocks Components are the smallest, discrete reusable chunks of the user interface. Containers are used to specify the arrangement and interaction of components. Pages correspond to a unique URL. They contain one or more Screens and broker the interaction between them. Screens are a container for Regions and the expose an API for Pages to hide and show them. Regions are containers for components. They are normally styled as columns, rows, and provide basic structure for layout.
  • 23. fixed height horizontal swiper vertical scrolling

Notas do Editor

  1. Intro, I&amp;#x2019;m Dan Imal, UX Dev at Toura. Thanks for coming out.\n\nI&amp;#x2019;m going to talk about the challenges we faced when developing a mobile app interface in HTML5, particularly UI problems, and some of the ways that Mulberry helps deal with them.\n\nI&amp;#x2019;m going to describe some of the high level concepts the Mulberry gives you, so you don&amp;#x2019;t have to think about low level stuff.\n\nHow many are designers who code? How many are coders who design?\n\n
  2. We&amp;#x2019;ve tried to reduce repetitive, boring stuff to a minimum. \n\nFor UI development, you code &gt; refresh &gt; repeat\n\nOnce you learn a few concepts and conventions, you can be surprisingly productive with Mulberry. Helps with repetitive tasks.\n\nSolve nasty problems once.\nMake the computers do dumb stuff, so you can focus on interesting stuff.\n
  3. \n
  4. \n
  5. Mulberry does a lot behind the scenes to handle this and more.\n\nBut to be honest, other UI frameworks do too\n
  6. In a traditional web page, we generally don&amp;#x2019;t usually think about the viewport. \n\nWe use CSS3 flexible box model heavily to deal with this. Flex-box is weird, but we try to make normal.\n\nDeveloping maintainable applications with reusable parts is complicated. How do reuse code without creating a tangled mess of dependencies?\n
  7. Application logic in JS &amp; presentation logic in CSS\nThis vocabulary and set of abstractions let the application layer and presentation layer play nicely and remain decoupled\n\nWe don&amp;#x2019;t have a lot of abstractions for low level UI widgets like checkboxes. High level abstractions for high level problems \n
  8. Before describing how mulberry solves these problems, I need to quickly tell you about one of the tools we use\n\nWho has used Sass? \nSass is a CSS preprocessor, which just means that this is output by the processor as CSS.\n\n- nested selector syntax\n - let&amp;#x2019;s you be more explicit about the intention of the code, that you&amp;#x2019;re specifying the display of a particular component\n- it has variables\n- mixins\n
  9. Mixins let you reuse styles without forcing you to use a classname as a hook.\n\nWe give you a set of mixins that handle common mobile layout issues\n
  10. Now that we can create rounded corners (or whatever) in a sane way, it&amp;#x2019;s not that interesting technically. \n\nThis a case where we can focus on making something look good instead of worrying about all the implementation details.\n\n\n
  11. It&amp;#x2019;s less important to remember all those crazy hacks you had to do just to get simple things to work, and it becomes more important to structure of your application well.\n\nHow do you use all those new features in a reliable, reusable way? How do you write code that can be changed in a reliable way?\n\nIf you do a crazy hack, how can you keep it segregated in your codebase?\n\nHow do you craft your DOM so that your application code and presentational code are completely decoupled? \n\nThis is what mulberry helps with \n\nClear conventions and consistent DOM structure:\n- lets the application layer really not care about presentation\n- lets you scope your styles properly\n- gives the application layer and presentation layer a common vocabulary\n
  12. Containers are the skeleton\nComponents are the meat.\n
  13. This is the page I&amp;#x2019;m going to break down to describe the major concepts in a mulberry UI\n\nSHOW actual app in simulator. Demonstrate swiping, scrolling, switching screens\n
  14. \n
  15. The application layer takes that page definition and \nconstructs the dom in a consistent wat\nsets up / tears down event handlers\nkeeps scrollers working\ngives everything within the page an API for communicating with each other\n
  16. Once we have a consistent dom structure, we have a clear way of scoping all of our styles accordingly\n\nThe application layer (JS) and the presentation layer (CSS) are talking the same language, so the application layer can easily communicate it&amp;#x2019;s intentions to the presentation layer, but leave the implementation details up to the presentation layer.\n\nWe provide some Sass mixins for handling those layout issues I talked about earlier\n\nWithin the component, that&amp;#x2019;s where almost anything goes\n\nThis makes maintainability much easier, because you always know where to look to know how something is being styled. It&amp;#x2019;s never styled using JS.\n
  17. Point out header fading in on detail screen.\n\nThis is saying that you should apply this fade transition depending on whether the component is hidden.\n\nThe application is saying what it wants, and leaving it to the presentation layer to handle the rest.\n\nCSS3 gives you all kinds of crazy selectors to help style things based on application state.\n\nThis not yet in the framework. I&amp;#x2019;m working out the right abstraction and syntax, but this type of stuff will be coming. \n
  18. \n
  19. TODO: update text and image once I change url\n
  20. Those are the basic concepts in a Mulberry user interface. We&amp;#x2019;ve only scratched the surface.\nThanks, hope it was helpful\nMulberry is open source and in constant development\n- love to hear feadback, ideas, feature requests, bug reports\n\nQuestions?\n
  21. \n
  22. TODO: explain Page Definitions\n
  23. TODO: more stuff in bottom area to demonstrate scrolling.\nTODO: Remove sibling nav? or remove border explaining it because it&amp;#x2019;s wierd\n
  24. \n