Javi Jimenez Villar 13 лет назад
Родитель
Сommit
a7eb23a6b1

+ 12 - 8
example/static/articles/list.html

@@ -121,8 +121,12 @@
             <strong>&lt;li .cancel&gt; + &lt;strong&gt; </strong>
             <small>&lt;small&gt;</small>
         </li>
-        <li class="secondary">
-            <strong>&lt;li .secondary&gt; + &lt;strong&gt; </strong>
+        <li class="warning">
+            <strong>&lt;li .warning&gt; + &lt;strong&gt; </strong>
+            <small>&lt;small&gt;</small>
+        </li>
+        <li class="color">
+            <strong>&lt;li .color&gt; + &lt;strong&gt; </strong>
             <small>&lt;small&gt;</small>
         </li>
     </ul>
@@ -240,10 +244,6 @@
         </li>
 
         <li class="anchor contrast">With colours</li>
-        <li class="theme">
-            <strong>&lt;li .theme&gt; + &lt;strong&gt; </strong>
-            <small>&lt;small&gt;</small>
-        </li>
         <li class="accept">
             <strong>&lt;li .accept&gt; + &lt;strong&gt; </strong>
             <small>&lt;small&gt;</small>
@@ -252,8 +252,12 @@
             <strong>&lt;li .cancel&gt; + &lt;strong&gt; </strong>
             <small>&lt;small&gt;</small>
         </li>
-        <li class="secondary">
-            <strong>&lt;li .secondary&gt; + &lt;strong&gt; </strong>
+        <li class="warning">
+            <strong>&lt;li .warning&gt; + &lt;strong&gt; </strong>
+            <small>&lt;small&gt;</small>
+        </li>
+        <li class="color">
+            <strong>&lt;li .color&gt; + &lt;strong&gt; </strong>
             <small>&lt;small&gt;</small>
         </li>
     </ul>

+ 5 - 5
example/static/sections/form.html

@@ -1,4 +1,3 @@
-
 <section id="form" data-transition="slide">
     <header data-title="Form Elements" data-back="home">
         <nav class="right">
@@ -139,7 +138,7 @@
         </div>
     </article>
 
-    <article id="form-special" class=" indented scroll">
+    <article id="form-special" class="indented scroll">
         <div class="form" >
             <label>Specials</label>
             <fieldset data-icon="search">
@@ -185,10 +184,10 @@
                     <div data-control-checkbox="normal"></div>
                 </div>
                 <div>
-                    <div data-control-checkbox="twit-example" class="twitter"></div>
+                    <div data-control-checkbox="twit-example" class="icon twitter accept"></div>
                 </div>
                 <div>
-                    <div data-control-checkbox="ok-example" class="ok"></div>
+                    <div data-control-checkbox="ok-example" class="icon ok cancel"></div>
                 </div>
             </div>
             <br/>
@@ -196,7 +195,8 @@
             <button class="anchor margin-bottom" data-label="Normal"></button>
             <button class="anchor accept margin-bottom" data-icon="ok" data-label="Accept"></button>
             <button class="anchor cancel margin-bottom" data-icon="remove" data-label="Cancel"></button>
-            <button class="anchor secondary margin-bottom" data-icon="plus" data-label="Secondary"></button>
+            <button class="anchor warning margin-bottom" data-icon="remove" data-label="Warning"></button>
+            <button class="anchor color margin-bottom" data-icon="plus" data-label="Color"></button>
             <button class="anchor disabled" data-label="Disabled"></button>
         </div>
     </article>

+ 13 - 202
example/test.html

@@ -21,208 +21,7 @@
 <body class="app">
 
 
-<section id="form" data-transition="slide">
-    <header data-title="Form Elements" data-back="home">
-        <nav class="right">
-            <button data-label="test"></button>
-            <button data-icon="edit"></button>
-        </nav>
-    </header>
-
-    <nav data-control="groupbar">
-        <a href="#" data-view-article="form-normal" data-label="Normal" class="active"></a>
-        <a href="#" data-view-article="form-indented" data-label="Indented"></a>
-        <a href="#" data-view-article="form-special" data-label="Specials"></a>
-    </nav>
-
-    <article id="form-normal" class="scroll">
-        <div class="form">
-            <!-- LABEL + INPUT -->
-            <fieldset>
-                <label>label</label>
-                <input type="text" placeholder="value">
-
-                <label>label</label>
-                <input type="text" placeholder="value on right" class="text align_right error">
-
-                <label class="absolute">label</label>
-                <input type="text" placeholder="value on center" class="large text  bold align_center">
-
-                <label>label</label>
-                <label class="select ">
-                    <select class="custom">
-                        <option value="1">HTML5 Jedi</option>
-                        <option value="2">Two</option>
-                        <option value="3">Three</option>
-                    </select>
-                </label>
-
-                <label>label</label>
-                <input type="date" class="align_right" placeholder="Select finish" value="10/04/1980"/>
-            </fieldset>
-
-
-            </fieldset>
-            <!-- INPUT -->
-            <fieldset>
-                <input type="text" id="description" class="text align_center" placeholder="value"/>
-            </fieldset>
-            <fieldset>
-                <textarea placeholder="Write something..."></textarea>
-            </fieldset>
-            <fieldset>
-                <label class="select">
-                    <select class="custom">
-                        <option value="1">HTML5 Jedi</option>
-                        <option value="2">Two</option>
-                        <option value="3">Three</option>
-                    </select>
-                </label>
-            </fieldset>
-
-            <fieldset>
-                <input type="date" class="align_right" placeholder="Select finish" value="10/04/1980"/>
-            </fieldset>
-
-            <fieldset>
-                <label class="anchor">label Lorem ipsum dolor sit amet</label>
-                 <div data-control-checkbox="check" class="inline right"></div>
-             </fieldset>
-
-            <fieldset data-icon="plus">
-                <label>label</label>
-                <input type="text" value="value" />
-            </fieldset>
-        </div>
-    </article>
-
-    <article id="form-indented" class="indented scroll">
-        <div class="form">
-            <!-- LABEL + INPUT -->
-            <label>label +  input</label>
-            <fieldset class="radius shadow">
-                <label>label</label>
-                <input type="text" placeholder="value">
-
-                <label>label</label>
-                <input type="text" placeholder="value on right" class="text align_right error">
-
-                <label class="absolute">label</label>
-                <input type="text" placeholder="value on center" class="large text align_center">
-
-                <label>label</label>
-                <label class="select ">
-                    <select class="custom">
-                        <option value="1">HTML5 Jedi</option>
-                        <option value="2">Two</option>
-                        <option value="3">Three</option>
-                    </select>
-                </label>
-
-                <label>label</label>
-                <input type="date" class="align_right" placeholder="Select date" value="10/04/1980"/>
-            </fieldset>
-
-            <!-- INPUT -->
-            <label>input</label>
-            <fieldset class="radius-top">
-                <input type="text" id="description" class="text align_center" placeholder="value"/>
-            </fieldset>
-            <fieldset>
-                <textarea placeholder="Write something..."></textarea>
-            </fieldset>
-            <fieldset>
-                <label class="select">
-                    <select class="custom">
-                        <option value="1">HTML5 Jedi</option>
-                        <option value="2">Two</option>
-                        <option value="3">Three</option>
-                    </select>
-                </label>
-            </fieldset>
-
-
-            <fieldset>
-                <label class="anchor">label Lorem ipsum dolor sit amet</label>
-                <div data-control-checkbox="check_indent" class="inline right"></div>
-             </fieldset>
-
-
-            <fieldset class="radius-bottom shadow">
-                <input type="date" class="align_right" placeholder="Select finish" value="10/04/1980"/>
-            </fieldset>
-
-
-            <label>label + input +  icon</label>
-            <fieldset data-icon="plus">
-                <label>label</label>
-                <input type="text" value="value" />
-            </fieldset>
-        </div>
-    </article>
-
-    <article id="form-special" class=" indented scroll">
-        <div class="form" >
-            <label>Specials</label>
-            <fieldset data-icon="search">
-                <input type="search" placeholder="Search..."/>
-            </fieldset>
-
-
-            <label>Address</label>
-            <input type="text" placeholder="placeholder" class="border" />
-            <input type="text" placeholder="placeholder" class="border error" value="error" />
-            <input type="text" placeholder="placeholder" class="border success" value="success" />
-
-            <div class="layout horizontal">
-                <div data-layout="third">
-                    <label>Address</label>
-                    <input type="text" placeholder="placeholder" class="border" />
-                </div>
-                <div data-layout="primary">
-                    <label>Pin Code</label>
-                    <input type="password" value="value" class="border" disabled/>
-                </div>
-            </div>
-
-            <label>Select your skill</label>
-            <label class="select border">
-                <select>
-                    <option value="1">HTML5 Jedi</option>
-                    <option value="2">Two</option>
-                    <option value="3">Three</option>
-                </select>
-            </label>
-
-            <label>Progress</label>
-            <div id="progress-normal" data-progress="25%"></div>
-
-            <label>Range</label>
-            <input type="range" placeholder="type your name" min="0" max="8" />
-
-
-            <label>Checkbox</label>
-            <div class="layout horizontal">
-                <div>
-                    <div data-control-checkbox="normal"></div>
-                </div>
-                <div>
-                    <div data-control-checkbox="twit-example" class="twitter"></div>
-                </div>
-                <div>
-                    <div data-control-checkbox="ok-example" class="ok"></div>
-                </div>
-            </div>
-            <br/>
-
-            <button class="anchor margin-bottom" data-label="Normal"></button>
-            <button class="anchor accept margin-bottom" data-icon="ok" data-label="Accept"></button>
-            <button class="anchor cancel margin-bottom" data-icon="remove" data-label="Cancel"></button>
-            <button class="anchor secondary margin-bottom" data-icon="plus" data-label="Secondary"></button>
-            <button class="anchor disabled" data-label="Disabled"></button>
-        </div>
-    </article>
-</section>
+
 
     <section id="main" data-transition="slide" data-aside="features" data-children="folk">
         <header>
@@ -483,6 +282,18 @@
         });
 
         Lungo.ready(function() {
+
+            pull = new Lungo.Element.Pull('section#pull article', {
+                onPull: "Pull down to refresh",
+                onRelease: "Release to get new data",
+                onRefresh: "Refreshing...",
+                callback: function() {
+                    setTimeout(function(){
+                        pull.hide();
+                    }, 1000)
+                }
+            });
+
             // Lungo.Router.article("main", "sub");
             Lungo.Element.count("section#main nav #products", 5);
 

+ 16 - 17
src/stylesheets/theme/__init.styl

@@ -1,23 +1,22 @@
 @import "../CSSmethods/vendor.styl"
-
 /* -------------------------- COLOUR -------------------------- */
-COLOR           = #292929
-COLOR_theme     = #0093D5
-COLOR_success   = #2ecc71
-COLOR_cancel    = #e74c3c
-COLOR_secondary = #95a5a6
-COLOR_contrast  = COLOR
-BACKGROUND      = lighten(COLOR, 95%)
+THEME               = #3498db
+COLOR               = #292929 /* #2C3E50 */
+DANGER              = #e74c3c
+SUCCESS             = #2ecc71
+WARNING             = #edba22
+DISABLED            = #acb8b9
+BACKGROUND          = lighten(COLOR, 95%)
 /* -------------------------- VARIATIONS -------------------------- */
-LIST_border     = lighten(COLOR, 90%)
-NAV_LINK        = lighten(COLOR_contrast, 25%)
-NAV_LINK_ACTIVE = #FFF
+LIST_border         = lighten(COLOR, 90%)
+NAV_LINK            = lighten(COLOR, 25%)
+NAV_LINK_ACTIVE     = #FFF
 /* ------------------------- TRANSITION ------------------------- */
-TRANSITION_time        = 400ms
-TRANSITION_easing      = ease
+TRANSITION_time     = 400ms
+TRANSITION_easing   = ease
 /* ------------------------- RADIUS ------------------------- */
-BORDER_radius   = 2px
+BORDER_radius       = 2px
 /* -------------------------- FORM -------------------------- */
-FORM_color         = darken(#e5e5e5, 5%)
-FORM_border        = 2px
-FORM_border_radius = (BORDER_radius * FORM_border)
+FORM_color          = darken(#e5e5e5, 5%)
+FORM_border         = 2px
+FORM_border_radius  = (BORDER_radius * FORM_border)

+ 2 - 2
src/stylesheets/theme/theme.base.styl

@@ -20,6 +20,6 @@ body
   letter-spacing: -0.05em
 
   & .theme
-    background-color: COLOR_theme-light
+    background-color: THEME-light
     &:active
-      background-color: COLOR_theme
+      background-color: THEME

+ 15 - 13
src/stylesheets/theme/theme.layout.list.styl

@@ -13,20 +13,22 @@
     background: #fff
     &:not(.anchor)
       border-bottom: inset 1px LIST_border
-    &.secondary
-      box-shadow: inset 4px 0px 0px COLOR_secondary
+    &.color
+      box-shadow: inset 4px 0px 0px COLOR
     &.accept
-      box-shadow: inset 4px 0px 0px COLOR_success
+      box-shadow: inset 4px 0px 0px SUCCESS
     &.cancel
-      box-shadow: inset 4px 0px 0px COLOR_cancel
+      box-shadow: inset 4px 0px 0px DANGER
+    &.warning
+      box-shadow: inset 4px 0px 0px WARNING
     &.arrow::after
-      border-color: COLOR_secondary
+      border-color: lighten(COLOR, 75%)
 
     &, a
       &.contrast
-        background: COLOR_contrast
+        background: COLOR
       &.selectable:active, &.theme, &.active
-        background: lighten(COLOR_theme, 15%)
+        background: lighten(THEME, 15%)
       &.light
         background: LIST_border
         color: lighten(COLOR, 20%)
@@ -45,18 +47,18 @@
   aside & li
     background: none
     &:not(:first-child)
-      border-top: solid 1px  lighten(COLOR_contrast, 5%)
+      border-top: solid 1px  lighten(COLOR, 5%)
     &:not(:last-child)
-      border-bottom: solid 1px darken(COLOR_contrast, 20%)
+      border-bottom: solid 1px darken(COLOR, 20%)
     &:active
-      background: darken(COLOR_contrast, 5%)
+      background: darken(COLOR, 5%)
     &.active
-      background: COLOR_theme
+      background: THEME
     &.active, &:active
       border-color: transparent
       & strong, & small, & .icon
         color: #fff
     & strong
-      color: lighten(COLOR_contrast, 75%)
+      color: lighten(COLOR, 75%)
     & small, .icon
-      color: lighten(COLOR_contrast, 40%)
+      color: lighten(COLOR, 40%)

+ 15 - 15
src/stylesheets/theme/theme.layout.nav.styl

@@ -12,10 +12,10 @@
 nav
   section > header > &
     & a:not(.button)
-      color: darken(COLOR_theme, 35%)
-      text-shadow 0 1px 0 lighten(COLOR_theme, 25%)
+      color: darken(THEME, 35%)
+      text-shadow 0 1px 0 lighten(THEME, 25%)
       &:active
-        color: darken(COLOR_theme, 50%)
+        color: darken(THEME, 50%)
 
   section > footer > & > a, &[data-control=groupbar] > a
     color: NAV_LINK
@@ -24,26 +24,26 @@ nav
 
   section > &[data-control=groupbar] > a.active
     transition box-shadow TRANSITION_time TRANSITION_easing
-    box-shadow inset 0 -4px 0 COLOR_theme
+    box-shadow inset 0 -4px 0 THEME
 
   section > footer > & > a
-    box-shadow inset 0 1px 0 #000, inset 0 2px 0 lighten(COLOR_contrast, 20%)
+    box-shadow inset 0 1px 0 #000, inset 0 2px 0 lighten(COLOR, 20%)
     &.active
-      box-shadow inset 0 0 16px #000
-      background-color: darken(COLOR_contrast, 10%)
+      box-shadow inset 0 0 16px darken(COLOR, 75%)
+      background-color: darken(COLOR, 10%)
 
   aside & a
-    color: lighten(COLOR_contrast, 20%)
+    color: lighten(COLOR, 20%)
     &:active
-      color: lighten(COLOR_contrast, 50%)
+      color: lighten(COLOR, 50%)
 
   &[data-control=menu]
-    background: COLOR_contrast
+    background: COLOR
     box-shadow 0 2px 0 rgba(0,0,0,0.15)
     &.icons
       background: rgba(0,0,0,0.8)
       & > a
-        color: lighten(COLOR_contrast, 35%)
+        color: lighten(COLOR, 35%)
         &:active > .icon
           text-shadow: 0 0 32px #fff
         & > .icon
@@ -52,12 +52,12 @@ nav
       & > a
         color: #fff
         // text-shadow 0 1px 0 #111
-        border-bottom: 1px solid darken(COLOR_contrast, 20%)
-        border-top: 1px solid lighten(COLOR_contrast, 5%)
+        border-bottom: 1px solid darken(COLOR, 20%)
+        border-top: 1px solid lighten(COLOR, 5%)
         &:active
-          background: darken(COLOR_contrast, 15%)
+          background: darken(COLOR, 15%)
           border-color: transparent
         & > .icon
-          color: lighten(COLOR_contrast, 25%)
+          color: lighten(COLOR, 25%)
     & > a
       font-weight: 600

+ 7 - 7
src/stylesheets/theme/theme.layout.styl

@@ -10,22 +10,22 @@
 @import "__init.styl"
 
 body > section
-  background-color: COLOR_contrast
+  background-color: COLOR
   &, & a
     color: COLOR
   & > header
-    C = COLOR_theme
-    background-color: COLOR_theme
+    C = THEME
+    background-color: THEME
     box-shadow 0 2px 0 rgba(0,0,0,0.15), inset 0 1px 0 lighten(C, 20%), inset 0 -1px 0 darken(C, 20%)
     color: #fff
     border-radius (BORDER_radius * 2.5) (BORDER_radius * 2.5) 0 0
 
   & > footer, & nav[data-control=groupbar]
-    background-color: COLOR_contrast
+    background-color: COLOR
   & > article, & > [data-control="pull"]
     background-color: BACKGROUND
     &.splash
-      background: COLOR_theme
+      background: THEME
       color: #fff
   &.aside
     box-shadow -1px 0 2px rgba(0,0,0,0.2)
@@ -36,9 +36,9 @@ body > section
     box-shadow: 0 -1px 0 rgba(0,0,0,0.05)
 
 body > aside
-  background-color: COLOR_contrast
+  background-color: COLOR
   color: #fff
-  C = darken(COLOR_contrast, 20%)
+  C = darken(COLOR, 20%)
   & > header, > footer
     background-color: C
   & > header

+ 10 - 8
src/stylesheets/theme/theme.widget.button.styl

@@ -14,10 +14,10 @@
 header
   & .button, button
     color: #fff
-    background-color: darken(COLOR_theme, 15%)
-    box-shadow 0 1px 0 lighten(COLOR_theme, 15%), inset 0 1px 0 darken(COLOR_theme, 35%)
+    background-color: darken(THEME, 15%)
+    box-shadow 0 1px 0 lighten(THEME, 15%), inset 0 1px 0 darken(THEME, 35%)
     &:active
-      background-color: darken(COLOR_theme, 40%)
+      background-color: darken(THEME, 40%)
 
 article
   & .button, button
@@ -36,13 +36,15 @@ article
 
   & button, .button, .tag:not(.icon)
     &
-      background-color: darken(COLOR_theme, 15%)
-    &.secondary
-      background-color: COLOR_secondary
+      background-color: darken(THEME, 15%)
+    &.color
+      background-color: lighten(COLOR, 10%)
     &.accept
-      background-color: COLOR_success
+      background-color: SUCCESS
     &.cancel
-      background-color: COLOR_cancel
+      background-color: DANGER
+    &.warning
+      background-color: WARNING
     &[disabled], :disabled, &.disabled
       background: FORM_color
       color: #999 !important

+ 35 - 30
src/stylesheets/theme/theme.widget.form.styl

@@ -35,14 +35,14 @@ form, .form
       border: FORM_border solid FORM_color
       border-radius: FORM_border_radius
     &.error, &:required
-      color: COLOR_cancel !important
-      border-color: COLOR_cancel !important
+      color: DANGER !important
+      border-color: DANGER !important
     &.success
-      color: COLOR_success !important
-      border-color: COLOR_success !important
+      color: SUCCESS !important
+      border-color: SUCCESS !important
     &:focus, &:active, &:hover
-      color: COLOR_theme
-      border-color: COLOR_theme
+      color: THEME
+      border-color: THEME
     &[disabled]
       background: FORM_color
       border-color: FORM_color
@@ -55,7 +55,7 @@ form, .form
       color: FORM_color
     &:focus, &:active, &:hover
       &:after
-        color: COLOR_theme
+        color: THEME
 
   /* -------------------------- RANGE -------------------------- */
   & input[type=range]
@@ -63,10 +63,10 @@ form, .form
     color: darken(FORM_color, 25%)
     border-radius: (FORM_border_radius * 4)
     &:active
-      background-color: COLOR_theme !important
+      background-color: THEME !important
       color: #fff
       &::-webkit-slider-thumb
-        background-color: darken(COLOR_theme, 25%) !important
+        background-color: darken(THEME, 25%) !important
     &::-webkit-slider-thumb
       border-radius (FORM_border_radius * 4)
       background-color: darken(FORM_color, 25%)
@@ -75,7 +75,7 @@ form, .form
   & [data-progress]
     background-color: #ddd
     & .value
-      background-color: COLOR_theme
+      background-color: THEME
     &, & .value
       border-radius (FORM_border_radius * 3)
 
@@ -90,30 +90,35 @@ form, .form
       border-radius: (FORM_border_radius * 4)
       background: darken(FORM_color, 25%)
     &.checked
-      background-color: COLOR_theme
+      background-color: THEME
       color: #fff !important
       & label
-        background-color: darken(COLOR_theme, 25%)
+        background-color: darken(THEME, 25%)
+
+    &.accept
+      &.checked
+        background-color: SUCCESS
+        & label
+          background-color: darken(SUCCESS, 25%)
+    &.cancel
+      &.checked
+        background-color: DANGER
+        & label
+          background-color: darken(DANGER, 25%)
 
     // Expand
-    &.twitter
+    &.icon
       font-family:'lungojsicon'
       font-size: 1.3em
       line-height: 1.4em
-      &:before
-        content: "\f099"
-      &:after
-        content: "\f099"
-        text-shadow: 0 1px 0 #fff
-    &.ok
-      font-family:'lungojsicon'
-      font-size: 1.3em
-      line-height: 1.4em
-      &.checked
-        background-color: COLOR_success
-        & label
-          background-color: darken(COLOR_success, 25%)
-      &:before
-        content: "\f00c"
-      &:after
-        content: "\f00d"
+
+      &.twitter
+        &:before
+          content: "\f099"
+        &:after
+          content: "\f099"
+      &.ok
+        &:before
+          content: "\f00c"
+        &:after
+          content: "\f00d"

+ 4 - 4
src/stylesheets/theme/theme.widget.notification.styl

@@ -23,14 +23,14 @@
       box-shadow(0 0 8px #444)
       & button, .button
         background: #fff
-        color: COLOR_theme
+        color: THEME
     &.confirm, &.html
       background: #e6e6e6
       color: #222
     &.error
-      background: COLOR_cancel
+      background: DANGER
     &.success
-      background: COLOR_success
+      background: SUCCESS
     &.error, &.success
       color: #fff
       & small
@@ -38,7 +38,7 @@
         font-weight: 100
     &.html
       & .title
-        background: COLOR_theme
+        background: THEME
         color: #fff
     &.push
       background: rgba(0,0,0,0.65)

+ 2 - 2
src/stylesheets/theme/theme.widget.styl

@@ -15,9 +15,9 @@
   border-radius BORDER_radius
   font-weight: 700 !important
   &.count
-    background-color: COLOR_theme
+    background-color: THEME
   header .count
-    background-color: COLOR_theme-dark !important
+    background-color: THEME-dark !important
   footer &
     box-shadow inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5)