diff --git a/pipboyUI/src/app/app-routing.module.ts b/pipboyUI/src/app/app-routing.module.ts
index 0297262..dc5e9bc 100644
--- a/pipboyUI/src/app/app-routing.module.ts
+++ b/pipboyUI/src/app/app-routing.module.ts
@@ -1,7 +1,57 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
+import {AppComponent} from "./app.component";
+import {UpperHeader} from "./components/upper-header.component";
+import {StatsHeaderComponent} from "./components/UpperHeaders/stats-header.component";
+import {InvHeaderComponent} from "./components/UpperHeaders/inv-header.component";
+import {DataHeaderComponent} from "./components/UpperHeaders/data-header.component";
+import {MapHeaderComponent} from "./components/UpperHeaders/map-header.component";
+import {RadioHeaderComponent} from "./components/UpperHeaders/radio-header.component";
+import {StatusLowerHeaderComponent} from "./components/LowerHeaders/Stats/status-lower-header.component";
+import {InventoryAppsComponent} from "./components/LowerHeaders/Inventory/inventory-apps.component";
+import {InventoryCustomComponent} from "./components/LowerHeaders/Inventory/inventory-custom.component";
-const routes: Routes = [];
+const routes: Routes = [
+ {
+ path: '',
+ component:UpperHeader,
+ children: [
+ {
+ path: '', redirectTo: 'stats',
+ pathMatch: 'full'
+ },
+ {
+ path: 'stats',
+ component: StatsHeaderComponent,
+ children: [
+ {path: '', redirectTo: 'status', pathMatch: 'full'},
+ {path: "status", component: StatusLowerHeaderComponent}
+ ]
+ },
+ {
+ path: 'inventory',
+ component: InvHeaderComponent,
+ children: [
+ {path: '', redirectTo: 'apps', pathMatch: 'full'},
+ {path: "apps", component: InventoryAppsComponent},
+ {path: "custom", component: InventoryCustomComponent}
+ ]
+ },
+ {
+ path: 'data',
+ component: DataHeaderComponent
+ },
+ {
+ path: 'map',
+ component: MapHeaderComponent
+ },
+ {
+ path: 'radio',
+ component: RadioHeaderComponent
+ }
+ ]
+ }
+];
@NgModule({
imports: [RouterModule.forRoot(routes)],
diff --git a/pipboyUI/src/app/app.component.html b/pipboyUI/src/app/app.component.html
index 2a0fbf1..0680b43 100644
--- a/pipboyUI/src/app/app.component.html
+++ b/pipboyUI/src/app/app.component.html
@@ -1,484 +1 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ title }} app is running!
-
-
-
-
-
-
-
Resources
-
Here are some links to help you get started:
-
-
-
-
-
Next Steps
-
What do you want to do next with your app?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ng generate component xyz
-
ng add @angular/material
-
ng add @angular/pwa
-
ng add _____
-
ng test
-
ng build
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pipboyUI/src/app/app.component.spec.ts b/pipboyUI/src/app/app.component.spec.ts
deleted file mode 100644
index 362ff1d..0000000
--- a/pipboyUI/src/app/app.component.spec.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { AppComponent } from './app.component';
-
-describe('AppComponent', () => {
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [
- RouterTestingModule
- ],
- declarations: [
- AppComponent
- ],
- }).compileComponents();
- });
-
- it('should create the app', () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.componentInstance;
- expect(app).toBeTruthy();
- });
-
- it(`should have as title 'pipboyUI'`, () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.componentInstance;
- expect(app.title).toEqual('pipboyUI');
- });
-
- it('should render title', () => {
- const fixture = TestBed.createComponent(AppComponent);
- fixture.detectChanges();
- const compiled = fixture.nativeElement as HTMLElement;
- expect(compiled.querySelector('.content span')?.textContent).toContain('pipboyUI app is running!');
- });
-});
diff --git a/pipboyUI/src/app/app.component.ts b/pipboyUI/src/app/app.component.ts
index 3529437..9a8db0f 100644
--- a/pipboyUI/src/app/app.component.ts
+++ b/pipboyUI/src/app/app.component.ts
@@ -6,5 +6,4 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.scss']
})
export class AppComponent {
- title = 'pipboyUI';
}
diff --git a/pipboyUI/src/app/app.module.ts b/pipboyUI/src/app/app.module.ts
index 5c20967..599ecc6 100644
--- a/pipboyUI/src/app/app.module.ts
+++ b/pipboyUI/src/app/app.module.ts
@@ -4,15 +4,42 @@ import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import {UpperHeader} from "./components/upper-header.component";
+import {StatsHeaderComponent} from "./components/UpperHeaders/stats-header.component";
+import {InvHeaderComponent} from "./components/UpperHeaders/inv-header.component";
+import {DataHeaderComponent} from "./components/UpperHeaders/data-header.component";
+import {MapHeaderComponent} from "./components/UpperHeaders/map-header.component";
+import {RadioHeaderComponent} from "./components/UpperHeaders/radio-header.component";
+import {StatusLowerHeaderComponent} from "./components/LowerHeaders/Stats/status-lower-header.component";
+import {ClockDialogApp} from "./components/apps/clock-dialog-app.component";
+import {MatDialogModule} from "@angular/material/dialog";
+import {MatInputModule} from "@angular/material/input";
+import {FormsModule} from "@angular/forms";
+import {MatButtonModule} from "@angular/material/button";
+import {InventoryAppsComponent} from "./components/LowerHeaders/Inventory/inventory-apps.component";
@NgModule({
declarations: [
- AppComponent
+ AppComponent,
+ UpperHeader,
+ StatsHeaderComponent,
+ InvHeaderComponent,
+ DataHeaderComponent,
+ MapHeaderComponent,
+ RadioHeaderComponent,
+ //
+ StatusLowerHeaderComponent,
+ InventoryAppsComponent,
+ ClockDialogApp
],
imports: [
BrowserModule,
AppRoutingModule,
- BrowserAnimationsModule
+ BrowserAnimationsModule,
+ MatDialogModule,
+ MatInputModule,
+ FormsModule,
+ MatButtonModule
],
providers: [],
bootstrap: [AppComponent]
diff --git a/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts
new file mode 100644
index 0000000..058c202
--- /dev/null
+++ b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts
@@ -0,0 +1,66 @@
+import {Component, HostListener} from "@angular/core";
+import {MatDialog, MatDialogRef} from "@angular/material/dialog";
+import {ClockDialogApp} from "../../apps/clock-dialog-app.component";
+
+@Component({
+ selector: "app-inventory-apps-component",
+ template: `
+
+ `
+})
+export class InventoryAppsComponent {
+ constructor(protected dialog: MatDialog) {
+ }
+ elements: {name: string, action: Function}[] = [
+ {name: "Clock", action: () => {
+ if (this.openedApp == undefined) {
+ this.openedApp = this.dialog.open(ClockDialogApp, {width: '100%', height: '100%', disableClose: true})
+ this.openedApp.afterClosed().subscribe(() => this.openedApp = undefined)
+ }
+ }},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}},
+ {name: "1", action: () => {}}
+ ]
+ selected: {name: string, action: Function} = this.elements[0];
+ openedApp: MatDialogRef | undefined;
+
+ @HostListener('document:keypress', ['$event'])
+ choiceItem(event: KeyboardEvent) {
+ if (this.openedApp != undefined)
+ return;
+
+ let currentIdx = this.elements.indexOf(this.selected);
+ switch (event.code) {
+ case 'KeyS': {
+ if (currentIdx + 1 >= this.elements.length) currentIdx = -1;
+ this.selected = this.elements[currentIdx + 1];
+ break;
+ }
+ case 'KeyW': {
+ if (currentIdx - 1 < 0) currentIdx = this.elements.length;
+ this.selected = this.elements[currentIdx - 1];
+ break;
+ }
+ case 'Enter': {
+ this.selected.action()
+ }
+ }
+ }
+}
diff --git a/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-custom.component.ts b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-custom.component.ts
new file mode 100644
index 0000000..567dc21
--- /dev/null
+++ b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-custom.component.ts
@@ -0,0 +1,9 @@
+import {Component} from "@angular/core";
+
+@Component({
+ selector: "app-inventory-custom",
+ template: ``
+})
+export class InventoryCustomComponent {
+
+}
diff --git a/pipboyUI/src/app/components/LowerHeaders/Stats/status-lower-header.component.ts b/pipboyUI/src/app/components/LowerHeaders/Stats/status-lower-header.component.ts
new file mode 100644
index 0000000..27005ce
--- /dev/null
+++ b/pipboyUI/src/app/components/LowerHeaders/Stats/status-lower-header.component.ts
@@ -0,0 +1,10 @@
+import {Component} from "@angular/core";
+
+@Component({
+ selector: 'app-status-lower-header',
+ template: `
+ status
`
+})
+export class StatusLowerHeaderComponent {
+
+}
diff --git a/pipboyUI/src/app/components/UpperHeaders/data-header.component.ts b/pipboyUI/src/app/components/UpperHeaders/data-header.component.ts
new file mode 100644
index 0000000..97f79aa
--- /dev/null
+++ b/pipboyUI/src/app/components/UpperHeaders/data-header.component.ts
@@ -0,0 +1,10 @@
+import {Component} from "@angular/core";
+
+@Component({
+ selector: "app-data-header",
+ template: `
+ `
+})
+export class DataHeaderComponent {
+
+}
diff --git a/pipboyUI/src/app/components/UpperHeaders/inv-header.component.ts b/pipboyUI/src/app/components/UpperHeaders/inv-header.component.ts
new file mode 100644
index 0000000..2604333
--- /dev/null
+++ b/pipboyUI/src/app/components/UpperHeaders/inv-header.component.ts
@@ -0,0 +1,52 @@
+import {Component, HostListener} from "@angular/core";
+import {AbsNavsHeaderComponent, UpHeader} from "../abs-navs-header.component";
+import {ActivatedRoute, Router} from "@angular/router";
+import {InventoryAppsComponent} from "../LowerHeaders/Inventory/inventory-apps.component";
+import {InventoryCustomComponent} from "../LowerHeaders/Inventory/inventory-custom.component";
+
+@Component({
+ selector: 'app-inv-header',
+ template: `
+
+
+
+
+
+ `
+})
+export class InvHeaderComponent extends AbsNavsHeaderComponent {
+ path = "inventory";
+ constructor(route: ActivatedRoute, router: Router) {
+ super(route, router);
+ super.navs = [
+ {name: "apps", path: "apps", action: () => {}, component: InventoryAppsComponent.name},
+ {name: "custom", path: "custom", action: () => {}, component: InventoryCustomComponent.name}
+ ]
+ }
+
+
+ override selectHeader(header: UpHeader) {
+ super.selectHeader(header, [this.path]);
+ }
+
+ @HostListener('document:keypress', ['$event'])
+ override choiceHeader(event: KeyboardEvent) {
+ super.choiceHeader(event);
+ }
+}
diff --git a/pipboyUI/src/app/components/UpperHeaders/map-header.component.ts b/pipboyUI/src/app/components/UpperHeaders/map-header.component.ts
new file mode 100644
index 0000000..7366e60
--- /dev/null
+++ b/pipboyUI/src/app/components/UpperHeaders/map-header.component.ts
@@ -0,0 +1,9 @@
+import {Component} from "@angular/core";
+
+@Component({
+ selector: "app-map-header",
+ template: ``
+})
+export class MapHeaderComponent {
+
+}
diff --git a/pipboyUI/src/app/components/UpperHeaders/radio-header.component.ts b/pipboyUI/src/app/components/UpperHeaders/radio-header.component.ts
new file mode 100644
index 0000000..81ac79a
--- /dev/null
+++ b/pipboyUI/src/app/components/UpperHeaders/radio-header.component.ts
@@ -0,0 +1,9 @@
+import {Component} from "@angular/core";
+
+@Component({
+ selector: "app-radio-header",
+ template: ""
+})
+export class RadioHeaderComponent {
+
+}
diff --git a/pipboyUI/src/app/components/UpperHeaders/stats-header.component.ts b/pipboyUI/src/app/components/UpperHeaders/stats-header.component.ts
new file mode 100644
index 0000000..3c586cd
--- /dev/null
+++ b/pipboyUI/src/app/components/UpperHeaders/stats-header.component.ts
@@ -0,0 +1,40 @@
+import {Component} from "@angular/core";
+import {AbsNavsHeaderComponent} from "../abs-navs-header.component";
+import {ActivatedRoute, Router} from "@angular/router";
+import {StatusLowerHeaderComponent} from "../LowerHeaders/Stats/status-lower-header.component";
+
+@Component({
+ selector: 'app-stats-header',
+ template: `
+
+
+
+ `
+})
+export class StatsHeaderComponent extends AbsNavsHeaderComponent {
+
+ constructor(route: ActivatedRoute, router: Router) {
+ super(route, router);
+ super.navs = [
+ {name: "status", path: "status", action: () => {}, component: StatusLowerHeaderComponent.name},
+ {name: "2", path: "2", action: () => {}, component: ""},
+ {name: "3", path: "3", action: () => {}, component: ""},
+ ]
+ }
+}
diff --git a/pipboyUI/src/app/components/abs-navs-header.component.ts b/pipboyUI/src/app/components/abs-navs-header.component.ts
new file mode 100644
index 0000000..d60459f
--- /dev/null
+++ b/pipboyUI/src/app/components/abs-navs-header.component.ts
@@ -0,0 +1,56 @@
+import {Component, HostListener} from "@angular/core";
+import {ActivatedRoute, Router} from "@angular/router";
+
+export interface UpHeader {
+ name: string,
+ path: string,
+ action: Function,
+ component: string
+}
+
+@Component({
+ selector: "abs-navs-header",
+ template: ``
+})
+export abstract class AbsNavsHeaderComponent {
+ navs: UpHeader[] = [];
+ currentNav: UpHeader|undefined;
+
+ constructor(protected route: ActivatedRoute,
+ protected router: Router) {
+ }
+
+
+ isActiveHeader(header: UpHeader) {
+ const res = this.route.firstChild?.component?.name == header.component;
+ if (res)
+ this.currentNav = header;
+ return res;
+ }
+
+ selectHeader(header: UpHeader, parent: string[] = []) {
+ parent.push(header.path)
+ this.router.navigate(parent)
+ }
+
+ choiceHeader(event: KeyboardEvent) {
+ if (this.currentNav != undefined) {
+ const curIdx = this.navs.indexOf(this.currentNav)
+ console.log(curIdx, event)
+ switch (event.code) {
+ case "KeyA": {
+ if (curIdx -1 < 0) {
+ this.selectHeader(this.navs[this.navs.length-1])
+ } else this.selectHeader(this.navs[curIdx -1])
+ break;
+ }
+ case "KeyD": {
+ if (curIdx + 1 >= this.navs.length)
+ this.selectHeader(this.navs[0])
+ else this.selectHeader(this.navs[curIdx+1])
+ break;
+ }
+ }
+ }
+ }
+}
diff --git a/pipboyUI/src/app/components/apps/AbsApp.ts b/pipboyUI/src/app/components/apps/AbsApp.ts
new file mode 100644
index 0000000..f443c00
--- /dev/null
+++ b/pipboyUI/src/app/components/apps/AbsApp.ts
@@ -0,0 +1,12 @@
+import {Component, Inject} from "@angular/core";
+import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
+
+@Component({
+ selector: "app-abs-app",
+ template: ""
+})
+export abstract class AbsApp {
+ constructor(@Inject(MAT_DIALOG_DATA) public data: any,
+ protected ref: MatDialogRef) {
+ }
+}
diff --git a/pipboyUI/src/app/components/apps/clock-dialog-app.component.ts b/pipboyUI/src/app/components/apps/clock-dialog-app.component.ts
new file mode 100644
index 0000000..a2bb8b8
--- /dev/null
+++ b/pipboyUI/src/app/components/apps/clock-dialog-app.component.ts
@@ -0,0 +1,32 @@
+import {Component, HostListener, OnInit} from "@angular/core";
+import {AbsApp} from "./AbsApp";
+
+@Component({
+ selector: 'app-clock-app',
+ template: `
+
+ `
+})
+export class ClockDialogApp extends AbsApp implements OnInit {
+ clockTxt = "";
+ inverval:any = null;
+
+ ngOnInit(): void {
+ this.genClock();
+ if (this.inverval == null)
+ this.inverval = setInterval(() => {this.genClock()},1000)
+ }
+
+ genClock() {
+ this.clockTxt = new Date().toLocaleTimeString();
+ }
+
+ @HostListener('document:keydown.escape', ['$event'])
+ onEscapeKeydown(event: KeyboardEvent) {
+ this.ref.close()
+ }
+}
diff --git a/pipboyUI/src/app/components/upper-header.component.ts b/pipboyUI/src/app/components/upper-header.component.ts
new file mode 100644
index 0000000..ba53171
--- /dev/null
+++ b/pipboyUI/src/app/components/upper-header.component.ts
@@ -0,0 +1,44 @@
+import {Component, HostListener} from "@angular/core";
+import {ActivatedRoute, Router} from "@angular/router";
+import {StatsHeaderComponent} from "./UpperHeaders/stats-header.component";
+import {InvHeaderComponent} from "./UpperHeaders/inv-header.component";
+import {DataHeaderComponent} from "./UpperHeaders/data-header.component";
+import {MapHeaderComponent} from "./UpperHeaders/map-header.component";
+import {RadioHeaderComponent} from "./UpperHeaders/radio-header.component";
+import {AbsNavsHeaderComponent} from "./abs-navs-header.component";
+
+@Component({
+ selector: "ui",
+ template: `
+
+
+ `
+})
+export class UpperHeader extends AbsNavsHeaderComponent {
+
+ constructor(route: ActivatedRoute,
+ router: Router) {
+ super(route, router);
+ super.navs = [
+ {name: "stat", path: "stats", action: () => {}, component: StatsHeaderComponent.name},
+ {name: "inv", path: "inventory", action: () => {}, component: InvHeaderComponent.name},
+ {name: "data", path: "data", action: () => {}, component: DataHeaderComponent.name},
+ {name: "map", path: "map", action: () => {}, component: MapHeaderComponent.name},
+ {name: "radio", path: "radio", action: () => {}, component: RadioHeaderComponent.name}];
+ }
+
+ @HostListener('document:keypress', ['$event'])
+ choiceUpperHeader(event: KeyboardEvent) {
+ if (this.currentNav != undefined) {
+ if (event.code.startsWith("Digit") && event.code.length == 6) {
+ let sel = Number.parseInt(event.code.replace("Digit", "")) - 1
+ if (this.navs[sel])
+ this.selectHeader(this.navs[sel])
+ }
+ }
+ }
+}
diff --git a/pipboyUI/src/assets/fonts/Roboto-Bold.ttf b/pipboyUI/src/assets/fonts/Roboto-Bold.ttf
new file mode 100644
index 0000000..91ec212
Binary files /dev/null and b/pipboyUI/src/assets/fonts/Roboto-Bold.ttf differ
diff --git a/pipboyUI/src/assets/fonts/Roboto-Regular.ttf b/pipboyUI/src/assets/fonts/Roboto-Regular.ttf
new file mode 100644
index 0000000..7d9a6c4
Binary files /dev/null and b/pipboyUI/src/assets/fonts/Roboto-Regular.ttf differ
diff --git a/pipboyUI/src/assets/fonts/RobotoCondensed-Bold.ttf b/pipboyUI/src/assets/fonts/RobotoCondensed-Bold.ttf
new file mode 100644
index 0000000..7fe3128
Binary files /dev/null and b/pipboyUI/src/assets/fonts/RobotoCondensed-Bold.ttf differ
diff --git a/pipboyUI/src/assets/fonts/RobotoCondensed-Regular.ttf b/pipboyUI/src/assets/fonts/RobotoCondensed-Regular.ttf
new file mode 100644
index 0000000..62dd61e
Binary files /dev/null and b/pipboyUI/src/assets/fonts/RobotoCondensed-Regular.ttf differ
diff --git a/pipboyUI/src/assets/fonts/TechMono.ttf b/pipboyUI/src/assets/fonts/TechMono.ttf
new file mode 100644
index 0000000..f0be2db
Binary files /dev/null and b/pipboyUI/src/assets/fonts/TechMono.ttf differ
diff --git a/pipboyUI/src/assets/fonts/monofonto.ttf b/pipboyUI/src/assets/fonts/monofonto.ttf
new file mode 100644
index 0000000..9d65196
Binary files /dev/null and b/pipboyUI/src/assets/fonts/monofonto.ttf differ
diff --git a/pipboyUI/src/styles.scss b/pipboyUI/src/styles.scss
index 7e7239a..4907ea7 100644
--- a/pipboyUI/src/styles.scss
+++ b/pipboyUI/src/styles.scss
@@ -1,4 +1,68 @@
/* You can add global styles to this file, and also import other style files */
-html, body { height: 100%; }
-body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
+@font-face {
+ font-family: 'RobotoTodd';
+ src: url("assets/fonts/Roboto-Regular.ttf");
+ font-weight: normal;
+ font-style: normal;
+}
+
+@font-face {
+ font-family: 'RobotoTodd';
+ src: url("assets/fonts/Roboto-Bold.ttf");
+ font-weight: bold;
+ font-style: normal;
+}
+
+@font-face {
+ font-family: 'TechMono';
+ src: url("assets/fonts/TechMono.ttf");
+ font-weight: normal;
+ font-style: normal;
+}
+
+$primary-color: rgb(0, 242, 0);
+$secondary-color: rgb(0 242 0 / 30%);
+
+html, body { height: 100%; background-color: black }
+body {
+ margin: 0;
+ font-family: RobotoTodd, "Helvetica Neue", sans-serif;
+ color: rgb(0, 0.949*255, 0)
+}
+
+.activeHeader {
+ border-left: 2px solid $primary-color;
+ border-right: 2px solid $primary-color;
+}
+
+.inactiveHeader {
+ color: $secondary-color;
+}
+
+.footer {
+ #background-color: $secondary-color;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ height: 6.5%;
+}
+
+.footer-text {
+ background-color: $secondary-color;
+}
+
+.menu-selected {
+ background-color: $primary-color;
+ color: black;
+}
+
+.mat-dialog-container {
+ background: black;
+ color: $primary-color;
+}
+
+.cdk-overlay-pane {
+ max-width: 100% !important;
+}