-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
253 additions
and
103 deletions.
There are no files selected for viewing
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
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,20 @@ | ||
import { Component } from '@angular/core'; | ||
import {NgOptimizedImage} from "@angular/common"; | ||
import {RouterLink} from "@angular/router"; | ||
|
||
@Component({ | ||
selector: 'app-header-logo', | ||
standalone: true, | ||
imports: [ | ||
NgOptimizedImage, | ||
RouterLink | ||
], | ||
template: ` | ||
<a routerLink="/" title="Home" class="py-1"> | ||
<img ngSrc="/assets/logo.svg" alt="Refresh Logo" width="48" height="48" priority> | ||
</a> | ||
` | ||
}) | ||
export class HeaderLogoComponent { | ||
|
||
} |
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
36 changes: 36 additions & 0 deletions
36
src/app/components/ui/header/mobile/header-mobile.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,36 @@ | ||
import { Component } from '@angular/core'; | ||
import {HeaderLogoComponent} from "../header-logo.component"; | ||
import {FaIconComponent} from "@fortawesome/angular-fontawesome"; | ||
import {faBars, faSignInAlt} from "@fortawesome/free-solid-svg-icons"; | ||
import {HeaderMeComponent} from "../header-me.component"; | ||
import {NavbarItemComponent} from "../navbar-item.component"; | ||
import {HeaderNavbarMobileComponent} from "./header-navbar-mobile.component"; | ||
|
||
@Component({ | ||
selector: 'app-header-mobile', | ||
standalone: true, | ||
imports: [ | ||
HeaderLogoComponent, | ||
FaIconComponent, | ||
HeaderMeComponent, | ||
NavbarItemComponent, | ||
HeaderNavbarMobileComponent | ||
], | ||
template: ` | ||
<header class="flex items-center bg-header-background gap-x-1 px-5 sticky top-0 left-0 w-full z-[1000] text-xl h-[60px] justify-between"> | ||
<app-header-navbar-mobile></app-header-navbar-mobile> | ||
<app-header-logo class="absolute left-1/2 -translate-x-1/2"></app-header-logo> | ||
@defer { | ||
<app-header-me [arrow]="false" class=""></app-header-me> | ||
} @placeholder { | ||
<app-navbar-item href="/login" [icon]=faSignInAlt class=""></app-navbar-item> | ||
} | ||
</header> | ||
` | ||
}) | ||
export class HeaderMobileComponent { | ||
protected readonly faBars = faBars; | ||
protected readonly faSignInAlt = faSignInAlt; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/app/components/ui/header/mobile/header-navbar-mobile.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,48 @@ | ||
import {Component} from '@angular/core'; | ||
import {DialogComponent} from "../../dialog.component"; | ||
import {FaIconComponent} from "@fortawesome/angular-fontawesome"; | ||
import {faBars, faXmark} from "@fortawesome/free-solid-svg-icons"; | ||
import {navTree, rightNavTree} from '../navtypes'; | ||
import {HeaderNavbarSectionMobileComponent} from "./header-navbar-section-mobile.component"; | ||
import {DividerComponent} from "../../divider.component"; | ||
|
||
@Component({ | ||
selector: 'app-header-navbar-mobile', | ||
standalone: true, | ||
imports: [ | ||
DialogComponent, | ||
FaIconComponent, | ||
HeaderNavbarSectionMobileComponent, | ||
DividerComponent | ||
], | ||
template: ` | ||
<fa-icon [icon]="show ? faXmark : faBars" class="text-3xl" (click)="toggleModal()"></fa-icon> | ||
@defer (when show) { @if (show) { | ||
<div class="backdrop-brightness-50 absolute left-0 top-[60px] z-[1001] w-full"> | ||
<div class="bg-header-background h-[100vh] w-64 font-normal px-5 py-2.5 flex flex-col gap-y-4"> | ||
@for(category of navTree; track category.name) { | ||
<app-header-navbar-section-mobile [category]="category"></app-header-navbar-section-mobile> | ||
} | ||
<app-divider></app-divider> | ||
@for(category of rightNavTree; track category.name) { | ||
<app-header-navbar-section-mobile [category]="category"></app-header-navbar-section-mobile> | ||
} | ||
</div> | ||
</div> | ||
}} | ||
` | ||
}) | ||
export class HeaderNavbarMobileComponent { | ||
protected show: boolean = true; | ||
|
||
toggleModal(): void { | ||
this.show = !this.show; | ||
} | ||
|
||
protected readonly navTree = navTree; | ||
protected readonly rightNavTree = rightNavTree; | ||
|
||
protected readonly faBars = faBars; | ||
protected readonly faXmark = faXmark; | ||
} |
31 changes: 31 additions & 0 deletions
31
src/app/components/ui/header/mobile/header-navbar-section-mobile.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,31 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {NavCategory} from "../navtypes"; | ||
import {DarkContainerComponent} from "../../dark-container.component"; | ||
import {ContainerTitleComponent} from "../../text/container-title.component"; | ||
import {FaIconComponent} from "@fortawesome/angular-fontawesome"; | ||
import {NavbarItemComponent} from "../navbar-item.component"; | ||
|
||
@Component({ | ||
selector: 'app-header-navbar-section-mobile', | ||
standalone: true, | ||
imports: [ | ||
DarkContainerComponent, | ||
ContainerTitleComponent, | ||
FaIconComponent, | ||
NavbarItemComponent | ||
], | ||
template: ` | ||
<div class="bg-backdrop rounded-md px-2.5 py-1 flex flex-row gap-x-1.5 text-lg"> | ||
<fa-icon [icon]="category.icon"></fa-icon> | ||
<span>{{category.name}}</span> | ||
</div> | ||
<div class="flex flex-col gap-y-1 pt-2"> | ||
@for (item of category.items; track item.route) { | ||
<app-navbar-item [icon]="item.icon" [title]="item.name" [href]="item.route" iconClass="w-4 text-[1.1rem]" labelClass="text-md"></app-navbar-item> | ||
} | ||
</div> | ||
` | ||
}) | ||
export class HeaderNavbarSectionMobileComponent { | ||
@Input({required: true}) category: NavCategory = null!; | ||
} |
Oops, something went wrong.