-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scrollable Side-to-side button row presentation for mobile
- Loading branch information
Showing
6 changed files
with
253 additions
and
103 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/app/portal/components/tab-navigation-button/tab-navigation-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a [routerLink]='routerLink' [queryParams]='queryParams' [class.active-text]='active'> | ||
<div> | ||
{{label}} | ||
</div> | ||
|
||
<ng-container *ngIf='count !== -1'> | ||
<div [countUp]="count" [options]="countOps" [reanimateOnClick]='false'> | ||
{{count}} | ||
</div> | ||
</ng-container> | ||
|
||
<ng-container *ngIf='count === -1'> | ||
<div></div> | ||
</ng-container> | ||
</a> |
45 changes: 45 additions & 0 deletions
45
src/app/portal/components/tab-navigation-button/tab-navigation-button.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
:host { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
|
||
width: 180px; | ||
flex: 0 0 180px; | ||
height: 90px; | ||
|
||
text-align: center; | ||
cursor: pointer; | ||
scroll-snap-align: start; | ||
|
||
box-sizing: border-box; | ||
|
||
font-size: 1rem; | ||
line-height: 1.5; | ||
color: #4546B9; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: inherit; | ||
user-select: none; | ||
} | ||
|
||
.active-text { | ||
font-weight: 700; | ||
} | ||
|
||
.active { | ||
border: #3366cc 1px solid; | ||
border-bottom: initial; | ||
} | ||
|
||
.not-active { | ||
background-color: #e8e8f5; | ||
border-top: 15px solid white; | ||
border-bottom: #3366cc 1px solid; | ||
} | ||
|
||
.disabled { | ||
background-color: #f0f0f0; | ||
color: #b3b3b3; | ||
cursor: not-allowed; | ||
} |
33 changes: 33 additions & 0 deletions
33
src/app/portal/components/tab-navigation-button/tab-navigation-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Component, HostBinding, Input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterLink, RouterLinkWithHref } from '@angular/router'; | ||
import { CountUpModule } from 'ngx-countup'; | ||
|
||
@Component({ | ||
selector: 'app-tab-navigation-button', | ||
standalone: true, | ||
imports: [CommonModule, RouterLink, RouterLinkWithHref, CountUpModule], | ||
templateUrl: './tab-navigation-button.component.html', | ||
styleUrls: ['./tab-navigation-button.component.scss'] | ||
}) | ||
export class TabNavigationButtonComponent { | ||
@Input() label: string; | ||
@Input() count: number; | ||
|
||
@Input() routerLink: string; | ||
@Input() queryParams: any; | ||
|
||
@Input() active = false; | ||
@Input() disabled = false; | ||
|
||
@HostBinding('class.active') get isActive() { return this.active; } | ||
@HostBinding('class.not-active') get isNotActive() { return !this.active; } | ||
@HostBinding('class.disabled') get isDisabled() { return this.disabled; } | ||
|
||
countOps = { | ||
duration: 0.5, | ||
separator: ' ', | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.