This commit is contained in:
marcusferl@weifer.de 2022-09-05 10:38:08 +02:00
parent d630852fd0
commit 2117b9c90d
8 changed files with 72 additions and 13 deletions

View File

@ -13,6 +13,8 @@ import { OutputComponent } from './output/output.component';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@NgModule({ @NgModule({
@ -31,7 +33,8 @@ import { MatButtonModule } from '@angular/material/button';
MatSelectModule, MatSelectModule,
FormsModule, FormsModule,
MatIconModule, MatIconModule,
MatButtonModule MatButtonModule,
MatSlideToggleModule
], ],
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]

View File

@ -1,3 +1,7 @@
<div class="header"> <div [ngClass]="[mode]" class="header">
<h1>Ipv4 Converter</h1> <div>
<h1>Ipv4 Converter</h1>
<mat-slide-toggle class="toggle" (toggleChange)="stylemode()">{{toggleText}} </mat-slide-toggle>
</div>
</div> </div>

View File

@ -1,10 +1,34 @@
.header { .header {
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.10); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.10);
font-size: 30px; font-size: 30px;
display: flex;
flex-direction: column;
} }
.toggle {
margin-bottom: 15px;
}
.logo { .logo {
height: 70px; height: 70px;
margin-left: 20px; margin-left: 20px;
}
.body {
margin: 0;
font-family: Roboto, "Helvetica Neue", sans-serif;
background-color: white;
}
.bodydark {
background-color: gray;
h1 {
color: white;
}
} }

View File

@ -3,14 +3,29 @@ import { Component, OnInit } from '@angular/core';
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
templateUrl: './header.component.html', templateUrl: './header.component.html',
styleUrls: ['./header.component.scss'] styleUrls: ['./header.component.scss', '../../styles.scss']
}) })
export class HeaderComponent implements OnInit { export class HeaderComponent implements OnInit {
toggle = false;
toggleText = "Daymode"
mode = 'body'
constructor() { constructor() {
}
stylemode() {
switch (this.toggle) {
case true:
this.toggle = false;
this.toggleText = "Daymode"
this.mode = "body"
break;
case false:
this.toggle = true;
this.toggleText = "Darkmode"
this.mode = 'bodydark'
}
} }
ngOnInit(): void { ngOnInit(): void {

View File

@ -1,9 +1,8 @@
<div class="input"> <div class="flexcontainer">
<mat-form-field class="input_field" appearance="fill"> <mat-form-field class="input_field" appearance="fill">
<mat-label>IPv4</mat-label> <mat-label>IPv4</mat-label>
<input matInput [(ngModel)]="ipv4_eingabe"> <input matInput [(ngModel)]="ipv4_eingabe">
</mat-form-field> </mat-form-field>
<mat-form-field class="select" appearance="fill"> <mat-form-field class="select" appearance="fill">
<mat-label>Prefix</mat-label> <mat-label>Prefix</mat-label>
<mat-select [(ngModel)]="prefix_selection"> <mat-select [(ngModel)]="prefix_selection">

View File

@ -1,12 +1,12 @@
.input_field { .input_field {
height: 58px; height: 58px;
min-width: 300px; min-width: 50px;
max-width: 1000px; max-width: 1000px;
width: auto; width: auto;
margin-top: 15px;
margin-right: 12px;
margin-left: 5px; margin-left: 5px;
margin-right: 15px;
border: 1px solid rgba(0, 0, 0, 0.30); border: 1px solid rgba(0, 0, 0, 0.30);
border-radius: 10px; border-radius: 10px;
@ -15,11 +15,20 @@
.select { .select {
min-width: 50px; min-width: 50px;
max-width: 100px; max-width: 100px;
margin-top: 20px;
margin-right: 15px;
width: auto; width: auto;
margin-top: 15px;
margin-right: 12px;
} }
.button { .button {
padding-top: 10px; padding-top: 10px;
}
.flexcontainer {
display: flex;
flex-direction: row;
align-items: center;
} }

View File

@ -1,7 +1,6 @@
.card { .card {
min-height: 40px; min-height: 40px;
max-height: 250px; max-height: 250px;
background-color: white;
min-width: 300px; min-width: 300px;
max-width: auto; max-width: auto;
width: auto; width: auto;
@ -13,6 +12,7 @@
padding-top: 0px; padding-top: 0px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 5px; margin-left: 5px;
margin-right: 5px;
} }
@ -25,4 +25,8 @@
.outlabel { .outlabel {
width: 20px; width: 20px;
margin-right: 100px; margin-right: 100px;
}
body {
background-color: black;
} }

View File

@ -38,4 +38,5 @@ body {
body { body {
margin: 0; margin: 0;
font-family: Roboto, "Helvetica Neue", sans-serif; font-family: Roboto, "Helvetica Neue", sans-serif;
} }