mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Scene Filter sidebar (#5714)
* Add Sidebar component * Add PerformerQuickFilter to Scene filter sidebar * Add other quick filters * Add confirmVariant field to AlertModal * Add SidebarSavedFilterList * Add sidebar toggle button * Add data-type attr for criterion option * Refactor LabeledIdFilter * Move search input into sidebar * Save sidebar state in local forage * Add sidebar rating filter * Add organised filter * Open sidebar to / key. Focus search input on sidebar open * Blur clearable input on escape key
This commit is contained in:
@@ -303,6 +303,12 @@ button.collapse-button {
|
||||
.file-info-panel a > & {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&.inline {
|
||||
display: inline;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.RatingStars {
|
||||
@@ -728,3 +734,193 @@ button.btn.favorite-button {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sidebar-width: 250px;
|
||||
|
||||
.sidebar-pane {
|
||||
display: flex;
|
||||
|
||||
.sidebar {
|
||||
// TODO - use different colours for sidebar and toolbar
|
||||
background-color: $body-bg;
|
||||
border-right: 1px solid $secondary;
|
||||
flex: $sidebar-width;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-left: 15px;
|
||||
transition: margin-left 0.1s;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin-top: 4rem;
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
scrollbar-gutter: stable;
|
||||
top: 0;
|
||||
width: $sidebar-width;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
&.hide-sidebar .sidebar {
|
||||
margin-left: -$sidebar-width;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
flex-grow: 1;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
&.hide-sidebar {
|
||||
> :nth-child(2) {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(xl) {
|
||||
transition: margin-left 0.1s;
|
||||
|
||||
&:not(.hide-sidebar) {
|
||||
> :nth-child(2) {
|
||||
margin-left: calc($sidebar-width - 15px);
|
||||
}
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-down(xs) {
|
||||
.sidebar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.hide-sidebar .sidebar {
|
||||
margin-left: -100%;
|
||||
}
|
||||
|
||||
&.hide-sidebar > :nth-child(2) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-down(xs) {
|
||||
display: block;
|
||||
|
||||
.sidebar {
|
||||
margin-bottom: $navbar-height;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-toolbar {
|
||||
// TODO - use different colours for sidebar and toolbar
|
||||
background-color: $body-bg;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 1rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
@include media-breakpoint-down(xs) {
|
||||
.sidebar-toolbar {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-section {
|
||||
border-bottom: 1px solid $secondary;
|
||||
|
||||
.collapse-header {
|
||||
// background-color: $secondary;
|
||||
|
||||
padding: 0.25rem;
|
||||
|
||||
.collapse-button {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.collapse,
|
||||
// include collapsing to allow for the transition
|
||||
.collapsing {
|
||||
padding-top: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-section:first-child .collapse-header {
|
||||
border-top: 1px solid $secondary;
|
||||
}
|
||||
|
||||
$sticky-header-height: calc(50px + 3.3rem);
|
||||
|
||||
// special case for sidebar in details view
|
||||
.detail-body {
|
||||
.sidebar {
|
||||
// required for sticky to work
|
||||
align-self: flex-start;
|
||||
|
||||
// take a further 15px padding to match the detail body
|
||||
height: calc(100vh - $sticky-header-height - 15px);
|
||||
margin-top: -15px;
|
||||
max-height: calc(100vh - $sticky-header-height - 15px);
|
||||
overflow-y: auto;
|
||||
padding-left: 0;
|
||||
position: sticky;
|
||||
|
||||
// sticky detail header is 50px + 3.3rem
|
||||
top: calc(50px + 3.3rem);
|
||||
|
||||
.sidebar-toolbar {
|
||||
padding-top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-pane.hide-sidebar .sidebar {
|
||||
left: -$sidebar-width;
|
||||
margin-left: calc(-15px - $sidebar-width);
|
||||
}
|
||||
|
||||
// on smaller viewports we want the sidebar to overlap content
|
||||
@include media-breakpoint-down(lg) {
|
||||
.sidebar-pane:not(.hide-sidebar) .sidebar {
|
||||
margin-right: -$sidebar-width;
|
||||
}
|
||||
|
||||
.sidebar-pane > :nth-child(2) {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-down(xs) {
|
||||
.sidebar {
|
||||
flex: 100% 0 0;
|
||||
height: calc(100vh - 4rem);
|
||||
max-height: calc(100vh - 4rem);
|
||||
padding-top: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.sidebar-pane:not(.hide-sidebar) .sidebar {
|
||||
margin-right: -100%;
|
||||
}
|
||||
|
||||
.sidebar-pane.hide-sidebar .sidebar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-up(xl) {
|
||||
.sidebar-pane:not(.hide-sidebar) {
|
||||
> :nth-child(2) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-pane.hide-sidebar {
|
||||
> :nth-child(2) {
|
||||
padding-left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user