[Frontend] Styling for search elements

#70
Significant .scss and markup changes across search;
New symbols font (v2.2) char for clear icon;
To-do: style "load more" element;
This commit is contained in:
Charles Hacskaylo
2015-08-18 19:51:47 -07:00
parent e426e0e5ec
commit 4e3e3653a3
15 changed files with 879 additions and 930 deletions

View File

@@ -100,6 +100,7 @@ $ueAppLogoW: 105px;
$ueEditToolBarH: 25px;
$ueBrowseLeftPaneW: 25%;
$ueEditLeftPaneW: 75%;
$treeSearchInputBarH: 25px;
// Overlay
$ovrTopBarH: 60px;
$ovrFooterH: 40px;

View File

@@ -1,3 +1,4 @@
/*****************************************************************************
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
@@ -31,7 +32,7 @@
@import "global";
@import "fonts";
@import "user-environ/layout";
@import "search/layout";
//@import "search/layout";
@import "fixed-position";
@import "about";
@import "text";

View File

@@ -21,15 +21,15 @@
*****************************************************************************/
/******************************************************** MENUS */
.menu-element {
$bg: lighten($colorBodyBg, 5%);
$bg: lighten($colorBodyBg, 5%);
$bgHover: lighten($bg, 20%);
$iconColor: $colorKey;
cursor: pointer;
position: relative;
.menu {
@include border-radius($basicCr);
@include containerSubtle($bg);
@include txtShdwSubtle(0.2);
@include containerSubtle($bg);
@include txtShdwSubtle(0.2);
display: block; // set to block via jQuery
padding: $interiorMarginSm 0;
position: absolute;
@@ -37,11 +37,12 @@
ul {
@include menuUlReset();
li {
@include box-sizing(border-box);
@include box-sizing(border-box);
border-top: 1px solid lighten($bg, 20%);
color: lighten($bg, 60%);
line-height: $menuLineH;
padding: $interiorMarginSm $interiorMargin * 2 $interiorMarginSm ($interiorMargin * 2) + $treeTypeIconW;
position: relative;
white-space: nowrap;
&:first-child {
border: none;
@@ -61,7 +62,7 @@
// display: block;
//}
.type-icon {
left: $interiorMargin * 2;
left: $interiorMargin * 2;
}
}
}
@@ -77,7 +78,9 @@
@include containerSubtle($bg);
ul li {
padding-left: 25px;
a { color: $fg; }
a {
color: $fg;
}
.icon {
color: $ic;
}
@@ -90,99 +93,131 @@
}
}
.checkbox-menu {
// Used in search dropdown in tree
@extend .context-menu;
ul li {
padding-left: 50px;
.checkbox {
$d: 0.7rem;
position: absolute;
left: $interiorMargin;
top: ($menuLineH - $d) / 1.5;
em {
height: $d;
width: $d;
&:before {
font-size: 7px !important;// $d/2;
height: $d;
width: $d;
line-height: $d;
}
}
}
.type-icon {
left: 25px;
}
}
}
.super-menu {
$w: 500px;
$h: $w - 20;
$plw: 50%; //$w * 0.5;
$prw: 50%; //$w - $plw;
$fg: #fff; //lighten($colorBodyFg, 40%);
$bgHover: $colorKey; //$bg;
display: block;
width: $w;
height: $h;
.contents {
@include absPosDefault($interiorMargin);
}
.pane {
@include box-sizing(border-box);
&.left {
//@include test();
border-right: 1px solid rgba(white, 0.2);
left: 0;
padding-right: $interiorMargin;
right: auto;
width: $plw;
overflow-x: hidden;
overflow-y: auto;
ul {
li {
@include border-radius($controlCr);
padding-left: 30px;
border-top: none;
}
}
}
&.right {
//@include test(red);
left: auto;
right: 0;
padding: $interiorMargin * 5;
width: $prw;
.icon {
color: $fg;
}
}
}
.menu-item-description {
.desc-area {
&.icon {
$h: 150px;
position: relative;
font-size: 8em;
left: 0;
height: $h;
line-height: $h;
margin-bottom: $interiorMargin * 5;
text-align: center;
}
&.title {
color: $fg;
font-size: 1.2em;
margin-bottom: 0.5em;
}
&.description {
//color: lighten($bg, 30%);
color: $fg;
font-size: 0.8em;
line-height: 1.5em;
}
}
}
}
.context-menu {
font-size: 0.80rem;
}
.super-menu {
$w: 500px;
$h: $w - 20;
$plw: 50%; //$w * 0.5;
$prw: 50%; //$w - $plw;
$fg: #fff; //lighten($colorBodyFg, 40%);
$bgHover: $colorKey; //$bg;
display: block;
width: $w;
height: $h;
.contents {
@include absPosDefault($interiorMargin);
}
.pane {
@include box-sizing(border-box);
&.left {
//@include test();
border-right: 1px solid rgba(white, 0.2);
left: 0;
padding-right: $interiorMargin;
right: auto;
width: $plw;
overflow-x: hidden;
overflow-y: auto;
ul {
li {
@include border-radius($controlCr);
padding-left: 30px;
border-top: none;
}
}
}
&.right {
//@include test(red);
left: auto;
right: 0;
padding: $interiorMargin * 5;
width: $prw;
.icon {
color: $fg;
}
}
}
.menu-item-description {
.desc-area {
&.icon {
$h: 150px;
position: relative;
font-size: 8em;
left: 0;
height: $h;
line-height: $h;
margin-bottom: $interiorMargin * 5;
text-align: center;
}
&.title {
color: $fg;
font-size: 1.2em;
margin-bottom: 0.5em;
}
&.description {
//color: lighten($bg, 30%);
color: $fg;
font-size: 0.8em;
line-height: 1.5em;
}
}
}
}
.context-menu {
font-size: 0.80rem;
}
}
.context-menu-holder {
pointer-events: none;
position: absolute;
height: 200px;
width: 170px;
z-index: 70;
.context-menu-wrapper {
position: absolute;
height: 100%;
width: 100%;
.context-menu {
}
}
&.go-left .context-menu { right: 0; }
&.go-up .context-menu { bottom: 0; }
pointer-events: none;
position: absolute;
height: 200px;
width: 170px;
z-index: 70;
.context-menu-wrapper {
position: absolute;
height: 100%;
width: 100%;
.context-menu {
}
}
&.go-left .context-menu {
right: 0;
}
&.go-up .context-menu {
bottom: 0;
}
}
.btn-bar.right .menu,
.menus-to-left .menu {
left: auto; right: 0; width: auto;
left: auto;
right: 0;
width: auto;
}

View File

@@ -20,411 +20,327 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
.search-holder {
$iconWidth: 20px;
$leftMargin: 6px;
$rightPadding: 5px;
padding-right: $rightPadding;
top: 23px;
// Align with the top of the divider bar, below create button
margin-top: 10px;
.search {
display: flex;//block;
flex-direction: column;
height: 100%;
.search-bar {
$heightAdjust: 4px;
$textInputHeight: 19px; // This is equal to the default value, 19px
order: 1;
position: relative;
width: 100%;
height: $textInputHeight;
margin-top: $heightAdjust;
.search-input {
position: relative;
top: -$heightAdjust;
width: 100%;
height: $textInputHeight;
// For clear button
padding-right: 16px;
// Modifications for existence of menu icon:
padding-right: 16px + 12px;
// Make work for mct-control textfield
input {
width: 100%;
}
}
.search-icon {
color: $colorItemFg;
font-size: 12px;
// Make the icon within the left edge of the input area
margin-left: 3px;
width: 0;
height: 0;
// Line up icon with text input vertically
margin-top: -$textInputHeight;
transition: visibility .15s, opacity .15s, color .2s;
&.content {
// Make icon invisible whenever there is text input
visibility: hidden;
opacity: 0;
}
}
// Make icon invisible when the text input is focused
.search-input:focus + div.search-icon {
visibility: hidden;
opacity: 0;
}
// Make icon lighten when hovering over search bar
.search-input:hover + div.search-icon {
color: lighten($colorItemFg, 20%);
}
.clear-icon {
position: absolute;
display: block;
cursor: pointer;
color: $colorItemFg;
font-size: 6px;
padding: 6px;
padding-left: 4px;
right: 0px;
top: -3px;
// Icon is visible only when there is text input
visibility: hidden;
opacity: 0;
transition: visibility .15s, opacity .15s, color .2s;
&.content {
visibility: visible;
opacity: 1;
}
&:hover {
color: lighten($colorItemFg, 20%);
}
// Modifications for existence of menu icon:
right: 3px + 6px + 6px;
padding-right: 4px;
}
.menu-icon {
position: absolute;
display: block;
cursor: pointer;
color: $colorItemFg;
font-size: 6px;
padding: 6px;
padding-left: 3px;
right: 0px;
top: -3px;
transition: color .2s;
&:hover {
color: lighten($colorItemFg, 20%);
}
}
.search-menu-holder {
float: right;
margin-top: $textInputHeight - 2px;
left: -50px;
z-index: 9;
transition: visibility .05s, opacity .05s;
&.off {
visibility: hidden;
opacity: 0;
}
.search-menu {
border-top: 0;
.search-menu-item {
// Padding only on sides
padding-top: 0;
padding-bottom: 0;
padding-left: 4px;
padding-right: 6px;
font-size: 0.8em;
color: lighten($colorBodyBg, 70%);
cursor: pointer;
transition: background-color .13s;
.search-menu-checkbox {
// Vertically center
margin-top: 0.3em;
// Get rid of weird checkbox positioning
// from label.checkbox.custom
padding-left: 0;
margin-right: 0;
// Spacing with labels
padding-right: 2px;
// Change checkbox colors
em:before {
// check
color: white;
// box
background-color: grey;
// Change size
height: 12px;
width: 12px;
font-size: .7em;
}
}
.search-menu-glyph {
color: lighten($colorMenuIc, 5%);//lighten($colorItemFg, 35%);//$colorMenuIc;
}
&.special {
font-weight: bold;
background-color: lighten($colorBodyBg, 20%);
.search-menu-label {
font-size: 1.1em;
}
&:hover {
background-color: lighten($colorBodyBg, 30%);
}
}
}
}
}
// Make bubble caret thing
.search-menu-holder:after {
position: absolute;
top: -6px;
left: 35px;
display: inline-block;
border-right: 6px solid transparent;
//border-bottom: 6px solid white;
border-bottom: 6px solid rgb(94, 94, 94); // Where does this color come from?
border-left: 6px solid transparent;
content: '';
}
// Hovering reveals menu
.menu-icon:hover + div.search-menu-holder {
visibility: visible;
}
div.search-menu-holder:hover {
visibility: visible;
}
}
.active-filter-display {
order: 2;
font-size: .6em;
background-color: lighten($colorBodyBg, 10%);
border-radius: 2px;
border: 1px solid lighten($colorBodyBg, 5%);
padding-left: 4px;
padding-right: 4px;
//overflow: hidden;
margin-top: 2px;
.clear-filters-icon {
padding: 4px;
position: relative;
margin-left: -4px;
top: 0.7em;
cursor: pointer;
color: $colorItemFg;
font-size: 6px;
}
.filter-options {
position: relative;
top: -0.5em;
//margin-bottom: -5px;
// Hanging indent
margin-left: 14px;
text-indent: -4px;
}
// Transition looks weird when the results list has none
//transition: visibility .2s, opacity .2s;
&.off {
visibility: hidden;
opacity: 0;
height: 0;
margin: 0;
padding: 0;
border: 0;
}
}
.search-scroll {
order: 3;
//padding-right: $rightPadding;
margin-top: 4px;
// Adjustable scrolling size
overflow-y: auto;
top: auto;
height: auto;
max-height: 100%;
position: relative;
.results {
.abs.search-holder {
//@include test(#990000);
height: $treeSearchInputBarH;
bottom: 0;
&.active {
height: auto;
bottom: 0;
}
//top: 23px;
.search-result-item {
// Include transitions (for the highlights)
@include single-transition(background-color, 0.25s);
// Align with the top of the divider bar, below create button
//margin-top: 10px; // CH comment out
z-index:5;
}
// Space the results from each other
margin-bottom: 2px;
.search {
$iconWidth: 20px;
$leftMargin: 6px;
$rightPadding: 5px;
// Make the highlights the right color and shape.
// Attempting to match the style in the tree, but
// while having these be compact.
border-radius: 2px;
padding-top: 4px;
padding-bottom: 2px;
//padding-right: $rightPadding;
//@include test();
display: flex; //block;
flex-direction: column;
height: 100%;
.label {
// Give some padding away from the left side
margin-left: $leftMargin;
.search-bar {
//$heightAdjust: 4px;
$textInputHeight: 19px; // This is equal to the default value, 19px
$iconEdgeM: 4px;
$iconD: $treeSearchInputBarH - ($iconEdgeM*2);
font-size: 0.8em;
.title-label {
display: inline-block;
position: absolute;
//order: 1;
// Give some padding away from the left side
left: $leftMargin + 3px + $iconWidth;
// and the right side
right: $rightPadding;
position: relative;
width: 100%;
//height: $textInputHeight;
//margin-top: $heightAdjust;
.search-input,
.search-icon {
}
.search-input {
height: $treeSearchInputBarH;
line-height: $treeSearchInputBarH;
padding-top: 0;
padding-bottom: 0;
}
.search-icon,
.clear-icon,
.menu-icon {
//@include test(#008800);
@include box-sizing(border-box);
color: $colorItemFg;
height: $iconD; width: $iconD;
line-height: $iconD;
position: absolute;
text-align: center;
top: $iconEdgeM;
}
// Size and position the text
font-size: .8em;
line-height: 17px;
.clear-icon,
.menu-icon {
cursor: pointer;
transition: color .25s;
}
// Hide overflow text
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
// Change styling when it's selected
&.selected {
$c: #fff;
background: $colorKeySelectedBg;
color: $c;
.view-control {
color: $colorItemTreeIcon;
}
.label .type-icon {
color: #fff;
}
}
.search-input {
position: relative;
width: 100%;
padding-left: $iconD + $interiorMargin !important;
padding-right: ($iconD * 2) + ($interiorMargin * 2) !important;
// Change styling when it's being hovered over
&:not(.selected) {
&:hover {
background: lighten($colorBodyBg, 5%);
color: lighten($colorBodyFg, 20%);
.context-trigger {
display: block;
}
.icon {
color: $colorItemTreeIconHover;
}
}
}
}
}
// Make work for mct-control textfield
input {
width: 100%;
}
}
.load-icon {
position: relative;
&.loading {
pointer-events: none;
margin-left: $leftMargin;
.search-icon {
color: $colorItemFg;
left: $interiorMarginSm;
transition: visibility .15s, opacity .15s, color .2s;
pointer-events: none;
.title-label {
// Text styling
font-style: italic;
font-size: .9em;
opacity: 0.5;
&.content {
// Make icon invisible whenever there is text input
//visibility: hidden;
//opacity: 0;
}
}
// Text positioning
margin-left: $iconWidth + $leftMargin;
line-height: 24px;
}
.wait-spinner {
margin-left: $leftMargin;
}
}
// Make icon invisible when the text input is focused
.search-input:focus + div.search-icon {
//visibility: hidden;
//opacity: 0;
}
&:not(.loading) {
cursor: pointer;
}
}
// Make icon lighten when hovering over search bar
.search-input:hover + div.search-icon {
color: lighten($colorItemFg, 20%);
}
.load-more-button {
// Space away form the results list
margin-top: 5px;
margin-bottom: 5px;
.clear-icon {
right: $iconD + $interiorMargin;
// Center it
position: relative;
left: 25%;
width: 50%;
white-space: nowrap;
// Icon is visible only when there is text input
visibility: hidden;
opacity: 0;
// Make smallish button
height: 20px;
line-height: 11px;
font-size: 0.7em;
}
}
}
transition: visibility .15s, opacity .15s, color .2s;
&.content {
visibility: visible;
opacity: 1;
}
&:hover {
color: lighten($colorItemFg, 20%);
}
}
.menu-icon {
font-size: 0.8em;
padding-right: $iconEdgeM;
right: $iconEdgeM;
text-align: right;
&:hover {
color: lighten($colorItemFg, 20%);
}
}
.search-menu-holder {
float: right;
//margin-top: $textInputHeight - 2px;
//left: -50px;
left: -20px;
z-index: 1;
transition: visibility .05s, opacity .05s;
&.off {
visibility: hidden;
opacity: 0;
}
}
// Hovering reveals menu
.menu-icon:hover + div.search-menu-holder {
visibility: visible;
}
div.search-menu-holder:hover {
visibility: visible;
}
}
.active-filter-display {
//order: 2;
$s: 0.65em;
$p: $interiorMargin;
@include border-radius($basicCr);
@include box-sizing(border-box);
line-height: 130%;
padding: $p 0;
padding-left: $s * 2.25;
font-size: $s;
//background-color: rgba(#000, 0.3);
//border-radius: $basicCr;
margin-top: $interiorMarginSm;
.clear-filters-icon {
opacity: 0.4;
font-size: 0.8em;
position: absolute;
left: 1px;
cursor: pointer;
}
// Transition looks weird when the results list has none
//transition: visibility .2s, opacity .2s;
&.off {
visibility: hidden;
opacity: 0;
height: 0;
margin: 0;
padding: 0;
border: 0;
}
}
.search-scroll {
order: 3;
//padding-right: $rightPadding;
margin-top: 4px;
// Adjustable scrolling size
overflow-y: auto;
top: auto;
height: auto;
max-height: 100%;
position: relative;
.results {
.search-result-item {
// Include transitions (for the highlights)
@include single-transition(background-color, 0.25s);
// Space the results from each other
margin-bottom: 2px;
// Make the highlights the right color and shape.
// Attempting to match the style in the tree, but
// while having these be compact.
border-radius: 2px;
padding-top: 4px;
padding-bottom: 2px;
.label {
// Give some padding away from the left side
margin-left: $leftMargin;
.title-label {
display: inline-block;
position: absolute;
// Give some padding away from the left side
left: $leftMargin + 3px + $iconWidth;
// and the right side
right: $rightPadding;
// Size and position the text
font-size: .8em;
line-height: 17px;
// Hide overflow text
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
// Change styling when it's selected
&.selected {
$c: #fff;
background: $colorKeySelectedBg;
color: $c;
.view-control {
color: $colorItemTreeIcon;
}
.label .type-icon {
color: #fff;
}
}
// Change styling when it's being hovered over
&:not(.selected) {
&:hover {
background: lighten($colorBodyBg, 5%);
color: lighten($colorBodyFg, 20%);
.context-trigger {
display: block;
}
.icon {
color: $colorItemTreeIconHover;
}
}
}
}
}
.load-icon {
position: relative;
&.loading {
pointer-events: none;
margin-left: $leftMargin;
.title-label {
// Text styling
font-style: italic;
font-size: .9em;
opacity: 0.5;
// Text positioning
margin-left: $iconWidth + $leftMargin;
line-height: 24px;
}
.wait-spinner {
margin-left: $leftMargin;
}
}
&:not(.loading) {
cursor: pointer;
}
}
.load-more-button {
// Space away form the results list
margin-top: 5px;
margin-bottom: 5px;
// Center it
position: relative;
left: 25%;
width: 50%;
white-space: nowrap;
// Make smallish button
height: 20px;
line-height: 11px;
font-size: 0.7em;
}
}
}

View File

@@ -229,10 +229,12 @@
bottom: $interiorMargin;
}
}
.search-holder {
top: $ueTopBarH + $interiorMarginLg;
}
.tree-holder {
overflow: auto;
top: $ueTopBarH + $interiorMarginLg;
padding-right: $interiorMargin;
top: $ueTopBarH + $interiorMarginLg + $treeSearchInputBarH + $interiorMargin;
}
}
&.items {