mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux breadcrumb work
This commit is contained in:
parent
b3ddcc8077
commit
02e2d5da2b
@ -1,19 +1,12 @@
|
|||||||
<div class="page-nav">
|
<div class="page-nav">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="page-breadcrumb">
|
<div class="page-breadcrumbs">
|
||||||
<div class="page-breadcrumb__item dropdown" ng-repeat="item in ctrl.model.breadcrumbs">
|
<a class="breadcrumb-item active" href="/">
|
||||||
<a class="pointer" ng-href="{{::item.url}}">
|
<i class="fa fa-home"></i>
|
||||||
{{::item.text}}
|
</a>
|
||||||
</a>
|
<a class="breadcrumb-item" ng-href="{{::item.url}}" ng-repeat="item in ctrl.model.breadcrumbs">
|
||||||
|
{{::item.text}}
|
||||||
<ul class="dropdown-menu dropdown-menu--navbar">
|
</a>
|
||||||
<li ng-repeat="subItem in ::item.children">
|
|
||||||
<a class="pointer" ng-href="{{::subItem.url}}" ng-click="ctrl.navItemClicked(subItem, $event)">
|
|
||||||
{{::subItem.text}}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
///<reference path="../../../headers/common.d.ts" />
|
|
||||||
|
|
||||||
import coreModule from '../../core_module';
|
import coreModule from '../../core_module';
|
||||||
import {NavModel} from '../../nav_model_srv';
|
import {NavModel} from '../../nav_model_srv';
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ export function geminiScrollbar() {
|
|||||||
link: function(scope, elem, attrs) {
|
link: function(scope, elem, attrs) {
|
||||||
|
|
||||||
let scrollbar = new PerfectScrollbar(elem[0]);
|
let scrollbar = new PerfectScrollbar(elem[0]);
|
||||||
console.log('scrllbar!');
|
|
||||||
|
|
||||||
scope.$on('$destroy', () => {
|
scope.$on('$destroy', () => {
|
||||||
scrollbar.destroy();
|
scrollbar.destroy();
|
||||||
|
@ -46,4 +46,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -92,8 +92,6 @@
|
|||||||
.ps {
|
.ps {
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
}
|
}
|
||||||
}.ps:hover > .ps__rail-x,
|
|
||||||
.ps:hover > .ps__rail-y {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ps__rail-x:hover,
|
.ps__rail-x:hover,
|
||||||
|
@ -121,81 +121,88 @@
|
|||||||
margin-bottom: $spacer*2;
|
margin-bottom: $spacer*2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-breadcrumb {
|
.page-breadcrumbs {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 $spacer;
|
padding: 3px 1.5rem 1.5rem 1.5rem;
|
||||||
line-height: 0.5;
|
line-height: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
$page-breadcrumb__angle-1: 39px;
|
.breadcrumb {
|
||||||
$page-breadcrumb__angle-ul: 31px;
|
display: inline-block;
|
||||||
$page-breadcrumb__angle-a: 30px;
|
box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.35);
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 5px;
|
||||||
|
counter-reset: flag;
|
||||||
|
}
|
||||||
|
|
||||||
.page-breadcrumb__item {
|
.breadcrumb-item {
|
||||||
background: $page-nav-bg;
|
text-decoration: none;
|
||||||
box-shadow: $page-nav-shadow;
|
outline: none;
|
||||||
|
display: block;
|
||||||
> a {
|
float: left;
|
||||||
color: $page-nav-breadcrumb-color;
|
font-size: 12px;
|
||||||
font-size: $font-size-sm;
|
line-height: 36px;
|
||||||
display: block;
|
padding: 0 7px 0 37px;
|
||||||
padding: 0.6rem 1rem 0.6rem 3rem;;
|
@include gradientBar($btn-inverse-bg, $btn-inverse-bg-hl, $btn-inverse-text-color);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-shadow: $card-shadow;
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: -53px;
|
|
||||||
left: 100%;
|
|
||||||
content: '';
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
border: $page-breadcrumb__angle-1 solid transparent;
|
|
||||||
border-right-width: 0;
|
|
||||||
border-left-width: $page-breadcrumb__angle-a;
|
|
||||||
z-index: 2;
|
|
||||||
border-left-color: $page-nav-bg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
a {
|
padding-left: 13px;
|
||||||
padding-left: 1rem;
|
border-radius: 5px 0 0 5px; /*to match with the parent's radius*/
|
||||||
}
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&:first-child:before {
|
||||||
|
left: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-radius: 0 5px 5px 0; /*this was to prevent glitches on hover*/
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active,
|
||||||
|
&:hover {
|
||||||
|
background: #333;
|
||||||
|
background: linear-gradient(#333, #000);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active:after,
|
||||||
|
&:hover:after {
|
||||||
|
background: #333;
|
||||||
|
background: linear-gradient(135deg, #333, #000);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -53px;
|
top: 0;
|
||||||
left: 100%;
|
right: -18px; // half of square's length
|
||||||
content: '';
|
|
||||||
height: 0;
|
// same dimension as the line-height of .breadcrumb-item
|
||||||
width: 0;
|
width: 36px;
|
||||||
border: $page-breadcrumb__angle-1 solid transparent;
|
height: 36px;
|
||||||
border-right-width: 0;
|
|
||||||
border-left-width: $page-breadcrumb__angle-ul;
|
transform: scale(0.707) rotate(45deg);
|
||||||
|
// we need to prevent the arrows from getting buried under the next link
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
transform: translateX(4px);
|
|
||||||
border-left-color: #282020;
|
// background same as links but the gradient will be rotated to compensate with the transform applied
|
||||||
margin: 0;
|
background: linear-gradient(135deg, $btn-inverse-bg, $btn-inverse-bg-hl);
|
||||||
|
|
||||||
|
// stylish arrow design using box shadow
|
||||||
|
box-shadow: 2px -2px 0 2px rgb(35, 31, 31), 3px -3px 0 2px rgba(255, 255, 255, 0.1);
|
||||||
|
|
||||||
|
// 5px - for rounded arrows and
|
||||||
|
// 50px - to prevent hover glitches on the border created using shadows*/
|
||||||
|
border-radius: 0 5px 0 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
// we dont need an arrow after the last link
|
||||||
background: $breadcrumb-hover-hl;
|
&:last-child:after {
|
||||||
|
content: none;
|
||||||
.page-breadcrumb__caret {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
> a {
|
|
||||||
color: $text-color;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
border-left-color: $breadcrumb-hover-hl;
|
|
||||||
color: $text-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user