Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visually differentiate sort components from filter components #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/assets/svg/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.battlegrounds-filters {
display: flex;

::ng-deep filter-dropdown ng-select {
::ng-deep filter-dropdown ng-select,
::ng-deep sort-dropdown ng-select {
margin-right: 15px;
width: 155px;
height: 30px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.filter, .filter-info{
margin-bottom: 5px;
}
.filter-dropdown, .search{
.filter-dropdown, .sort-dropdown, .search{
margin-right: 15px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
duels-filter-dropdown,
.filter {
// So that the margin is not applied if the filter is not displayed (no ng-select element)
::ng-deep filter-dropdown ng-select {
::ng-deep filter-dropdown ng-select,
::ng-deep sort-dropdown ng-select {
margin-bottom: 15px;
}
}
Expand Down
167 changes: 167 additions & 0 deletions core/src/css/component/sort-dropdown.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
@import '../global/variables';
@import '../global/fonts';

:host() {
display: flex;
flex-shrink: 0;
}

ng-select.disabled {
opacity: 0;
position: absolute;
}

::ng-deep ng-select {
@extend %search-active;
color: var(--color-1);
height: 30px;
background: rgba(255, 255, 255, 0.08);
width: 155px;
transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, max-height 0.4s ease-in-out;

&:focus,
&:active {
outline: none;
}

& > div {
border: 1px solid var(--color-3) !important;
outline: none;

div.single > div.toggle:hover {
background: transparent;
}
}

.placeholder {
position: relative;
color: var(--color-1) !important;
}

.toggle {
display: none;
}

.caret {
color: var(--color-1);
width: 30px;
height: 30px;
position: relative;

svg {
width: 100%;
height: 100%;
fill: currentColor;
}
}

.selected-icon {
color: var(--color-1);
position: relative;
left: 8px;

& > svg {
width: 30px;
height: 30px;
}
}

.open .caret {
transform: scale(1, -1);
}

select-dropdown {
& > div {
background: var(--color-7);
border: 1px solid var(--secondary-text-color);
border-top: none;
outline: none;
}

.below {
z-index: 99;
}

.filter {
display: none;
}

& > div .options {
max-height: 350px;

ul li {
color: var(--color-1);
border-bottom: 1px solid var(--color-3);
padding: 0;
padding-left: 9px;
padding-right: 10px;
display: flex;
justify-content: space-between;
align-items: center;
height: 30px;

&.unselectable {
pointer-events: none;
}

&.selected {
background-color: inherit;
color: inherit;

&:hover {
color: inherit;
}
}

&.highlighted,
&:hover {
background-color: var(--color-4);
}

span {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}

&::-webkit-scrollbar {
width: 5px;
height: 0; // Always hide horizontal scrollbars
}

&::-webkit-scrollbar-track {
display: none;
}

&::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb-color);
}

&::-webkit-scrollbar-thumb:hover {
background: var(--on-scrollbar-thumb-color);
}

&::-webkit-scrollbar-button {
display: none;
}

&::-webkit-scrollbar-track-piece {
display: none;
}
}
}
}

.tooltip {
width: 15px;
height: 15px;
--icon-color: var(--color-1);
margin-left: 5px;
}

.info {
margin-left: 5px;
margin-top: 2px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import { AbstractSubscriptionComponent } from '../../../abstract-subscription.co
styleUrls: [
`../../../../../css/global/filters.scss`,
`../../../../../css/component/app-section.component.scss`,
`../../../../../css/component/filter-dropdown.component.scss`,
`../../../../../css/component/sort-dropdown.component.scss`,
],
template: `
<filter-dropdown
<sort-dropdown
*ngIf="filter$ | async as value"
class="battlegrounds-hero-sort-dropdown"
[attr.aria-label]="'Sort by'"
Expand All @@ -36,7 +36,7 @@ import { AbstractSubscriptionComponent } from '../../../abstract-subscription.co
[placeholder]="value.placeholder"
[visible]="value.visible"
(onOptionSelected)="onSelected($event)"
></filter-dropdown>
></sort-dropdown>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import { AbstractSubscriptionComponent } from '../../../abstract-subscription.co
styleUrls: [
`../../../../../css/global/filters.scss`,
`../../../../../css/component/app-section.component.scss`,
`../../../../../css/component/filter-dropdown.component.scss`,
`../../../../../css/component/sort-dropdown.component.scss`,
],
template: `
<filter-dropdown
<sort-dropdown
*ngIf="filter$ | async as value"
[options]="value.options"
[filter]="value.filter"
[placeholder]="value.placeholder"
[visible]="value.visible"
(onOptionSelected)="onSelected($event)"
></filter-dropdown>
></sort-dropdown>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ import { AbstractSubscriptionComponent } from '../../../abstract-subscription.co
styleUrls: [
`../../../../../css/global/filters.scss`,
`../../../../../css/component/app-section.component.scss`,
`../../../../../css/component/filter-dropdown.component.scss`,
`../../../../../css/component/sort-dropdown.component.scss`,
],
template: `
<filter-dropdown
<sort-dropdown
*ngIf="filter$ | async as value"
class="duels-hero-filter-dropdown"
[options]="options"
[filter]="value.filter"
[placeholder]="value.placeholder"
[visible]="value.visible"
(onOptionSelected)="onSelected($event)"
></filter-dropdown>
></sort-dropdown>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import { AbstractSubscriptionComponent } from '../../../abstract-subscription.co
styleUrls: [
`../../../../../css/global/filters.scss`,
`../../../../../css/component/app-section.component.scss`,
`../../../../../css/component/filter-dropdown.component.scss`,
`../../../../../css/component/sort-dropdown.component.scss`,
],
template: `
<filter-dropdown
<sort-dropdown
*ngIf="filter$ | async as value"
class="duels-treasures-sort-dropdown"
[options]="options"
[filter]="value.filter"
[placeholder]="value.placeholder"
[visible]="value.visible"
(onOptionSelected)="onSelected($event)"
></filter-dropdown>
></sort-dropdown>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
Loading