Merge pull request #2192 from cmgustavo/ux/menu-layout

New sidebar on mobile
This commit is contained in:
Matias Alejo Garcia 2014-12-19 00:21:42 -03:00
commit 430240dcfd
8 changed files with 181 additions and 109 deletions

View file

@ -219,6 +219,7 @@ header .alt-currency {
height:100%; height:100%;
} }
.tab-bar { .tab-bar {
display: none; display: none;
} }
@ -249,11 +250,11 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
.side-nav.wallets .avatar-wallet, .side-nav.wallets .avatar-wallet,
.wallet-selection.wallets .avatar-wallet .wallet-selection.wallets .avatar-wallet
{ {
background-color: #7A8C9E; background-color: #1ABC9C;
color: #213140; color: #fff;
padding: 0.35rem 0.5rem; padding: 0.35rem 0.5rem;
text-align: center; text-align: center;
margin-top: 6px; margin-top: 3px;
width: 35px; width: 35px;
} }
@ -621,6 +622,7 @@ a.button-setup {
float: left; float: left;
color: #fff; color: #fff;
text-transform: lowercase; text-transform: lowercase;
font-weight: 500;
} }
.name-wallet i { .name-wallet i {

View file

@ -18,13 +18,24 @@
display: none; display: none;
} }
.sidebar-bottom {
background: #213140;
padding: 1.2rem;
font-size: 14px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
height: 65px;
}
.page, .main { .page, .main {
height: auto; height: auto;
} }
.main { .main {
height: 92%; height: 92%;
margin-top: 45px; margin-top: 30px;
margin-left: 0; margin-left: 0;
margin-bottom: -30px; margin-bottom: -30px;
padding: 20px 0 80px 0; padding: 20px 0 80px 0;
@ -58,7 +69,27 @@
header { header {
height: 45px; height: 45px;
background-color: #213140;
position: fixed;
top: 0;
width: 100%;
line-height: 110%; line-height: 110%;
padding: 0 0.45rem;
/*
padding: 0.45rem;
line-height: 110%;
background-color: #213140;
position: fixed;
width: 100%;
top: 0;
*/
}
header .photo-container {
width: 35px;
height: 35px;
margin-right: 10px;
margin-top: 5px;
} }
header h1 { header h1 {
@ -66,6 +97,22 @@
text-align: center; text-align: center;
} }
.scroll-section {
position: absolute;
top: 45px;
bottom: 65px;
overflow: scroll;
width: 100%;
}
.col2 {
width: 180px;
}
.col2 a.wallet-item {
padding: 0.15rem 0 0.3rem;
}
.col3 a { .col3 a {
height: 45px; height: 45px;
padding: 12px 5px; padding: 12px 5px;
@ -94,9 +141,11 @@
} }
.avatar-wallet { .avatar-wallet {
background-color: #1ABC9C;
color: #fff;
margin-top: 5px; margin-top: 5px;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 13px;
padding: 0.35rem 0.65rem; padding: 0.35rem 0.65rem;
} }
@ -112,10 +161,6 @@
height: 30px; height: 30px;
} }
.tab-bar-section {
text-align: left;
}
.setup-page { .setup-page {
height: 100%; height: 100%;
} }
@ -125,8 +170,10 @@
} }
.tab-bar h1 { .tab-bar h1 {
font-weight: 100; font-weight: 700;
text-align: center; text-align: center;
text-transform: uppercase;
font-size: 14px;
} }
ul.off-canvas-list li a { ul.off-canvas-list li a {
@ -218,16 +265,18 @@
padding: 0.15rem 0.2rem; padding: 0.15rem 0.2rem;
} }
.side-nav.wallets { .sidebar-mobile-wallets {
z-index: 100; background: #E4E8EC;
overflow-y: inherit;
position: inherit;
height: auto;
border-bottom: none;
} }
.side-nav li.nav-item.selected { .sidebar-mobile-wallets li {
background-color: #3C4E60; overflow: hidden;
padding:0.4rem;
border-bottom: 1px solid #DDE2E7;
}
.sidebar-mobile-wallets li.nav-item.selected {
background-color: #CED5DC;
} }
/* /*
@ -258,6 +307,39 @@
-webkit-tap-highlight-color:rgba(0,0,0,0); -webkit-tap-highlight-color:rgba(0,0,0,0);
} }
a.button-addwallet {
background: #D8DEE3;
border-radius: 4px;
color: #7A8C9E;
text-transform: uppercase;
font-weight: 700;
font-size: 12px;
padding: 0.8rem;
width: 80%;
display: block;
margin: 20px;
text-align: center;
}
a.button-addwallet i {
background-color: #7A8C9E;
color: #D8DEE3;
border-radius: 100%;
padding: .1rem 0.25rem;
margin-right: 5px;
}
.add-wallet .button-setup {
border: 1px solid #A5B2BF;
border-radius: 5px;
color: #7A8C9E;
text-align: center;
padding: 2rem;
margin: 2rem 0;
text-transform: uppercase;
font-size: 16px;
}
.modal.fade, .reveal-modal-bg { .modal.fade, .reveal-modal-bg {
opacity: 1; opacity: 1;
} }

View file

@ -66,13 +66,14 @@
<section class="left-small"> <section class="left-small">
<a class="left-off-canvas-toggle menu-icon" ><span></span></a> <a class="left-off-canvas-toggle menu-icon" ><span></span></a>
</section> </section>
<section class="right-small" ng-show="$root.iden && $root.iden.getWallets().length >1">
<a class="right-off-canvas-toggle p10"><i class="icon-wallet size-24"></i></a> <section class="right-small" ng-show="$root.iden && $root.wallet.isComplete()">
<a class="p10" ng-click="$root.go('more')"><i class="fi-widget size-24"></i></a>
</section> </section>
<section class="middle tab-bar-section"> <section class="middle tab-bar-section">
<h1 class="title"> <h1 class="title ellipsis" ng-show="$root.iden && $root.wallet">
<img src="img/logo-negative-beta.svg" alt="Copay" width="60"> {{$root.wallet.getName()}}
</h1> </h1>
</section> </section>
</nav> </nav>
@ -81,9 +82,6 @@
<div ng-include="'views/includes/sidebar-mobile.html'"></div> <div ng-include="'views/includes/sidebar-mobile.html'"></div>
</nav> </nav>
<nav class="right-off-canvas-menu" ng-show="$root.iden && $root.iden.getWallets().length >1">
<div ng-include="'views/includes/walletbar-mobile.html'"></div>
</nav>
<div <div
ng-if="$root.iden" ng-if="$root.iden"
ng-include="'views/includes/sidebar.html'" ng-include="'views/includes/sidebar.html'"

View file

@ -102,6 +102,10 @@ angular
.when('/profile', { .when('/profile', {
templateUrl: 'views/profile.html', templateUrl: 'views/profile.html',
logged: true logged: true
})
.when('/add', {
templateUrl: 'views/add.html',
logged: true
}); });
if (config.developmentFeatures) { if (config.developmentFeatures) {

View file

@ -20,27 +20,16 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
var elem = angular.element(document.querySelector('#off-canvas-wrap')); var elem = angular.element(document.querySelector('#off-canvas-wrap'));
var leftbarActive = angular.element(document.getElementsByClassName('move-right')).length; var leftbarActive = angular.element(document.getElementsByClassName('move-right')).length;
var rightbarActive = angular.element(document.getElementsByClassName('move-left')).length;
if (invert) { if (invert) {
if (rightbarActive) { if ($rootScope.iden && !$rootScope.hideNavigation) {
hideSidebars(); elem.addClass('move-right');
}
else {
if ($rootScope.iden && !$rootScope.hideNavigation) {
elem.addClass('move-right');
}
} }
} }
else { else {
if (leftbarActive) { if (leftbarActive) {
hideSidebars(); hideSidebars();
} }
else {
if ($rootScope.iden && $rootScope.iden.getWallets().length >1) {
elem.addClass('move-left');
}
}
} }
}; };

16
views/add.html Normal file
View file

@ -0,0 +1,16 @@
<div class="small-12 columns add-wallet">
<a class="button-setup db oh" title="Create new wallet" ng-click="$root.go('create')">
<i class="fi-plus"></i>
<span>Create new wallet</span>
</a>
<a class="button-setup db oh" title="Join shared wallet" ng-click="$root.go('join')">
<i class="icon-people"></i>
<span>Join shared wallet</span>
</a>
<a class="button-setup db oh" title="Import wallet" ng-click="$root.go('import')">
<i class="icon-upload"></i>
<span>Import wallet</span>
</a>
</div>

View file

@ -1,43 +1,56 @@
<div> <header ng-click="$root.go('profile')">
<ul class="off-canvas-list"> <div class="photo-container left">
<li> <img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35">
<a ng-click="$root.go('profile')" class="db p20h nav-item text-center" title="Create new wallet"> </div>
<div class="photo-container m20t"> <div class="left m5t">
<img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35"> <div class="text-white">{{$root.iden.getName()}}</div>
</div> <div class="text-gray size-10"> {{'View My Profile' | translate }} </div>
<p class="text-black m5">{{$root.iden.getName()}}</p> </div>
<span class="db text-gray size-10"> <div class="right">
<i class="fi-torso"></i> {{'View My Profile' | translate }} <i class="icon-arrow-right3 size-16 db m15t text-white"></i>
</span> </div>
</header>
</a> <div class="scroll-section">
<ul class="sidebar-mobile-wallets oh off-canvas-list m10b" ng-show="wallets[0]">
</li> <li
<li> ng-repeat="item in wallets track by $index"
<a ng-click="$root.go('create')" class="db p20h nav-item" title="Create new wallet"> ng-class="{'selected': item.id == $root.wallet.id}"
<i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }}</a> class="nav-item" ng-click="switchWallet(item.id)" >
</li> <div class="col1">
<li> <div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
<a ng-click="$root.go('join')" class="db p20h nav-item" title="Join shared wallet"> </div>
<i class="size-24 m20r fi-torsos-all"></i> {{'Join shared wallet' | translate }}</a> <div class="col2">
</li> <a class="size-12 wallet-item">
<li> <div class="oh">
<a ng-click="$root.go('import')" class="db p20h nav-item" title="Import wallet"> <div class="right size-10 text-gray">
<i class="size-24 m20r fi-download"></i> {{'Import a wallet' | translate }}</a> [ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>
</li> <div class="ellipsis name-wallet text-black">{{item.name || item.id}}</div>
<li ng-if="$root.wallet"> </div>
<a ng-click="$root.go('more')" class="db p20h nav-item" title="Settings"> <div class="oh text-bold">
<i class="size-24 m20r fi-widget"></i> {{'Wallet Settings' | translate }}</a> <span ng-if="item.isComplete() && item.balanceInfo.updatingBalance"><i class="fi-bitcoin-circle icon-rotate spinner"></i></span>
</li> <div ng-if="item.isComplete() && !item.balanceInfo.updatingBalance" data-options="disable_for_touch:true">
<li> <b class="m5r size-12">{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}</b>
<a class="db p20h nav-item" title="Close" ng-click="signout()"> <span class="alt-currency gray size-10">{{item.balanceInfo.totalBalanceAlternative}} {{item.balanceInfo.alternativeIsoCode}}</span>
<span ng-if="!$root.hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span> </div>
<span ng-if="$root.hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span> <span ng-if="!item.isComplete()">Waiting for copayers...</span>
</a> </div>
</li> </a>
</ul> </div>
<div class="text-gray size-12 text-center columns"> </li>
<div ng-include="'views/includes/version.html'"></div> </ul>
<a class="button-addwallet" title="Add wallet" ng-click="$root.go('add')">
<i class="fi-plus"></i> Add wallet
</a>
<div class="text-gray size-12 text-center columns">
<div ng-include="'views/includes/version.html'"></div>
</div>
</div>
<div class="sidebar-bottom">
<a class="db text-gray tu" title="Close" ng-click="signout()">
<span ng-if="!$root.hasPin"><i class="size-16 m5r fi-power"></i> {{'Close'|translate}}</span>
<span ng-if="$root.hasPin"><i class="size-16 m5r icon-locked"></i> {{'Lock'|translate}}</span>
</a>
</div> </div>
</div>

View file

@ -1,32 +0,0 @@
<div>
<header ng-show="$root.wallet">
<h1>My wallets</h1>
</header>
<ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]">
<li
ng-repeat="item in wallets track by $index"
ng-class="{'selected': item.id == $root.wallet.id}"
class="nav-item" ng-click="switchWallet(item.id)" >
<div class="col1">
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
</div>
<div class="col2">
<a class="size-12 wallet-item">
<div class="oh">
<div class="right size-10 type-wallet">
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>
<div class="ellipsis name-wallet">{{item.name || item.id}}</div>
</div>
<div class="oh">
<span ng-if="item.isComplete() && item.balanceInfo.updatingBalance"><i class="fi-bitcoin-circle icon-rotate spinner"></i></span>
<div ng-if="item.isComplete() && !item.balanceInfo.updatingBalance" data-options="disable_for_touch:true">
<b class="m5r size-12">{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}</b>
<span class="alt-currency size-10">{{item.balanceInfo.totalBalanceAlternative}} {{item.balanceInfo.alternativeIsoCode}}</span>
</div>
<span ng-if="!item.isComplete()">Waiting for copayers...</span>
</div>
</a>
</div>
</li>
</ul>
</div>