diff --git a/angular.json b/angular.json
index a91fe1e..2f0b127 100644
--- a/angular.json
+++ b/angular.json
@@ -24,6 +24,7 @@
"src/assets"
],
"styles": [
+ "./node_modules/@angular/material/prebuilt-themes/purple-green.css",
"src/styles.css"
],
"scripts": []
@@ -88,6 +89,7 @@
"src/assets"
],
"styles": [
+ "./node_modules/@angular/material/prebuilt-themes/purple-green.css",
"src/styles.css"
],
"scripts": []
@@ -119,6 +121,7 @@
}
}
}
- }},
+ }
+ },
"defaultProject": "angular-dashboard"
-}
+}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index bcb7830..0cec44e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -199,6 +199,22 @@
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-9.1.4.tgz",
"integrity": "sha512-gMo/DbCm5BDArladMAeC7/75T2DvhLr4CSUGJt/P/aimTEG2ywoAALs3pzwSSe4qxrHiR0OIksVW3l4km3iXEw=="
},
+ "@angular/cdk": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-9.2.2.tgz",
+ "integrity": "sha512-VNd+KuMN6cBcy4/8OyMxqYaxdjPP6IyCqIVijB2JREkc5Sg4VWmPgx2L3rHt/DzjsVBVRgx35uqOMymDezG3jQ==",
+ "requires": {
+ "parse5": "^5.0.0"
+ },
+ "dependencies": {
+ "parse5": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz",
+ "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==",
+ "optional": true
+ }
+ }
+ },
"@angular/cli": {
"version": "9.1.4",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-9.1.4.tgz",
@@ -470,6 +486,11 @@
"integrity": "sha512-eyVxxiegdb4ESdFGfkuDN+YfUbOVHRQLjIl6ACFJQDNHzVXzbmuqpyr5hIJANIVady103/7+dqRxxJo1DdIdTQ==",
"dev": true
},
+ "@angular/material": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/@angular/material/-/material-9.2.2.tgz",
+ "integrity": "sha512-gdQiMJ6PtW/5fd+0mglHFyzxULDCBGjn9RTET3sUq2rkc9+jBXr4OvnsUyBWSnqqv97XqotVDIx5JgE4/YX/Rw=="
+ },
"@angular/platform-browser": {
"version": "9.1.4",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-9.1.4.tgz",
@@ -13193,7 +13214,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -13214,12 +13236,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -13234,17 +13258,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -13361,7 +13388,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -13373,6 +13401,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -13387,6 +13416,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -13394,12 +13424,14 @@
"minimist": {
"version": "1.2.5",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -13418,6 +13450,7 @@
"version": "0.5.3",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "^1.2.5"
}
@@ -13479,7 +13512,8 @@
"npm-normalize-package-bin": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"npm-packlist": {
"version": "1.4.8",
@@ -13507,7 +13541,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -13519,6 +13554,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -13596,7 +13632,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -13632,6 +13669,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -13651,6 +13689,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -13694,12 +13733,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
diff --git a/package.json b/package.json
index af2c60e..45c97c5 100644
--- a/package.json
+++ b/package.json
@@ -12,10 +12,12 @@
"private": true,
"dependencies": {
"@angular/animations": "~9.1.4",
+ "@angular/cdk": "^9.2.2",
"@angular/common": "~9.1.4",
"@angular/compiler": "~9.1.4",
"@angular/core": "~9.1.4",
"@angular/forms": "~9.1.4",
+ "@angular/material": "^9.2.2",
"@angular/platform-browser": "~9.1.4",
"@angular/platform-browser-dynamic": "~9.1.4",
"@angular/router": "~9.1.4",
diff --git a/src/app/app.component.css b/src/app/app.component.css
index e69de29..9167004 100644
--- a/src/app/app.component.css
+++ b/src/app/app.component.css
@@ -0,0 +1,3 @@
+mat-sidenav-container {
+ height: 100%;
+}
diff --git a/src/app/app.component.html b/src/app/app.component.html
index e48d8c1..583ab5a 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,534 +1,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ 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?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Run and Watch Tests
-
-
-
-
-
-
Build for Production
-
-
-
-
-
-
ng generate component xyz
-
ng add @angular/material
-
ng add @angular/pwa
-
ng add _____
-
ng test
-
ng build --prod
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+ Dashboard
+
+
+
+
+
+
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 2c3ba29..27cd002 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,18 +1,38 @@
-import { BrowserModule } from '@angular/platform-browser';
-import { NgModule } from '@angular/core';
-
-import { AppRoutingModule } from './app-routing.module';
-import { AppComponent } from './app.component';
+import {BrowserModule} from '@angular/platform-browser';
+import {NgModule} from '@angular/core';
+import {AppComponent} from './app.component';
+import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
+import {ClockComponent} from './clock/clock.component';
+import {LayoutModule} from '@angular/cdk/layout';
+import {MatToolbarModule} from '@angular/material/toolbar';
+import {MatSidenavModule} from '@angular/material/sidenav';
+import {MatCardModule} from '@angular/material/card';
+import { DashboardComponent } from './dashboard/dashboard.component';
+import { MatGridListModule } from '@angular/material/grid-list';
+import { MatMenuModule } from '@angular/material/menu';
+import { MatIconModule } from '@angular/material/icon';
+import { MatButtonModule } from '@angular/material/button';
@NgModule({
declarations: [
- AppComponent
+ AppComponent,
+ ClockComponent,
+ DashboardComponent
],
imports: [
BrowserModule,
- AppRoutingModule
+ BrowserAnimationsModule,
+ LayoutModule,
+ MatToolbarModule,
+ MatSidenavModule,
+ MatCardModule,
+ MatGridListModule,
+ MatMenuModule,
+ MatIconModule,
+ MatButtonModule
],
providers: [],
bootstrap: [AppComponent]
})
-export class AppModule { }
+export class AppModule {
+}
diff --git a/src/app/clock/clock.component.css b/src/app/clock/clock.component.css
new file mode 100644
index 0000000..dec8d49
--- /dev/null
+++ b/src/app/clock/clock.component.css
@@ -0,0 +1,15 @@
+.dashboard-card {
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ right: 15px;
+ bottom: 15px;
+}
+
+.dashboard-card-content {
+ text-align: center;
+}
+
+.clock {
+ font-size: 10rem;
+}
diff --git a/src/app/clock/clock.component.html b/src/app/clock/clock.component.html
new file mode 100644
index 0000000..fce7186
--- /dev/null
+++ b/src/app/clock/clock.component.html
@@ -0,0 +1,7 @@
+
+
+
+ {{hour}}:{{minute | number: '2.0-0'}}
+
+
+
diff --git a/src/app/clock/clock.component.spec.ts b/src/app/clock/clock.component.spec.ts
new file mode 100644
index 0000000..22d176f
--- /dev/null
+++ b/src/app/clock/clock.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ClockComponent } from './clock.component';
+
+describe('ClockComponent', () => {
+ let component: ClockComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ClockComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ClockComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/clock/clock.component.ts b/src/app/clock/clock.component.ts
new file mode 100644
index 0000000..9a5331c
--- /dev/null
+++ b/src/app/clock/clock.component.ts
@@ -0,0 +1,32 @@
+import {Component, OnInit} from '@angular/core';
+
+@Component({
+ selector: 'app-clock',
+ templateUrl: './clock.component.html',
+ styleUrls: ['./clock.component.css']
+})
+export class ClockComponent implements OnInit {
+ hour: number;
+ minute: number;
+
+ constructor() {
+ }
+
+ ngOnInit(): void {
+ this.updateTime();
+ this.interval();
+ }
+
+ private updateTime() {
+ const date = new Date(Date.now());
+ this.hour = date.getHours();
+ this.minute = date.getMinutes();
+ }
+
+ private interval() {
+ setInterval(() => {
+ this.updateTime();
+ }, 1000);
+ }
+
+}
diff --git a/src/app/dashboard/dashboard.component.css b/src/app/dashboard/dashboard.component.css
new file mode 100644
index 0000000..49a8146
--- /dev/null
+++ b/src/app/dashboard/dashboard.component.css
@@ -0,0 +1,21 @@
+.grid-container {
+ margin: 20px;
+}
+
+.dashboard-card {
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ right: 15px;
+ bottom: 15px;
+}
+
+.more-button {
+ position: absolute;
+ top: 5px;
+ right: 10px;
+}
+
+.dashboard-card-content {
+ text-align: center;
+}
diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html
new file mode 100644
index 0000000..6a5391f
--- /dev/null
+++ b/src/app/dashboard/dashboard.component.html
@@ -0,0 +1,8 @@
+
diff --git a/src/app/dashboard/dashboard.component.spec.ts b/src/app/dashboard/dashboard.component.spec.ts
new file mode 100644
index 0000000..980c24f
--- /dev/null
+++ b/src/app/dashboard/dashboard.component.spec.ts
@@ -0,0 +1,40 @@
+import { LayoutModule } from '@angular/cdk/layout';
+import { NoopAnimationsModule } from '@angular/platform-browser/animations';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { MatButtonModule } from '@angular/material/button';
+import { MatCardModule } from '@angular/material/card';
+import { MatGridListModule } from '@angular/material/grid-list';
+import { MatIconModule } from '@angular/material/icon';
+import { MatMenuModule } from '@angular/material/menu';
+
+import { DashboardComponent } from './dashboard.component';
+
+describe('DashboardComponent', () => {
+ let component: DashboardComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [DashboardComponent],
+ imports: [
+ NoopAnimationsModule,
+ LayoutModule,
+ MatButtonModule,
+ MatCardModule,
+ MatGridListModule,
+ MatIconModule,
+ MatMenuModule,
+ ]
+ }).compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DashboardComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should compile', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts
new file mode 100644
index 0000000..63ef1d2
--- /dev/null
+++ b/src/app/dashboard/dashboard.component.ts
@@ -0,0 +1,12 @@
+import { Component } from '@angular/core';
+import { map } from 'rxjs/operators';
+import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
+
+@Component({
+ selector: 'app-dashboard',
+ templateUrl: './dashboard.component.html',
+ styleUrls: ['./dashboard.component.css']
+})
+export class DashboardComponent {
+ constructor(private breakpointObserver: BreakpointObserver) {}
+}
diff --git a/src/index.html b/src/index.html
index 188402e..11c0ee5 100644
--- a/src/index.html
+++ b/src/index.html
@@ -6,6 +6,8 @@
+
+
diff --git a/src/styles.css b/src/styles.css
index 90d4ee0..7e7239a 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -1 +1,4 @@
/* 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; }