Skip to content

Commit

Permalink
missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroluxV2 committed Jun 29, 2020
1 parent 392e5a0 commit 5244476
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 10 deletions.
11 changes: 9 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import { MatToolbarModule } from '@angular/material/toolbar';
import { MatIconModule } from '@angular/material/icon';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatButtonModule } from '@angular/material/button';
import { SettingsComponent } from './settings/settings.component';
import { MatDialogModule } from '@angular/material/dialog';
import { MatInputModule } from '@angular/material/input';


@NgModule({
declarations: [
AppComponent,
BarComponent
BarComponent,
SettingsComponent
],
imports: [
BrowserModule,
Expand All @@ -23,7 +28,9 @@ import { MatButtonModule } from '@angular/material/button';
MatToolbarModule,
MatIconModule,
MatButtonToggleModule,
MatButtonModule
MatButtonModule,
MatDialogModule,
MatInputModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
10 changes: 7 additions & 3 deletions src/app/bar/bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

<mat-toolbar-row>
<span class="copy">&copy; Mateusz Budzisz - kropoki i kreski</span>
<mat-icon class="icon" (click)="iconClick()" [ngClass]="iconColor">gesture</mat-icon>

<button mat-mini-fab class="roundBtn darkBtn" (click)="iconClick()">
<mat-icon [ngClass]="iconColor">gesture</mat-icon>
</button>

<span class="spacer"></span>

<button mat-mini-fab class="roundBtn" color="warn" (click)="clear()">
Expand All @@ -17,7 +21,7 @@
<mat-icon>redo</mat-icon>
</button>

<mat-button-toggle-group style="margin-right: 1em;" value="black" (change)="changeColor($event)">
<mat-button-toggle-group class="colors" value="black" (change)="changeColor($event)">

<mat-button-toggle value="red" class="red">
<mat-icon>palette</mat-icon>
Expand All @@ -41,7 +45,7 @@

</mat-button-toggle-group>

<mat-button-toggle-group value="free" (change)="changeMode($event)">
<mat-button-toggle-group class="tools" value="free" (change)="changeMode($event)">

<mat-button-toggle value="free">
<mat-icon>gesture</mat-icon>
Expand Down
34 changes: 30 additions & 4 deletions src/app/bar/bar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,39 @@
.roundBtn {
height: 47px;
width: 47px;
margin-right: 0.5em;
margin-right: 1em;

&:nth-of-type(3) {
margin-right: 1em;
margin-right: 0.5em;
}
}

.copy {
display: none;
}
margin-right: 0.5em;
}

@media (max-width: 995px) {
.copy {
display: none;
}
}

.colors {
margin-right: 1em;
}

@media (max-width: 680px) {
.colors {
width: 48px;
overflow-x: scroll;
margin-right: calc(0.5em - 1px);
}
}


@media (max-width: 680px) {
.tools {
width: 48px;
overflow-x: scroll;
}
}
18 changes: 17 additions & 1 deletion src/app/bar/bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { SettingsComponent } from './../settings/settings.component';
import { Component, Output, EventEmitter, Input, OnDestroy, AfterViewInit } from '@angular/core';
import { MatButtonToggleChange } from '@angular/material/button-toggle/public-api';
import { MatDialog } from '@angular/material/dialog';

@Component({
selector: 'app-bar',
Expand All @@ -15,6 +17,10 @@ export class BarComponent implements AfterViewInit, OnDestroy {
@Output() onIconClick: EventEmitter<null> = new EventEmitter<null>();
@Input('statusUpdate') onStatusUpdate: EventEmitter<string>;

constructor(public dialog: MatDialog) {

}

public iconColor: string[] = [];

public ngAfterViewInit(): void {
Expand Down Expand Up @@ -48,6 +54,16 @@ export class BarComponent implements AfterViewInit, OnDestroy {
}

public iconClick(): void {
this.onIconClick.emit();

const dialogRef = this.dialog.open(SettingsComponent, {
width: '250px',
data: {}
});

dialogRef.afterClosed().subscribe(result => {
console.log(result);
});

//this.onIconClick.emit();
}
}
17 changes: 17 additions & 0 deletions src/app/settings/settings.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h1>Ustawienia</h1>

<form>
<mat-form-field>
<mat-label>Pokój</mat-label>
<input type="number" matInput placeholder="#0000" value="0000">
</mat-form-field>

<mat-form-field>
<mat-label>Serwer</mat-label>
<input matInput placeholder="ipmateusz.ga" value="ipmateusza.ga">
</mat-form-field>

<div mat-dialog-actions align="end">
<button mat-button color="accent" type="submit" cdkFocusInitial>Zapisz</button>
</div>
</form>
3 changes: 3 additions & 0 deletions src/app/settings/settings.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mat-form-field {
width: 100%;
}
25 changes: 25 additions & 0 deletions src/app/settings/settings.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SettingsComponent } from './settings.component';

describe('SettingsComponent', () => {
let component: SettingsComponent;
let fixture: ComponentFixture<SettingsComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingsComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SettingsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
26 changes: 26 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,32 @@ $app-theme: mat-light-theme($app-primary, $app-accent);
}
}

.mat-mini-fab[color="accent"] {
background-color: #FFDC00 !important;
}

.mat-button[color="accent"] {
background-color: #FFDC00 !important;
color: mat-color($mat-purple, 900);
}

.mat-dialog-container {
background-color: mat-color($mat-purple, 900);
color: #FFDC00;
}

.mat-form-field-label {
color: #FFDC00 !important;
}

.mat-form-field-underline {
background-color: #FFDC00 !important;
}

.mat-focused {
color: #FFDC00 !important;
}

.mat-button-toggle-checked {
background-color: mat-color($accent);
color: mat-color($accent, default-contrast);
Expand Down

0 comments on commit 5244476

Please sign in to comment.