From d9f1c23ee1d1074a149d01437fd5041ce53972bf Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Sat, 24 Aug 2013 14:14:45 -0500 Subject: [PATCH] Lots of tweaks, and angular demos --- dist/framework-with-theme.css | 31 ++++++++++------ example/angular/app.css | 27 ++++++++++++++ example/angular/app.js | 47 ++++++++++++++++++++++++ example/angular/customer.html | 3 ++ example/angular/customers.html | 6 +++ example/angular/index.html | 27 ++++++++++++++ example/bar.html | 38 +++++++++++++++---- js/framework/framework-buttons.js | 2 + js/framework/framework-tabs.js | 11 ++++-- scss/framework/structure/_bar.scss | 4 +- scss/framework/structure/_button.scss | 6 ++- scss/framework/structure/_listview.scss | 1 + scss/framework/structure/_tabs.scss | 14 +++++-- scss/framework/structure/_variables.scss | 6 +-- scss/framework/theme/default/_tabs.scss | 5 +++ 15 files changed, 195 insertions(+), 33 deletions(-) create mode 100644 example/angular/app.css create mode 100644 example/angular/app.js create mode 100644 example/angular/customer.html create mode 100644 example/angular/customers.html create mode 100644 example/angular/index.html diff --git a/dist/framework-with-theme.css b/dist/framework-with-theme.css index 5beaecd423..f2a80e2ad7 100644 --- a/dist/framework-with-theme.css +++ b/dist/framework-with-theme.css @@ -44,6 +44,8 @@ ul { text-align: center; cursor: pointer; margin: 0; } + .button.button-borderless { + border: none; } .bar { position: fixed; @@ -55,7 +57,7 @@ ul { -webkit-box-orient: horizontal; box-orient: horizontal; box-sizing: border-box; - height: 60px; + height: 50px; /* .title + .button:last-child, .button + .button:last-child, @@ -73,9 +75,8 @@ ul { display: block; width: 100%; */ - line-height: 20px; + line-height: 30px; margin: 0; - padding: 20px 0px; text-align: center; white-space: nowrap; font-size: 18px; @@ -98,10 +99,10 @@ ul { /* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab. Note: For these to work, content must come after both bars in the markup */ .bar ~ .content { - top: 60px; } + top: 50px; } .bar ~ .content { - bottom: 51px; } + bottom: 50px; } /* Bar docked to bottom used for primary app navigation */ .tabs { @@ -124,15 +125,19 @@ ul { /* Navigational tab */ .tab-item { height: 100%; - padding-top: 9px; text-align: center; box-sizing: border-box; -webkit-box-flex: 1; box-flex: 1; } + .tab-item a { + text-decoration: none; + display: block; + width: 100%; + height: 100%; } /* Active state for tab */ -.tab-item.active { - box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5); } +.tab-item.active, .tab-item:active { + background-color: rgba(0, 0, 0, 0.2); } /* Icon for tab */ .tab-item i { @@ -144,8 +149,7 @@ ul { margin-top: 1px; font-size: 10px; font-weight: bold; - color: #fff; - text-shadow: 0 1px rgba(0, 0, 0, 0.3); } + color: #fff; } .button-group { position: relative; @@ -216,8 +220,10 @@ ul { .list-item.active .list-item-heading, .list-item.active:hover .list-item-heading, .list-item.active:focus .list-item-heading { color: inherit; } -a.list-item:hover, a.list-item:focus { +a.list-item { text-decoration: none; } + a.list-item:hover, a.list-item:focus { + text-decoration: none; } .list-divider { padding: 5px 15px; } @@ -299,7 +305,8 @@ a.list-item:hover, a.list-item:focus { height: 60px; } .tab-item a { - font-family: "Helvetica Neue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif; } + font-family: "Helvetica Neue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 200; } .tab-item i { font-size: 25px; } diff --git a/example/angular/app.css b/example/angular/app.css new file mode 100644 index 0000000000..93186a5249 --- /dev/null +++ b/example/angular/app.css @@ -0,0 +1,27 @@ +.pane { + position: fixed; + width: 100%; +} +.reveal-animation { + /* + -webkit-transform: translate3d(0%, 0, 0); + transform: translate3d(0%, 0, 0); + + -webkit-transition: -webkit-transform 1s ease-in-out; + transition: transform 1s ease-in-out; + */ +} +.reveal-animation.ng-enter { + -webkit-transition: 0.2s linear all; + -webkit-transform:translate3d(100%,0,0) ; +} +.reveal-animation.ng-enter-active { + -webkit-transform:translate3d(0,0,0) ; +} +.reveal-animation.ng-leave { + -webkit-transition: 0.2s linear all; + -webkit-transform:translate3d(0,0,0); +} +.reveal-animation.ng-leave-active { + -webkit-transform:translate3d(-100%,0,0); +} diff --git a/example/angular/app.js b/example/angular/app.js new file mode 100644 index 0000000000..6bf8c7e8ab --- /dev/null +++ b/example/angular/app.js @@ -0,0 +1,47 @@ +document.addEventListener('touchstart', function() {}); + +var app = angular.module('peopleApp', ['ngRoute', 'ngAnimate']); + +app.config( ["$routeProvider", function($routeProvider){ + $routeProvider.when("/customers", {"templateUrl" : "customers.html", controller: 'CustomersCtrl'}); + $routeProvider.when("/customer/:id", {"templateUrl" : "customer.html", controller: 'CustomerCtrl'}); + $routeProvider.otherwise({"redirectTo":"/customers"}); + + }] +); + +app.provider('Customers', function() { + var customers = [ + {'name': 'Max Lynch', id: 1}, + {'name': 'Max Lynch', id: 2}, + {'name': 'Max Lynch', id: 3}, + {'name': 'Max Lynch', id: 4}, + {'name': 'Max Lynch', id: 5}, + {'name': 'Max Lynch', id: 6}, + {'name': 'Max Lynch', id: 7}, + {'name': 'Max Lynch', id: 8}, + {'name': 'Max Lynch', id: 9}, + {'name': 'Max Lynch', id: 10}, + {'name': 'Max Lynch', id: 11}, + ]; + + this.$get = function() { + return { + list: customers, + getById: function(id) { + for(var i = 0; i < this.list.length; i++) { if(this.list[i].id == id) return this.list[i]; } + } + } + } +}); + +app.controller('CustomersCtrl', function($scope, Customers) { + $scope.customers = Customers; +}); + +app.controller('CustomerCtrl', function($scope, $routeParams, Customers) { + var id = $routeParams.id; + var customer = Customers.getById(id); + $scope.customer = customer; + console.log('Showing user', id, customer); +}); diff --git a/example/angular/customer.html b/example/angular/customer.html new file mode 100644 index 0000000000..89de7d697f --- /dev/null +++ b/example/angular/customer.html @@ -0,0 +1,3 @@ +

{{customer.name}}

+Edit +Delete diff --git a/example/angular/customers.html b/example/angular/customers.html new file mode 100644 index 0000000000..25e9bbf1ff --- /dev/null +++ b/example/angular/customers.html @@ -0,0 +1,6 @@ + diff --git a/example/angular/index.html b/example/angular/index.html new file mode 100644 index 0000000000..433d255911 --- /dev/null +++ b/example/angular/index.html @@ -0,0 +1,27 @@ + + + + Example + + + + + + + + + + + + + + +
+

Customers

+
+ +
+
+
+ + diff --git a/example/bar.html b/example/bar.html index 041d215ca6..d04e02513c 100644 --- a/example/bar.html +++ b/example/bar.html @@ -25,30 +25,49 @@ +
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-
+
+ Previous

Willkommen!

+ Next
-