Added info modal window
This commit is contained in:
@@ -2,5 +2,6 @@
|
||||
<app-panel></app-panel>
|
||||
</header>
|
||||
<main class="main">
|
||||
<app-modal></app-modal>
|
||||
<app-dock></app-dock>
|
||||
</main>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: calc(100% - 2rem);
|
||||
background: url("../assets/img/wallpaper.png");
|
||||
background-size: cover;
|
||||
background-image: url("../assets/img/wallpaper.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { RouterOutlet } from "@angular/router";
|
||||
import { DockComponent } from "./modules/dock/dock.component";
|
||||
import { ModalComponent } from "./modules/modal/modal.component";
|
||||
import { PanelComponent } from "./modules/panel/panel.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-root",
|
||||
standalone: true,
|
||||
imports: [RouterOutlet, PanelComponent, DockComponent],
|
||||
imports: [RouterOutlet, PanelComponent, DockComponent, ModalComponent],
|
||||
templateUrl: "./app.component.html",
|
||||
styleUrl: "./app.component.less",
|
||||
})
|
||||
|
||||
1
src/app/modules/modal/modal.component.html
Normal file
1
src/app/modules/modal/modal.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<div class="modal-window" #modal></div>
|
||||
0
src/app/modules/modal/modal.component.less
Normal file
0
src/app/modules/modal/modal.component.less
Normal file
29
src/app/modules/modal/modal.component.ts
Normal file
29
src/app/modules/modal/modal.component.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { AfterViewInit, Component, ElementRef, ViewChild } from "@angular/core";
|
||||
import { DialogRef, DialogService } from "@ngneat/dialog";
|
||||
import { WindowComponent } from "../window/window.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-modal",
|
||||
templateUrl: "./modal.component.html",
|
||||
styleUrls: ["./modal.component.less"],
|
||||
imports: [CommonModule],
|
||||
standalone: true,
|
||||
})
|
||||
export class ModalComponent implements AfterViewInit {
|
||||
dialogRef: DialogRef | undefined = undefined;
|
||||
@ViewChild("modal") modal: ElementRef | undefined = undefined;
|
||||
constructor(private dialogService: DialogService, private ref: ElementRef) {}
|
||||
ngAfterViewInit(): void {
|
||||
this.dialogRef = this.dialogService.open(WindowComponent, {
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
backdrop: false,
|
||||
closeButton: false,
|
||||
container: this.modal ?? this.ref,
|
||||
enableClose: false,
|
||||
dragConstraint: "constrain",
|
||||
id: "info-modal",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
.panel {
|
||||
z-index: 99999;
|
||||
position: relative;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
10
src/app/modules/window/window.component.html
Normal file
10
src/app/modules/window/window.component.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="panel">
|
||||
<span>Info</span>
|
||||
<div class="btns">
|
||||
<fa-icon [icon]="faMenu"></fa-icon>
|
||||
<fa-icon [icon]="faClose"></fa-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1>Hello</h1>
|
||||
</div>
|
||||
24
src/app/modules/window/window.component.less
Normal file
24
src/app/modules/window/window.component.less
Normal file
@@ -0,0 +1,24 @@
|
||||
.panel {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 3rem;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 1rem;
|
||||
background-color: var(--black);
|
||||
color: var(--white);
|
||||
span {
|
||||
font-size: 600;
|
||||
}
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
margin: 1rem;
|
||||
}
|
||||
19
src/app/modules/window/window.component.ts
Normal file
19
src/app/modules/window/window.component.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
||||
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
|
||||
import { faBars, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||
import { DialogRef } from "@ngneat/dialog";
|
||||
|
||||
@Component({
|
||||
selector: "app-window",
|
||||
standalone: true,
|
||||
imports: [CommonModule, FontAwesomeModule],
|
||||
templateUrl: "./window.component.html",
|
||||
styleUrls: ["./window.component.less"],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class WindowComponent {
|
||||
faClose = faXmark;
|
||||
faMenu = faBars;
|
||||
constructor(public ref: DialogRef) {}
|
||||
}
|
||||
Reference in New Issue
Block a user