Added info modal window

This commit is contained in:
2024-03-09 18:16:20 +03:00
parent f9a7b812fe
commit 8cd5dd1f8e
13 changed files with 128 additions and 5 deletions

View File

@@ -2,5 +2,6 @@
<app-panel></app-panel>
</header>
<main class="main">
<app-modal></app-modal>
<app-dock></app-dock>
</main>

View File

@@ -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%;
}

View File

@@ -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",
})

View File

@@ -0,0 +1 @@
<div class="modal-window" #modal></div>

View 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",
});
}
}

View File

@@ -1,4 +1,5 @@
.panel {
z-index: 99999;
position: relative;
left: 0;
top: 0;

View 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>

View 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;
}

View 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) {}
}