diff --git a/apps/NwaifuAnime/src/app/app.component.html b/apps/NwaifuAnime/src/app/app.component.html index fc8bdc9..e419ca1 100644 --- a/apps/NwaifuAnime/src/app/app.component.html +++ b/apps/NwaifuAnime/src/app/app.component.html @@ -6,6 +6,6 @@

Update not available

} } - +
diff --git a/apps/NwaifuAnime/src/app/app.component.ts b/apps/NwaifuAnime/src/app/app.component.ts index 1454a07..e8c9471 100644 --- a/apps/NwaifuAnime/src/app/app.component.ts +++ b/apps/NwaifuAnime/src/app/app.component.ts @@ -26,4 +26,8 @@ export class AppComponent { get serviceWorkerEnabled() { return this.sw.serviceWorkerEnabled; } + + onSearch(text: string) { + console.log(text); + } } diff --git a/apps/NwaifuAnime/src/app/app.routes.ts b/apps/NwaifuAnime/src/app/app.routes.ts index 736341b..814f55a 100644 --- a/apps/NwaifuAnime/src/app/app.routes.ts +++ b/apps/NwaifuAnime/src/app/app.routes.ts @@ -1,4 +1,9 @@ import { Route } from "@angular/router"; import { HomeComponent } from "./components/home/home.component"; -export const appRoutes: Route[] = [{ path: "", component: HomeComponent }]; +export const appRoutes: Route[] = [ + { + path: "", + component: HomeComponent, + }, +]; diff --git a/apps/NwaifuAnime/src/app/components/header/header.component.html b/apps/NwaifuAnime/src/app/components/header/header.component.html index 5af9d50..b81e4c6 100644 --- a/apps/NwaifuAnime/src/app/components/header/header.component.html +++ b/apps/NwaifuAnime/src/app/components/header/header.component.html @@ -1,17 +1,23 @@
-

NwaifuAnime

- diff --git a/apps/NwaifuAnime/src/app/components/header/header.component.less b/apps/NwaifuAnime/src/app/components/header/header.component.less index e69de29..ba4612c 100644 --- a/apps/NwaifuAnime/src/app/components/header/header.component.less +++ b/apps/NwaifuAnime/src/app/components/header/header.component.less @@ -0,0 +1,3 @@ +.header { + transition: height 0.3s; +} diff --git a/apps/NwaifuAnime/src/app/components/header/header.component.ts b/apps/NwaifuAnime/src/app/components/header/header.component.ts index 28a9125..feb5ad5 100644 --- a/apps/NwaifuAnime/src/app/components/header/header.component.ts +++ b/apps/NwaifuAnime/src/app/components/header/header.component.ts @@ -1,9 +1,33 @@ -import { Component } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Component, ElementRef, EventEmitter, Output, ViewChild } from "@angular/core"; @Component({ selector: "app-header", templateUrl: "./header.component.html", styleUrls: ["./header.component.less"], standalone: true, + imports: [CommonModule], }) -export class HeaderComponent {} +export class HeaderComponent { + @Output() searchEvent: EventEmitter = new EventEmitter(); + @ViewChild("searchInput") searchInput: ElementRef | null = null; + menuOpened = false; + changeMenu() { + this.menuOpened = !this.menuOpened; + } + + get menuBtnClass(): string { + return `lni ${this.menuOpened ? "lni-close" : "lni-menu"} text-white`; + } + + get searchBarClass(): string { + return `search-bar bg-slate-300 md:w-[50%] w-full md:m-0 ms-2 me-2 max-h-6 md:flex justify-start flex-row items-center rounded-md ${this.menuOpened ? "flex" : "hidden"}`; + } + + search() { + if (this.searchInput) { + const text = this.searchInput.nativeElement.value; + this.searchEvent.emit(text); + } + } +} diff --git a/bun.lockb b/bun.lockb index b4c4712..8fc81be 100755 Binary files a/bun.lockb and b/bun.lockb differ