From cee23d931785fe0638054a2448acb2e44411fdd0 Mon Sep 17 00:00:00 2001 From: kathy Date: Mon, 11 Nov 2019 10:35:31 -0800 Subject: Update navigation to accordian-style menu - New navigation provides intuitive structure for showing relationship between sections and pages - Menu keeps an open state, which allows easy clicking to sibling pages - Ability to preview all page sections w/o hover over blocking page content - Allows user to see where they are within navigation at all times Tested: Opened each page and confirmed new navigation worked, clicked through to all pages successfully. Change-Id: Ie10dc95d8e15ee9bf89a3bec9ff231c0a7065ed9 Signed-off-by: Kathy Pine --- app/assets/icons/icon-config.svg | 2 +- app/assets/icons/icon-control.svg | 2 +- app/assets/icons/icon-health.svg | 2 +- app/assets/icons/icon-overview.svg | 2 +- app/assets/icons/icon-user.svg | 2 +- app/assets/images/openBMC.png | Bin 13574 -> 0 bytes app/common/directives/app-navigation.html | 112 +++++---- app/common/directives/app-navigation.js | 45 ++-- app/common/styles/directives/app-navigation.scss | 278 +++++++++++------------ app/common/styles/layout/content.scss | 5 +- 10 files changed, 227 insertions(+), 223 deletions(-) delete mode 100644 app/assets/images/openBMC.png diff --git a/app/assets/icons/icon-config.svg b/app/assets/icons/icon-config.svg index b649651..223ed7a 100644 --- a/app/assets/icons/icon-config.svg +++ b/app/assets/icons/icon-config.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/icons/icon-control.svg b/app/assets/icons/icon-control.svg index 5c18df3..4ac4693 100644 --- a/app/assets/icons/icon-control.svg +++ b/app/assets/icons/icon-control.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/icons/icon-health.svg b/app/assets/icons/icon-health.svg index f01af2c..d6236a6 100644 --- a/app/assets/icons/icon-health.svg +++ b/app/assets/icons/icon-health.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/icons/icon-overview.svg b/app/assets/icons/icon-overview.svg index 748fa81..0b42642 100644 --- a/app/assets/icons/icon-overview.svg +++ b/app/assets/icons/icon-overview.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/icons/icon-user.svg b/app/assets/icons/icon-user.svg index 0d4610d..8e5466c 100644 --- a/app/assets/icons/icon-user.svg +++ b/app/assets/icons/icon-user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/images/openBMC.png b/app/assets/images/openBMC.png deleted file mode 100644 index e350113..0000000 Binary files a/app/assets/images/openBMC.png and /dev/null differ diff --git a/app/common/directives/app-navigation.html b/app/common/directives/app-navigation.html index 435980a..41441e2 100644 --- a/app/common/directives/app-navigation.html +++ b/app/common/directives/app-navigation.html @@ -1,97 +1,119 @@ + \ No newline at end of file diff --git a/app/common/directives/app-navigation.js b/app/common/directives/app-navigation.js index baa8c8b..a2ced03 100644 --- a/app/common/directives/app-navigation.js +++ b/app/common/directives/app-navigation.js @@ -10,18 +10,30 @@ window.angular && (function(angular) { 'controller': [ '$scope', '$location', 'dataService', function($scope, $location, dataService) { + $scope.showHealthMenu = false; + $scope.showControlMenu = false; + $scope.showConfigMenu = false; + $scope.showAccessMenu = false; $scope.dataService = dataService; - $scope.showSubMenu = false; + $scope.change = function(firstLevel) { - if (firstLevel != $scope.firstLevel) { - $scope.firstLevel = firstLevel; - $scope.showSubMenu = true; - } else { - $scope.showSubMenu = !$scope.showSubMenu; - } - }; - $scope.closeSubnav = function() { - $scope.showSubMenu = false; + switch (firstLevel) { + case 'server-health': + $scope.showHealthMenu = !$scope.showHealthMenu; + break; + case 'server-control': + $scope.showControlMenu = !$scope.showControlMenu; + break; + case 'configuration': + $scope.showConfigMenu = !$scope.showConfigMenu; + break; + case 'access-control': + $scope.showAccessMenu = !$scope.showAccessMenu; + break; + case 'overview': + $location.url('/overview/server'); + break; + }; }; $scope.$watch('path', function() { var urlRoot = $location.path().split('/')[1]; @@ -30,22 +42,15 @@ window.angular && (function(angular) { } else { $scope.firstLevel = 'overview'; } - $scope.showSubMenu = false; + $scope.showSubMenu = true; }); $scope.$watch('showNavigation', function() { - var paddingTop = 0; var urlRoot = $location.path().split('/')[1]; if (urlRoot != '') { $scope.firstLevel = urlRoot; } else { $scope.firstLevel = 'overview'; } - - if ($scope.showNavigation) { - paddingTop = document.getElementById('header').offsetHeight; - } - dataService.bodyStyle = {'padding-top': paddingTop + 'px'}; - $scope.navStyle = {'top': paddingTop + 'px'}; }); } ], @@ -56,11 +61,11 @@ window.angular && (function(angular) { if (scope.showSubMenu) { scope.$apply(function() { - scope.showSubMenu = false; + scope.showSubMenu = true; }); } }); } }; }); -})(window.angular); +})(window.angular); \ No newline at end of file diff --git a/app/common/styles/directives/app-navigation.scss b/app/common/styles/directives/app-navigation.scss index f8f5a6f..519c3ee 100644 --- a/app/common/styles/directives/app-navigation.scss +++ b/app/common/styles/directives/app-navigation.scss @@ -1,34 +1,14 @@ -$nav__toplvlWidth: 125px; -$nav__seclvlWidth: 240px; -$nav__top-level-color: $base-01--01; -$nav__second-level-color: $base-02--06; -$nav__second-level-text-color: $base-02--01; +$nav__toplvlWidth: 240px; +$nav__top-level-color: $color--blue-100; +$nav__top-level-text-secondary: $color--grey-20; +$nav__second-level-text-primary: $color--teal-50; +$nav__second-level-text-secondary: $primary-light; +$nav__hover-over-outline: $color--grey-40; //Navigation icons -@mixin navIcons { - color: $primary-light; - fill: $primary-light; - max-height: 40px; - stroke-width: .5; - display: block; - margin: .5em auto; - .st0 { - fill: none; - stroke: $primary-light; - stroke-width: 2; - stroke-miterlimit: 10; - } - .st1 { - fill: none; - stroke: $primary-light; - stroke-width: 4; - stroke-miterlimit: 10; - } -} - .nav__wrapper { height: 100%; - position: fixed; + position: absolute; top: 0; z-index: 100; } @@ -36,158 +16,156 @@ $nav__second-level-text-color: $base-02--01; // Top level navigation #nav__top-level { background: $nav__top-level-color; - position: absolute; + position: fixed; left: 0; top: 0; bottom: 0; list-style-type: none; - margin: 0; - padding: 0; + padding: 22px 0 0 0; + margin: 130px 0 0 0; width: $nav__toplvlWidth; overflow-y: auto; - li { + >li { margin: 0; + height: 3em; + &.opened{ + height: inherit; + .nav-link{ + color: $primary-light; + } + } } > li > a, > li > button { - height: 120px; + height: 3.3em; } - //svg icons - .nav-icon { - @include navIcons; - width: 100%; - height: 100%; - svg { - width: 36px; - height: auto; + button, + a, + span { + &:hover { + &.opened{ + color: $primary-light; + } } } - .nav-icon__control, - .nav-icon__key { - svg { - width: 30px; + .nav-icon { + height: 26px; + float: left; + margin: 2px 0 0 1px; + width: 26px; + fill: $primary-light; + svg { + height: inherit; + width: 26px; + max-width: inherit; + fill: $primary-light; + } + } + .nav-link { + float: left; + font-size: 15px; + padding: 9px 0 0 7px; + margin-left: 5px; + &:focus{ + outline: 0; + } } +} + +.nav__wrapper button { + background: transparent; + border: 0; + color: $primary-light; + width: 95%; + padding: 5px 5px 9px 10px; + margin: 0 0 0 6px; + display: block; + text-align: center; + white-space: normal; + border-radius: 0; + text-decoration: none; + border: 1px solid transparent; + font-weight: normal; + font-size: 13px; + &:hover, + &:focus { + background: fade-out(#ffffff, 0.9); + color: $nav__top-level-text-secondary; + border-radius: 0; + border: 1px solid $nav__hover-over-outline; + outline: 0; + } + .icon { + margin-left: .3em; + margin-top: .6em; + } + img { + width: 2em; + height: 2em; } - .button, button, a { - background: transparent; - border: 0; +} + +.nav__second-level { + list-style-type: none; + opacity: 0; + left: $nav__toplvlWidth; + padding: 0; + margin: 0; + transform: scaleY(0); + transform-origin: 0 0; + transition: all $duration--moderate-01 $standard-easing--expressive; + overflow: hidden; + line-height: 0; + a { color: $primary-light; - fill: $primary-light; - width: 100%; - padding: 1em; - display: block; - text-align: center; - margin-bottom: 0; + width: 95%; + padding: 6px 5px 8px 50px; + margin: 0 0 0 6px; white-space: normal; - border-radius: 0; text-decoration: none; - border-top: 1px solid transparent; - border-bottom: 1px solid $border-color-02; + border: 1px solid transparent; font-weight: normal; - font-size: .9em; - line-height: 1.2; - &:hover { - background: $primary-light; - fill: $primary-dark; - color: $primary-action; - padding: 1em; + font-size: .8rem; + &:hover, + &:focus { + background: fade-out(#ffffff, 0.9); + color: $nav__second-level-text-secondary; border-radius: 0; - border-bottom: 1px solid $border-color-01; - .nav__icon-help__outer { - stroke: $primary-dark; - } - .nav__icon-help__inner { - fill: $primary-action; - } - .nav-icon { - fill: $primary-action; - color: $primary-action; - .st0 { - stroke: $primary-action; - } - .st1 { - fill: $primary-action; - color: $primary-action; - stroke: $primary-action; - } - } + border-color: $nav__hover-over-outline; + outline: 0; } } - .opened { - background: $nav__second-level-color; - fill: $primary-dark; - color: darken($primary-action, 10%); - border-bottom: 1px solid $border-color-01; - .nav-icon { - fill: $primary-action; - color: $primary-action; - .st0 { - stroke: $primary-action; - } - .st1 { - fill: $primary-action; - color: $primary-action; - stroke: $primary-action; - } + &.opened { + line-height: 1.1; + overflow: visible; + opacity: 1; + transform: scaleY(1); + transition: all $duration--moderate-01 $standard-easing--expressive; + li a{ + display:block; } } - // Second Level Navigation - .nav__second-level { - position: fixed; - background: $nav__second-level-color; - top: 0; - bottom: 0; - left: -245px; - width: $nav__seclvlWidth; - z-index: -1; - padding: 0; + li:hover + { + margin-left: 17px; margin: 0; - list-style-type: none; - display: block; - transition: left $duration--slow-01 $standard-easing--productive; - &.opened { - left: $nav__toplvlWidth; - box-shadow: 7px 0 28px -10px $base-02--02; - } - a { - padding: 1.2em 1em 1.2em 1em; - display: block; - color: $primary-dark; - text-decoration: none; - position: relative; - font-weight: 400; - text-align: left; - border-bottom: 1px solid transparent; - &:hover { - background: $primary-light; - } + padding: 0; + a{ + padding-left: 50px; } + } - li { - a:after{ - content: '\203A'; - position: absolute; - font-size: 2em; - font-weight: 700; - top: 50%; - right: .6em; - transform: translateY(-59%); - color: $nav__second-level-text-color; - opacity: 0; - } - &.active { - a {font-weight: 700;} + li { + &:focus, + &:hover { + a { + color: $nav__second-level-text-secondary; } - &.active, - &:focus, - &:hover { - a {color: $nav__second-level-text-color;} - a:after { - opacity: 1; - right: .3em; - @include fastTransition-all; - } + } + &.active { + a span { + color: $nav__second-level-text-primary; } } } diff --git a/app/common/styles/layout/content.scss b/app/common/styles/layout/content.scss index f5d2757..143c52a 100644 --- a/app/common/styles/layout/content.scss +++ b/app/common/styles/layout/content.scss @@ -1,12 +1,11 @@ // Content layout styles -$nav__toplvlWidth: 120px; -$nav__seclvlWidth: 240px; +$nav__toplvlWidth: 240px; // Main element class .content__container { margin-left: $nav__toplvlWidth; padding: 1em 0.1em; - + margin-top: 130px; @include mediaQuery(x-small) { padding: 1rem 2rem; } -- cgit v1.2.1