Compare commits
3 Commits
95a4e5dd08
...
feature/he
| Author | SHA1 | Date | |
|---|---|---|---|
| 16d631423c | |||
| c8168580d6 | |||
| f3a3344004 |
BIN
apps/NwaifuAnime/public/pic/Blank-profile.png
Normal file
BIN
apps/NwaifuAnime/public/pic/Blank-profile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -7,8 +7,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<div class="h-10"></div>
|
<div class="h-12"></div>
|
||||||
<main>
|
<div class="content">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</main>
|
<app-footer></app-footer>
|
||||||
|
</div>
|
||||||
<app-notification></app-notification>
|
<app-notification></app-notification>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
main {
|
.content {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: calc(100vh - 3rem);
|
height: calc(100vh - 3rem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { RouterModule } from "@angular/router";
|
import { RouterModule } from "@angular/router";
|
||||||
import { AppService } from "./app.service";
|
import { AppService } from "./app.service";
|
||||||
|
import { FooterComponent } from "./components/footer/footer.component";
|
||||||
import { HeaderComponent } from "./components/header/header.component";
|
import { HeaderComponent } from "./components/header/header.component";
|
||||||
import { NotificationComponent } from "./components/notification/notification.component";
|
import { NotificationComponent } from "./components/notification/notification.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterModule, HeaderComponent, NotificationComponent, NotificationComponent],
|
imports: [
|
||||||
|
RouterModule,
|
||||||
|
HeaderComponent,
|
||||||
|
NotificationComponent,
|
||||||
|
NotificationComponent,
|
||||||
|
FooterComponent,
|
||||||
|
],
|
||||||
selector: "app-root",
|
selector: "app-root",
|
||||||
templateUrl: "./app.component.html",
|
templateUrl: "./app.component.html",
|
||||||
styleUrl: "./app.component.less",
|
styleUrl: "./app.component.less",
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<div class="footer w-full border-t border-black bg-gray-300 pt-3">
|
||||||
|
<p class="text-3xl ps-[5rem]">DMCA Disclaimer</p>
|
||||||
|
<div class="footer-content h-full px-[5rem] py-6 flex flex-col gap-3">
|
||||||
|
<div class="block">
|
||||||
|
<p>На русском:</p>
|
||||||
|
<p>
|
||||||
|
Разработчики этого приложения не имеют никакого отношения к контенту, доступному в
|
||||||
|
приложении. Оно собрано из источников, свободно доступных через любой веб-браузер.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="block">
|
||||||
|
<p>English:</p>
|
||||||
|
<p>
|
||||||
|
The developers of this application does not have any affiliation with the content available
|
||||||
|
in the app. It is collecting from the sources freely available through any web browser.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "app-footer",
|
||||||
|
templateUrl: "./footer.component.html",
|
||||||
|
styleUrls: ["./footer.component.less"],
|
||||||
|
standalone: true,
|
||||||
|
})
|
||||||
|
export class FooterComponent {}
|
||||||
@@ -1,64 +1,6 @@
|
|||||||
<div
|
<div
|
||||||
[class]="
|
class="header fixed flex flex-row items-center px-2 justify-between top-0 left-0 h-12 bg-gray-700 w-full"
|
||||||
'header fixed flex justify-between w-full px-2 bg-gray-700 md:h-8 items-center md:flex-row flex-col md:gap-0 gap-3 text-xl md:text-base ' +
|
|
||||||
(menuOpened ? 'h-screen' : '')
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<div class="flex justify-between flex-row w-full align-middle h-8 items-center">
|
<a routerLink="/" title="Main page"><p class="text-xl text-white">NwaifuAnime</p></a>
|
||||||
<div class="flex flex-row gap-3 h-full items-center">
|
<app-search-field></app-search-field>
|
||||||
<a routerLink="/" class="h-full px-2 flex justify-center items-center justify-self-center"
|
|
||||||
><h1 class="text-white" title="Main page">NwaifuAnime</h1></a
|
|
||||||
>
|
|
||||||
<div class="border-l border-white h-full"></div>
|
|
||||||
<div class="flex-row gap-3 md:flex hidden h-full items-center">
|
|
||||||
<a
|
|
||||||
routerLink="/auth"
|
|
||||||
class="h-full px-2 flex justify-center items-center hover:bg-gray-600 transition ease-in-out delay-150 duration-300"
|
|
||||||
><h2 class="text-white" title="Auth page">Auth</h2></a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Search bar on small screens -->
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="md:hidden flex justify-center items-center px-2"
|
|
||||||
(click)="changeMenu()"
|
|
||||||
>
|
|
||||||
<i [class]="menuBtnClass"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="flex flex-col md:flex-row md:justify-end justify-center items-center gap-3 md:w-[50vw] h-full w-full"
|
|
||||||
>
|
|
||||||
<!-- Search bar on big screens -->
|
|
||||||
<div [class]="searchBarClass">
|
|
||||||
<input
|
|
||||||
type="search"
|
|
||||||
#searchInput
|
|
||||||
class="outline-none ps-1 text-sm leading-6 w-full border-0 bg-transparent border-r border-gray-700"
|
|
||||||
(keydown.enter)="search()"
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
class="align-middle w-[100px] text-center border-0 flex flex-col items-center justify-center"
|
|
||||||
type="submit"
|
|
||||||
(click)="search()"
|
|
||||||
>
|
|
||||||
<span class="text-sm text-black h-full">Поиск</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
[class]="
|
|
||||||
'flex flex-col w-full justify-start items-center md:hidden overflow-hidden ' +
|
|
||||||
(menuOpened ? 'h-auto' : 'h-0')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
routerLink="/auth"
|
|
||||||
class="h-full px-2 flex justify-center items-center hover:bg-gray-600 transition ease-in-out delay-150 duration-300"
|
|
||||||
><h2 class="text-white" title="Auth page">Auth</h2></a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule } from "@angular/common";
|
||||||
import { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from "@angular/core";
|
import { Component, OnDestroy } from "@angular/core";
|
||||||
import { ActivatedRoute, NavigationEnd, Router, RouterLink } from "@angular/router";
|
import { ActivatedRoute, NavigationEnd, Router, RouterLink } from "@angular/router";
|
||||||
import { Subject, filter, takeUntil } from "rxjs";
|
import { Subject, filter, takeUntil } from "rxjs";
|
||||||
|
import { SearchFieldComponent } from "../search-field/search-field.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-header",
|
selector: "app-header",
|
||||||
templateUrl: "./header.component.html",
|
templateUrl: "./header.component.html",
|
||||||
styleUrls: ["./header.component.less"],
|
styleUrls: ["./header.component.less"],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, RouterLink],
|
imports: [CommonModule, RouterLink, SearchFieldComponent],
|
||||||
})
|
})
|
||||||
export class HeaderComponent implements AfterViewInit, OnDestroy {
|
export class HeaderComponent implements OnDestroy {
|
||||||
@ViewChild("searchInput") searchInput: ElementRef<HTMLInputElement> | null = null;
|
|
||||||
menuOpened = false;
|
menuOpened = false;
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
constructor(
|
constructor(
|
||||||
@@ -27,13 +27,10 @@ export class HeaderComponent implements AfterViewInit, OnDestroy {
|
|||||||
.subscribe((val: any) => {
|
.subscribe((val: any) => {
|
||||||
if (val.url.startsWith("/detail") || val.url.startsWith("/reader")) {
|
if (val.url.startsWith("/detail") || val.url.startsWith("/reader")) {
|
||||||
this.menuOpened = false;
|
this.menuOpened = false;
|
||||||
} else if (val.url === "/") {
|
|
||||||
if (this.searchInput) {
|
|
||||||
this.searchInput.nativeElement.value = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeMenu() {
|
changeMenu() {
|
||||||
this.menuOpened = !this.menuOpened;
|
this.menuOpened = !this.menuOpened;
|
||||||
}
|
}
|
||||||
@@ -46,22 +43,6 @@ export class HeaderComponent implements AfterViewInit, OnDestroy {
|
|||||||
return `search-bar bg-slate-300 md:w-full w-full md:m-0 ms-2 me-2 md:h-6 h-10 md:flex justify-start flex-row items-center rounded-md ${this.menuOpened ? "flex" : "hidden"}`;
|
return `search-bar bg-slate-300 md:w-full w-full md:m-0 ms-2 me-2 md:h-6 h-10 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.router.navigateByUrl(`/?search=${text}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
|
||||||
this.route.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
|
|
||||||
const search = params["search"];
|
|
||||||
if (search && this.searchInput) {
|
|
||||||
this.searchInput.nativeElement.value = search;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.destroy$.next();
|
this.destroy$.next();
|
||||||
this.destroy$.complete();
|
this.destroy$.complete();
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="flex flex-row gap-3 justify-between items-center">
|
||||||
|
<div class="input-block max-h-0"></div>
|
||||||
|
<div class="input-btn rounded-full w-8 h-8 bg-slate-400 flex justify-center items-center">
|
||||||
|
<i class="lni lni-search-alt"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { CommonModule } from "@angular/common";
|
||||||
|
import { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from "@angular/core";
|
||||||
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
|
import { Subject, takeUntil } from "rxjs";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "app-search-field",
|
||||||
|
standalone: true,
|
||||||
|
imports: [CommonModule],
|
||||||
|
templateUrl: "./search-field.component.html",
|
||||||
|
styleUrl: "./search-field.component.less",
|
||||||
|
})
|
||||||
|
export class SearchFieldComponent implements AfterViewInit, OnDestroy {
|
||||||
|
@ViewChild("searchInput") searchInput: ElementRef<HTMLInputElement> | null = null;
|
||||||
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
ngAfterViewInit(): void {
|
||||||
|
this.route.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
|
||||||
|
const search = params["search"];
|
||||||
|
if (search && this.searchInput) {
|
||||||
|
this.searchInput.nativeElement.value = search;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
search() {
|
||||||
|
if (this.searchInput && this.searchInput.nativeElement.value)
|
||||||
|
this.router.navigate(["/", "search"], {
|
||||||
|
queryParams: { search: this.searchInput.nativeElement.value },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.destroy$.next();
|
||||||
|
this.destroy$.complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user