Procházet zdrojové kódy

Refactors and CSS fixes

piniphone před 13 roky
rodič
revize
3382ec2891

+ 43 - 82
example/navigation.html

@@ -20,110 +20,71 @@
 </head>
 
 <body>
-
-    <aside id="a">
-        <header data-title="aside a"></header>
-        <article class="list scroll active">
-            <ul>
-                <li>aaaa</li><li>bbbb</li><li>cccc</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-                <li>dddd</li><li>eeee</li><li>ffff</li>
-            </ul>
+    <aside id="a1">
+        <header data-title="a1"></header>
+        <article id="a1a1">
+            <h1>a1.a1</h1>
+        </article>
+        <article id="a1a2">
+            <h1>S1.A2</h1>
         </article>
     </aside>
 
-    <aside id="b">
-        <header data-title="aside b"></header>
-        <article></article>
+    <aside id="a2">
+        <header data-title="a2"></header>
+        <article id="a2a1">
+            <h1>a2.a1</h1>
+        </article>
     </aside>
 
-    <section id="zero" data-transition="slide" data-children="one" data-aside="a">
-        <header data-title="Zero">
+    <section id="s1" data-t-ransition="slide" data-children="one" data-aside="a1">
+        <header data-title="s1">
             <nav class="left">
-                <button data-icon="list" data-view-aside="a"></button>
+                <button data-icon="list" data-view-aside="a1"></button>
             </nav>
             <nav class="right">
-                <button data-icon="arrow-right" data-view-section="one"></button>
+                <button data-article="s1a1" data-view-article="s1a2" data-label="s1a2"></button>
+                <button data-article="s1a2" data-view-article="s1a1" data-label="s1a1"></button>
+                <button data-icon="arrow-right" data-view-section="s2"></button>
             </nav>
         </header>
-        <article id="zero-1" style="background: red">
-        </article>
-    </section>
-
-    <section id="one" data-transition="slide" data-children="two">
-        <header data-title="One" data-back="home">
-            <nav class="right">
-                <button data-icon="arrow-right" data-view-section="two">
-
-                </button>
-            </nav>
-        </header>
-        <article id="one-1" class="list scroll" style="background: green">
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas oUASY Iasi SUPi S oas </h1>
-        </article>
-    </section>
-    <section id="two" data-transition="slide" data-children="three">
-        <header data-back="home" data-title="Two">
-            <nav class="right">
-                <button data-icon="arrow-right" data-view-section="three"></button>
+        <article id="s1a1"><h1>S1.A1</h1></article>
+        <article id="s1a2"><h1>S1.A2</h1></article>
+        <footer>
+            <nav>
+                <a href="#" data-view-article="s1a2" data-icon="user" class="active"></a>
+                <a href="#" data-view-article="s1a1" data-icon="group"></a>
             </nav>
-        </header>
-        <article id="two-1" style="background: blue">
-            aaaa
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-            <h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1><h1>oUASY Iasi SUPi S oas </h1>
-        </article>
+        </footer>
     </section>
 
-    <section id="three" data-transition="slide" data-children="four">
-        <header data-back="home" data-title="Three">
-            <nav class="right">
-                <button data-icon="arrow-down" data-view-section="four"></button>
+    <section id="s2" data-transition="slide" data-children="one" data-aside="a1">
+        <header data-title="s2" data-back="home">
+            <nav class="left">
+                <button data-icon="list" data-view-aside="a1"></button>
             </nav>
-        </header>
-        <article id="three-1" style="background: brown">
-        </article>
-    </section>
-
-    <section id="four" data-transition="slide">
-        <header data-back="home" data-title="Four">
             <nav class="right">
-                <button data-icon="arrow-down" data-view-section="five"></button>
+                <button data-article="s2a1" data-view-article="s2a2" data-label="s2a2"></button>
+                <button data-article="s2a2" data-view-article="s2a1" data-label="s2a1"></button>
+                <button data-icon="arrow-right" data-view-section="s3"></button>
             </nav>
         </header>
-        <article id="four-1" style="background: purple">
-        </article>
+        <article id="s2a1"><h1>s2.A1</h1></article>
+        <article id="s2a2"><h1>s2.A2</h1></article>
     </section>
 
-    <section id="five" data-transition="slide">
-        <header data-back="home" data-title="Five">
+    <section id="s3" data-t-ransition="slide" data-children="one" data-aside="a2">
+        <header data-title="s3" data-back="home">
+            <nav class="left">
+                <button data-icon="list" data-view-aside="a2"></button>
+            </nav>
             <nav class="right">
-                <button data-icon="arrow-down" data-view-section="six"></button>
+                <button data-article="s3a1" data-view-article="s3a2" data-label="s3a2"></button>
+                <button data-article="s3a2" data-view-article="s3a1" data-label="s3a1"></button>
             </nav>
         </header>
-        <article id="five-1" style="background: pink"></article>
-    </section>
-
-    <section id="six" data-transition="slide">
-        <header data-back="home" data-title="Six"></header>
-        <article id="six-1" style="background: green"></article>
+        <article id="s3a1"><h1>s3.A1</h1></article>
+        <article id="s3a2"><h1>s3.A2</h1></article>
     </section>
 
     <!-- Lungo dependencies -->

+ 2 - 2
example/test.html

@@ -46,7 +46,7 @@
 
         <nav data-control="groupbar" data-os="android" data-article="folks">
             <a href="#" data-view-article="folks" data-label="Folks" data-count="11"></a>
-            <a href="#" data-view-article="products" data-async="static/articles/products.html" data-label="Products" id="products"></a>
+            <a href="#" data-view-article="products" data-async="static/articles/products.html" data-label="Products" ></a>
         </nav>
 
         <article id="folks" class="active list scroll indente-d">
@@ -110,7 +110,7 @@
         <footer data-os="ios">
             <nav>
                 <a href="#" data-view-article="folks" data-icon="desktop" data-count="11"></a>
-                <a href="#" data-view-article="products" data-icon="tablet" data-count="5"></a>
+                <a href="#" data-view-article="products" data-async="static/articles/products.html" data-icon="tablet" data-count="5"></a>
             </nav>
         </footer>
     </section>

+ 11 - 8
src/boot/Lungo.Boot.Events.coffee

@@ -6,6 +6,7 @@ Initialize the automatic DOM UI events
 
 @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
 @author Guillermo Pascual <pasku@tapquo.com> || @pasku1
+@author Ignacio Olalde <ina@tapquo.com> || @piniphone
 ###
 
 Lungo.Boot.Events = do(lng = Lungo) ->
@@ -28,9 +29,9 @@ Lungo.Boot.Events = do(lng = Lungo) ->
     lng.dom(C.QUERY.ASIDE_ROUTER).touch _onAside
     lng.dom(C.QUERY.MENU_ROUTER).touch _onMenu
     lng.dom(QUERY.MENU_HREF).touch _closeMenu
-    lng.dom(QUERY.CONTROL_CHECKBOX).on "change", _changeCheckboxValue
-    lng.dom(QUERY.SECTION_TRANSITION).on "webkitAnimationEnd", _sectionAnimationEnd
-    lng.dom(QUERY.SECTION_TRANSITION).on "animationend", _sectionAnimationEnd
+    lng.dom(QUERY.CONTROL_CHECKBOX).on C.EVENT.CHANGE, _changeCheckboxValue
+    for transition in C.EVENT.TRANSITION_END
+      lng.dom(QUERY.SECTION_TRANSITION).on transition, _onAnimationEnd
 
   _onSection = (event) ->
     event.preventDefault()
@@ -87,6 +88,7 @@ Lungo.Boot.Events = do(lng = Lungo) ->
     lng.dom("[data-view-menu=#{parent}] > .icon").attr "class", "icon " + el.data("icon")
 
   _changeCheckboxValue = (event) ->
+    #@TODO >> Refactor names
     event.preventDefault()
     el = lng.dom(this)
     input = el.find "input"
@@ -95,11 +97,12 @@ Lungo.Boot.Events = do(lng = Lungo) ->
     el.removeClass "checked"
     if checked  then el.addClass "checked"
 
-  _sectionAnimationEnd = (event) ->
+  _onAnimationEnd = (event) ->
     section = lng.dom(event.target)
-    section.removeClass(section.data(ATTRIBUTE.ANIMATION))
-    section.removeClass("show") unless section.data(ATTRIBUTE.STATE) is "active"
-    section.removeAttr "data-#{ATTRIBUTE.STATE}"
-    section.removeAttr "data-#{ATTRIBUTE.ANIMATION}"
+    direction = section.data(ATTRIBUTE.DIRECTION)
+    section.removeClass C.CLASS.SHOW if direction is "out" or direction is "back-out"
+    section.removeAttr "data-#{ATTRIBUTE.DIRECTION}"
+
+    # Activar/Desactivar los controles de la seccion activa: ASIDE
 
   init: init

+ 5 - 1
src/modules/Lungo.Constants.coffee

@@ -56,6 +56,10 @@ Lungo.Constants =
     LOAD                 : "load"
     UNLOAD               : "unload"
 
+  EVENT:
+    TRANSITION_END       : ["webkitAnimationEnd", "animationend"]
+    CHANGE               : "change"
+
   TRANSITION:
     DURATION             : 400
     ORIGIN               : "transition-origin"
@@ -78,7 +82,7 @@ Lungo.Constants =
     CHILDREN             : "children"
     TRANSITION           : "transition"
     STATE                : "state"
-    ANIMATION            : "animation"
+    DIRECTION            : "direction"
 
   BINDING:
     START                : "{{"

+ 23 - 144
src/modules/Lungo.Router.coffee

@@ -21,17 +21,15 @@ Lungo.Router = do (lng = Lungo) ->
   @param    {string} Id of the <section>
   ###
   section = (section_id) ->
-    outPage = lng.Element.Cache.section
-    if _notCurrentTarget(outPage, section_id)
+    current = lng.Element.Cache.section
+    if _notCurrentTarget(current, section_id)
       query = C.ELEMENT.SECTION + HASHTAG + section_id
-      inPage = if outPage then outPage.siblings(query) else lng.dom(query)
-      if inPage.length
-        if lng.DEVICE is C.DEVICE.PHONE and outPage?
-          transition = inPage.data(C.ATTRIBUTE.TRANSITION)
-          _setAnimation inPage, "#{transition}In", "active"
-          _setAnimation outPage, "#{transition}Out", ""
-
-        lng.Section.show outPage, inPage
+      future = if current then current.siblings(query) else lng.dom(query)
+      if future.length
+        if lng.DEVICE is C.DEVICE.PHONE and current?
+          _setSectionDirections future, current
+
+        lng.Section.show current, future
         lng.Router.step section_id
         do _url unless Lungo.Config.history is false
         do _updateNavigationElements
@@ -43,22 +41,19 @@ Lungo.Router = do (lng = Lungo) ->
   ###
   back = ->
     do _removeLast
-    outPage = lng.Element.Cache.section
+    current = lng.Element.Cache.section
     query = C.ELEMENT.SECTION + HASHTAG + history()
-    inPage = outPage.siblings(query)
+    future = current.siblings(query)
     if lng.DEVICE is C.DEVICE.PHONE
       do lng.Aside.hide
-      transition = outPage.data(C.ATTRIBUTE.TRANSITION)
-      _setAnimation inPage, "#{transition}InBack", "active"
-      _setAnimation outPage, "#{transition}OutBack", ""
-      if inPage.hasClass("aside") then lng.Aside.toggle()
+      _setSectionDirections future, current, true
+      if future.hasClass("aside") then lng.Aside.toggle()
 
-    lng.Section.show outPage, inPage
+    lng.Section.show current, future
     do _url unless Lungo.Config.history is false
     do _updateNavigationElements
 
 
-
   ###
   Displays the <article> in a particular <section>.
   @method   article
@@ -99,9 +94,12 @@ Lungo.Router = do (lng = Lungo) ->
   ###
   _notCurrentTarget = (current, id) -> current?.attr(C.ATTRIBUTE.ID) isnt id
 
-  _setAnimation = (section, animation, state) ->
-    section.data(C.ATTRIBUTE.STATE, state).data(C.ATTRIBUTE.ANIMATION, animation)
-    section.addClass("show").addClass(animation)
+  _setSectionDirections = (future, current, isBack=false) ->
+    dirPrefix = if isBack then "back-" else ""
+    future.addClass(C.CLASS.SHOW)
+    future.data(C.ATTRIBUTE.DIRECTION, "#{dirPrefix}in") if future.data(C.TRANSITION.ATTR)
+    if current.data(C.TRANSITION.ATTR) then current.data(C.ATTRIBUTE.DIRECTION, "#{dirPrefix}out")
+    else current.removeClass(C.CLASS.SHOW)
 
   _url = ->
     _hashed_url = ""
@@ -111,136 +109,17 @@ Lungo.Router = do (lng = Lungo) ->
 
   _updateNavigationElements = ->
     article_id = lng.Element.Cache.article.attr C.ATTRIBUTE.ID
-
-    lng.dom(C.QUERY.ARTICLE_ROUTER).removeClass(C.CLASS.ACTIVE).filter("[data-view-article=#{article_id}]").addClass(C.CLASS.ACTIVE)
-
+    # Active visual signal for elements
+    links = lng.dom(C.QUERY.ARTICLE_ROUTER).removeClass(C.CLASS.ACTIVE)
+    links.filter("[data-view-article=#{article_id}]").addClass(C.CLASS.ACTIVE)
+    # Hide/Show elements in current article
     nav = lng.Element.Cache.section.find(C.QUERY.ARTICLE_REFERENCE).addClass C.CLASS.HIDE
     nav.filter("[data-article*='#{article_id}']").removeClass C.CLASS.HIDE
 
   _removeLast = -> _history.length -= 1
 
-
   section : section
   back    : back
   article : article
   history : history
   step    : step
-
-
-
-
-
-
-# Lungo.Router = do(lng = Lungo) ->
-#   C        = lng.Constants
-#   HASHTAG  = "#"
-#   _history = []
-
-
-#   ###
-#   Navigate to a <section>.
-#   @method   section
-#   @param    {string} Id of the <section>
-#   ###
-#   section = (section_id) ->
-#     current = lng.Element.Cache.section
-#     if _notCurrentTarget(current, section_id)
-#       query = C.ELEMENT.SECTION + HASHTAG + section_id
-#       target = if current then current.siblings(query) else lng.dom(query)
-#       if target.length > 0
-#         if lng.DEVICE is C.DEVICE.PHONE and current?
-#           current.siblings("#{C.ELEMENT.SECTION}.#{C.CLASS.LAST}").removeClass C.CLASS.LAST
-#           lng.Section.defineTransition target, current
-#           current.removeClass(C.CLASS.SHOW).addClass(C.CLASS.HIDE).addClass(C.CLASS.LAST)
-
-#         lng.Section.show current, target
-#         lng.Router.step section_id
-#         do _url if Lungo.Config.history
-#         do _updateNavigationElements
-
-
-#   ###
-#   Return to previous section.
-#   @method   back
-#   ###
-#   back = ->
-#     _removeLast()
-#     current = lng.Element.Cache.section
-#     query = C.ELEMENT.SECTION + HASHTAG + history()
-#     target = current.siblings(query)
-#     if lng.DEVICE is C.DEVICE.PHONE
-#       lng.Aside.hide()
-#       lng.Section.assignTransition target, target.data C.TRANSITION.ORIGIN
-#       current.removeClass(C.CLASS.SHOW).addClass(C.CLASS.HIDING)
-#       setTimeout (->
-#         current.removeClass(C.CLASS.HIDING)
-#       ), C.TRANSITION.DURATION
-#       if target.hasClass("aside") then lng.Aside.toggle()
-
-#     lng.Section.show current, target
-#     do _url if Lungo.Config.history?
-#     do _updateNavigationElements
-
-
-#   ###
-#   Displays the <article> in a particular <section>.
-#   @method   article
-#   @param    {string} <section> Id
-#   @param    {string} <article> Id
-#   ###
-#   article = (section_id, article_id, element) ->
-#     if _notCurrentTarget(lng.Element.Cache.article, article_id)
-#       lng.Router.section section_id
-#       target = lng.Element.Cache.section.find "##{article_id}"
-#       if target.length > 0
-#         lng.Element.Cache.article.removeClass(C.CLASS.ACTIVE).trigger C.TRIGGER.UNLOAD
-#         lng.Element.Cache.article = target.addClass(C.CLASS.ACTIVE).trigger(C.TRIGGER.LOAD)
-
-#         if element?.data(C.ATTRIBUTE.TITLE)?
-#           lng.Element.Cache.section.find(C.QUERY.TITLE).text element.data(C.ATTRIBUTE.TITLE)
-#         do _url if Lungo.Config.history
-#         do _updateNavigationElements
-
-
-#   ###
-#   Create a new element to the browsing history based on the current section id.
-#   @method step
-#   @param  {string} Id of the section
-#   ###
-#   step = (section_id) -> _history.push section_id if section_id isnt history()
-
-#   ###
-#   Returns the current browsing history section id.
-#   @method history
-#   @return {string} Current section id
-#   ###
-#   history = -> _history[_history.length - 1]
-
-
-#   ###
-#   Private methods
-#   ###
-#   _notCurrentTarget = (current, id) -> current?.attr(C.ATTRIBUTE.ID) isnt id
-
-#   _url = ->
-#     _hashed_url = ""
-#     _hashed_url += "#{section}/" for section in _history
-#     _hashed_url += lng.Element.Cache.article.attr "id"
-#     setTimeout (-> window.location.hash = _hashed_url), 0
-
-#   _updateNavigationElements = ->
-#     article_id = lng.Element.Cache.article.attr C.ATTRIBUTE.ID
-
-#     lng.dom(C.QUERY.ARTICLE_ROUTER).removeClass(C.CLASS.ACTIVE).filter("[data-view-article=#{article_id}]").addClass(C.CLASS.ACTIVE)
-
-#     nav = lng.Element.Cache.section.find(C.QUERY.ARTICLE_REFERENCE).addClass C.CLASS.HIDE
-#     nav.filter("[data-article*='#{article_id}']").removeClass C.CLASS.HIDE
-
-#   _removeLast = -> _history.length -= 1
-
-
-#   section : section
-#   back    : back
-#   article : article
-#   history : history
-#   step    : step

+ 19 - 20
src/stylesheets/__init.styl

@@ -1,30 +1,29 @@
 @import "CSSmethods/vendor.styl"
 
 /* CONSTANTS */
-HEADER_HEIGHT          = 45px
+HEADER_HEIGHT           = 45px
 
-ASIDE_WIDTH            = 264px
-ASIDE_WIDTH_SMALL      = 64px
-ASIDE_SMALL_ICON       = 48px
+ASIDE_WIDTH             = 264px
+ASIDE_WIDTH_SMALL       = 64px
+ASIDE_SMALL_ICON        = 48px
 
-DEFAULT_TRANSITION     = easeOutSine
-DEFAULT_TRANSITION     = easeInCubic
-DEFAULT_TRANSITION     = ease
-TRANSITION_TIME        = 800ms
+DEFAULT_TRANSITION      = easeOutSine
+DEFAULT_TRANSITION      = easeInCubic
+TRANSITION_TIME         = 400ms
 
-FONT_SIZE_TINY         = 11px
-FONT_SIZE_SMALL        = 0.9em
-FONT_size_normal       = 1.0em
-FONT_SIZE_BIG          = 1.2em
-FONT_SIZE_LARGE        = 1.4em
+FONT_SIZE_TINY          = 11px
+FONT_SIZE_SMALL         = 0.9em
+FONT_size_normal        = 1.0em
+FONT_SIZE_BIG           = 1.2em
+FONT_SIZE_LARGE         = 1.4em
 
 
-LIST_PADDING           = 14px
-LIST_PADDING_HORIZONTAL= (LIST_PADDING / 1.25)
+LIST_PADDING            = 14px
+LIST_PADDING_HORIZONTAL = (LIST_PADDING / 1.25)
 
-INDENT                 = 3%
+INDENT                  = 3%
 
-FORM_HEIGHT = 30px
-FORM_border          = 2px
-FORM_border_height   = FORM_HEIGHT + (FORM_border * 4)
-FORM_PROGRESS_HEIGHT = 12px
+FORM_HEIGHT             = 30px
+FORM_border             = 2px
+FORM_border_height      = FORM_HEIGHT + (FORM_border * 4)
+FORM_PROGRESS_HEIGHT    = 12px

+ 10 - 18
src/stylesheets/lungo.animation.cover.styl

@@ -4,24 +4,16 @@ TRANSLATE_Y = -18%
 TRANSLATE_Z = -150px
 ROTATE_X    = 20deg
 
-.coverIn
-  vendor(animation-name, coverIn)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-.coverOut
-  vendor(animation-name, coverOut)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: -1
-.coverInBack
-  vendor(animation-name, coverInBack)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: -1
-.coverOutBack
-  vendor(animation-name, coverOutBack)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
+[data-transition="cover"]
+  &[data-direction="in"]
+    vendor(animation-name, coverIn)
+  &[data-direction="out"]
+    vendor(animation-name, coverOut)
+  &[data-direction="back-in"]
+    vendor(animation-name, coverInBack)
+  &[data-direction="back-out"]
+    vendor(animation-name, coverOutBack)
+
 
 @keyframes coverIn
   from { transform: translateY(110%) }

+ 23 - 25
src/stylesheets/lungo.animation.slide.styl

@@ -2,39 +2,37 @@
 
 SCALE = .8
 
-.slideIn
-  vendor(animation-name, slideIn)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: 3
-.slideOut
-  vendor(animation-name, backOut)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: -1
-.slideInBack
-  vendor(animation-name, backIn)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: -1
-.slideOutBack
-  vendor(animation-name, slideOutBack)
-  vendor(animation-duration, TRANSITION_TIME)
-  vendor(animation-timing-function, DEFAULT_TRANSITION)
-  z-index: 3
+[data-transition="slide"]
+  &[data-direction="in"]
+    vendor(animation-name, slideIn)
+  &[data-direction="out"]
+    vendor(animation-name, slideOut)
+  &[data-direction="back-in"]
+    vendor(animation-name, slideBackIn)
+  &[data-direction="back-out"]
+    vendor(animation-name, slideBackOut)
 
 @keyframes slideIn
   from { transform: translateX(100%) }
   to   { transform: translateX(0) }
 
-@keyframes slideOutBack
+@keyframes slideOut
+  from { transform: scale(1) }
+  to   { transform: scale(SCALE) }
+
+@keyframes slideBackOut
   from { transform: translateX(0) }
   to   { transform: translateX(100%) }
 
-@keyframes backIn
+@keyframes slideBackIn
   from { transform: scale(SCALE) }
   to   { transform: scale(1) }
 
-@keyframes backOut
-  from { transform: scale(1) }
-  to   { transform: scale(SCALE) }
+
+// @keyframes slideOut
+//   from { transform: scale(1) }
+//   to   { transform: translateZ(-200px) rotateX(20deg); opacity: 0.1 }
+
+// @keyframes slideBackIn
+//   from { transform: translateZ(-200px) rotateX(20deg); opacity: 0.1 }
+//   to   { transform: scale(1) }

+ 16 - 16
src/stylesheets/lungo.layout.styl

@@ -82,25 +82,25 @@ body
   /* ========================================================================= */
   /* ================================ SECTION ================================ */
   /* ========================================================================= */
-  // & > section
-  //   z-index: 2
-  //   width: inherit
-  //   &:not(.show)
-  //     z-index: 1
+  & > section
+    z-index: 2
+    width: inherit
+    &:not(.show)
+      z-index: 1
 
   /* ========================================================================= */
   /* ================================= ASIDE ================================= */
   /* ========================================================================= */
-  // & > aside
-  //   width: ASIDE_WIDTH
-  //   display: none
-  //   z-index: -1
-  //   &.active, &.show
-  //     display-box()
-  //   &.show
-  //     z-index: 0
-  //   &.right
-  //     right: 0px
+  & > aside
+    width: ASIDE_WIDTH
+    display: none
+    z-index: -1
+    &.active, &.show
+      display-box()
+    &.show
+      z-index: 0
+    &.right
+      right: 0px
 
   /* ========================================================================= */
   /* =============================== EXCLUDE OS ============================== */
@@ -116,4 +116,4 @@ body
       display: none
   &[data-os=firefoxos]
     & [data-os=android], [data-os=ios], [data-os=blackberry]
-      display: none
+      display: none

+ 27 - 102
src/stylesheets/lungo.media.phone.styl

@@ -2,114 +2,39 @@
 
 /* ==== Any phone ==== */
 @media only screen and (max-width: 767px)
-
   body
     vendor(perspective, 800px)
     vendor(transform-style, preserve-3d)
-    overflow: hidden
 
-    & > section
-      // overflow: hidden
-      display-box()
-      vendor(transform, translate3d(0, 0, 0))
-      vendor(backface-visibility, hidden)
+    &[data-position="absolute"] > section
       position: absolute
-      width: 100%
-      height: 100%
-      top: 0
-      left: 0
-      z-index: 2
-      visibility: hidden
-      &.show
-        visibility: visible
+    &[data-position="fixed"] > section
+      position: fixed
 
     & > aside
-      width: ASIDE_WIDTH
       position: absolute
-      z-index: -1
-      top: 0
-      left: 0
-      visibility: hidden
-      &.show
-        visibility: visible
-
-
-  // body
-  //   &[data-position="absolute"] > section
-  //     position: absolute
-  //   &[data-position="fixed"] > section
-  //     position: fixed
-
-  //   & > aside
-  //     position: absolute
-
-  //   & > section
-  //     display: none
-  //     &:not([data-transition]).show
-  //       display: block
 
-  //     &.show.aside
-  //       &:not(.right)
-  //         transform translateX(ASIDE_WIDTH)
-  //       &.right
-  //         transform translateX(-(ASIDE_WIDTH))
-  //     &.show.hide
-  //       z-index: -1
-
-  //     &[data-transition]
-  //       display-box()
-  //       transition-property opacity, z-index, transform,        scale, opacity
-  //       transition-duration TRANSITION_TIME
-  //       transition-timing-function DEFAULT_TRANSITION
-  //       backface-visibility hidden
-
-  //     // Transition: SLIDE
-  //     &[data-transition="slide"]
-  //       visibility: visible
-  //       z-index: 2
-  //       &.show, &:first-child
-  //         transform translateX(0%)
-  //         z-index: 1
-  //       &:not(first-child)
-  //         transform translateX(100%)
-  //       &.hide
-  //         transform scale(0.9)
-  //         z-index: -1
-  //         &:not(.last)
-  //           opacity: 0
-  //           transition none !important
-  //         &.last
-  //           opacity: 0.5 !important
-
-  //     // Transition: COVER
-  //     &[data-transition="cover"]
-  //       transform translateY(100%)
-  //       &.show, &.hide
-  //         transform translateY(0%)
-  //       &.hide
-  //         transform scale(0.9)
-  //         z-index: -1
-  //         &:not(.last)
-  //           opacity: 0
-  //           visibility: hidden
-  //         &.last
-  //           opacity: 0.2
-
-  //     // Transition: POP
-  //     &[data-transition="pop"]
-  //       opacity: 0
-  //       transform scale(1.15)
-  //       &.show
-  //         transform scale(1)
-  //         opacity: 1
-  //       &.hide
-  //         transform scale(0.9)
-  //         opacity: 0
-
-  //     // Transition: FADE
-  //     &[data-transition="fade"]
-  //       opacity: 0
-  //       &:first-child, &.show
-  //         opacity: 1
-  //       &:hide
-  //         opacity: 0
+    & > section
+      display: none
+      &:not([data-transition]).show
+        display: block
+
+      &.show.aside
+        &:not(.right)
+          transform translateX(ASIDE_WIDTH)
+        &.right
+          transform translateX(-(ASIDE_WIDTH))
+      &.show.hide
+        z-index: -1
+
+      &[data-transition]
+        display-box()
+        // transition-property opacity, z-index, transform, scale, opacity
+        // transition-duration TRANSITION_TIME
+        // transition-timing-function DEFAULT_TRANSITION
+        backface-visibility hidden
+        vendor(animation-duration, TRANSITION_TIME)
+        vendor(animation-timing-function, DEFAULT_TRANSITION)
+        visibility: hidden
+        &.show
+          visibility: visible