Skip to content

Commit

Permalink
Style/connect catalog<->map buttons; move CSS
Browse files Browse the repository at this point in the history
- Move the catalogSearchView into it's own CSS file to keep it more manageable [WIP]
- Add and style the show/hide map button & filter by extent toggle. Connect them to their actions.

Relates to: #2069, #2065
  • Loading branch information
robyngit committed Apr 7, 2023
1 parent 6bc3a13 commit f02d1a2
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 101 deletions.
198 changes: 198 additions & 0 deletions src/css/catalog-search-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
/******************************************
** CatalogSearchView ***
******************************************/

/*
TODO:
- transfer over any other styles specific to this component
- make sure there are not conflicts with the old data catalog view
- see if there are any theme-specific overrides for this search view that we can eliminate.
- switch what we can to CSS variables
*/

.catalog-search-view {
height: 100%;
}

.catalog-search-inner {
height: 100%;
display: grid;
justify-content: stretch;
align-items: stretch;
grid-template-columns: auto 1fr 1fr;
grid-template-rows: 100%;
}

.catalog-search-view .filter-groups-container {
width: 215px;
padding: var(--pad);
padding-bottom: 3rem;
overflow: scroll;
}

.catalog-search-body.mapMode {
height: 100vh;
width: 100vw;
padding-bottom: 0px;
display: grid;
align-items: stretch;
justify-content: stretch;
overflow: hidden;
}

.catalog-search-body.mapMode .search-results-view .result-row:last-child {
margin-bottom: 100px;
}

.search-results-container {
overflow-y: scroll;
height: 100%;
}

.search-results-panel-container {
display: grid;
grid-auto-columns: 1fr;
grid-template-columns: max-content 1fr;
grid-template-rows: min-content min-content min-content 1fr;
gap: 0px 0px;
grid-template-areas:
"map-toggle-container map-toggle-container"
"title-container title-container"
"pager-container sorter-container"
"search-results-container search-results-container";
}

.search-results-container {
grid-area: search-results-container;
}

.pager-container {
grid-area: pager-container;
}

.sorter-container {
grid-area: sorter-container;
justify-self: end;
padding-right: var(--pad);
}

.title-container {
grid-area: title-container;
}

.map-toggle-container {
grid-area: map-toggle-container;
}

.catalog-search-body.mapMode .search-results-panel-container .map-toggle-container {
display: none;
}

.catalog-search-body.listMode .catalog-search-inner {
grid-template-columns: auto 1fr 0;
}

.catalog-search-view .cesium-widget-view {
width: inherit;
margin-left: 0;
}

.search-results-view .result-row {
padding: var(--pad);
}

.catalog-search-view .no-search-results {
padding: var(--pad);
text-align: center;
}



.map-panel-container {
position: relative;
}

/* When map is hidden... */
.listMode .map-panel-container {
position: unset;
}

.listMode .catalog-search-inner {
position: relative;
}

.catalog-search-body.listMode .map-panel-container {
display: block;
}

.listMode .map-container {
display: none;
}



/* map controls */

.map-controls {
position: absolute;
top: 1rem;
left: 1rem;
z-index: 1;
display: grid;
grid-template-columns: auto auto;
gap: 1rem;
align-items: center;
}
.listMode .map-controls {
right: 1.1rem;
left: auto;
top: 0.3rem;
gap: 0;
}

.show-hide-map-button {
background-color: #19B36A;
color: white;
padding: 0.3rem 0.5rem;
cursor: pointer;
box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.15), 0 1px 14px -6px rgba(0, 0, 0, 0.28);
border-radius: 0.5rem;
letter-spacing: 0.02em;
}

.show-hide-map-button:hover {
background-color: #1E9E5A;
color: white;
/* make a smaller darker box shadow than in the non-hover state */
box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 5px -2px rgba(0, 0, 0, 0.3);
}

/* Spatial Filter Toggle */
.spatial-filter{
display: grid;
grid-template-columns: auto auto;
background: var(--map-col-bkg, black);
color: var(--map-col-text, white);
border-radius: 0.5rem;
opacity: 0.8;
top: 0.5rem;
padding: 0.3rem 0.5rem;
box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.15), 0 1px 14px -6px rgba(0, 0, 0, 0.28);
}
.listMode .spatial-filter {
display: none;
}
.spatial-filter-label{
margin: 0;
}
/* rule is specific to overwrite bootstrap */
input[type=checkbox].spatial-filter-checkbox{
margin: 0;
margin-right: 0.5rem;
/* make it look nicer */
transform: scale(1.2);
/* put it to the left of the label */
order: -1;
margin-right: 0.5rem;

}
81 changes: 0 additions & 81 deletions src/css/metacatui-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -545,87 +545,6 @@ text-shadow: none;
.data-tag-icon.crimson g{
fill: #800000;
}
/******************************************
** CatalogSearchView ***
******************************************/

.catalog-search-view {
height: 100%;
}
.catalog-search-inner{
height: 100%;
display: grid;
justify-content: stretch;
align-items: stretch;
grid-template-columns: auto 1fr 1fr;
grid-template-rows: 100%;
}
.catalog-search-view .filter-groups-container {
width: 215px;
padding: var(--pad);
padding-bottom: 3rem;
overflow: scroll;
}

.catalog-search-body.mapMode{
height: 100vh;
width: 100vw;
padding-bottom: 0px;
display: grid;
align-items: stretch;
justify-content: stretch;
overflow: hidden;
}

.catalog-search-body.mapMode .search-results-view .result-row:last-child{
margin-bottom: 100px;
}

.search-results-container {
overflow-y: scroll;
height: 100%;
}
.search-results-panel-container{
display: grid;
grid-auto-columns: 1fr;
grid-template-columns: max-content 1fr;
grid-template-rows: min-content min-content min-content 1fr;
gap: 0px 0px;
grid-template-areas:
"map-toggle-container map-toggle-container"
"title-container title-container"
"pager-container sorter-container"
"search-results-container search-results-container";
}
.search-results-container { grid-area: search-results-container; }
.pager-container { grid-area: pager-container; }
.sorter-container {
grid-area: sorter-container;
justify-self: end;
padding-right: var(--pad);
}
.title-container { grid-area: title-container; }
.map-toggle-container { grid-area: map-toggle-container; }
.catalog-search-body.mapMode .search-results-panel-container .map-toggle-container{
display: none;
}
.catalog-search-body.listMode .map-panel-container{
display: none;
}
.catalog-search-body.listMode .catalog-search-inner{
grid-template-columns: auto 1fr 0;
}
.catalog-search-view .cesium-widget-view {
width: inherit;
margin-left: 0;
}
.search-results-view .result-row{
padding: var(--pad);
}
.catalog-search-view .no-search-results{
padding: var(--pad);
text-align: center;
}

/******************************************
** Results and Result Rows ***
Expand Down
27 changes: 12 additions & 15 deletions src/js/templates/search/catalogSearch.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
<section class="catalog-search-inner">
<div class="filter-groups-container"></div>
<div class="search-results-panel-container">
<div class="map-toggle-container">
<a class="toggle-map">
<i class="icon icon-double-angle-left"></i>
Show Map
</a>
</div>
<div class="title-container"></div>
<div class="pager-container"></div>
<div class="sorter-container"></div>
<div class="search-results-container"></div>
</div>
<div class="map-panel-container">
<div class="map-toggle-container">
<a class="toggle-map">
<div class="map-controls">
<a class="show-hide-map-button">
Hide Map
<i class="icon icon-double-angle-right"></i>
<i class="icon icon-angle-right"></i>
</a>
<label class="toggle-map-filter">Limit my search to the map area</label>
<input
type="checkbox"
name="map"
checked="true"
class="toggle-map-filter" />
<div class="spatial-filter">
<label class="spatial-filter-label" for="toggle-spatial-filter">Limit my search to the map area</label>
<input
id="toggle-spatial-filter"
type="checkbox"
name="map"
checked="true"
class="spatial-filter-checkbox" />
</div>
</div>
<div class="map-container"></div>
</div>
Expand Down
Loading

0 comments on commit f02d1a2

Please sign in to comment.