Skip to content

Commit

Permalink
feat: add home page with demo board
Browse files Browse the repository at this point in the history
  • Loading branch information
Beomar97 committed Jul 28, 2022
1 parent 5035b29 commit 94a3b9a
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 26 deletions.
20 changes: 17 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"firebase": "^9.9.1",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"uuid": "^8.3.2",
"zone.js": "~0.11.4"
},
"devDependencies": {
Expand All @@ -44,6 +45,7 @@
"@angular/cli": "~14.1.0",
"@angular/compiler-cli": "^14.1.0",
"@types/jasmine": "~4.0.0",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"angular-cli-ghpages": "^1.0.3",
Expand Down
1 change: 1 addition & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AngularFireAuthModule } from '@angular/fire/compat/auth';
import { ErrorModule } from './error/error.module';
import { DemoBoardComponent } from './home/demo-board/demo-board.component';
import { KanbanModule } from './kanban/kanban.module';
import { UserModule } from './user/user.module';

@NgModule({
declarations: [AppComponent, HomeComponent, DemoBoardComponent],
Expand Down
2 changes: 1 addition & 1 deletion src/app/error/error.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
justify-content: center;
align-items: center;
margin: 200px;
margin: 5vw;
}

.icon {
Expand Down
11 changes: 10 additions & 1 deletion src/app/home/demo-board/demo-board.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<p>It works</p>
<div class="container">
<div class="header">
<img src="assets/default-user.svg" class="avatar" />
<div>
<h1 class="title">Kanban Board of Foo Bar</h1>
<h2 class="subtitle">[email protected]</h2>
</div>
</div>
<app-board-list [boards]="boards"></app-board-list>
</div>
25 changes: 24 additions & 1 deletion src/app/home/demo-board/demo-board.component.scss
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
/* Empty */
.container {
margin: 30px;
}

.header {
display: flex;
align-items: center;
}

.avatar {
margin-right: 10px;
border-radius: 50%;
max-height: 60px;
}

.title {
margin-bottom: 0;
}

.subtitle {
margin-top: 0;
font-size: medium;
color: gray;
}
33 changes: 22 additions & 11 deletions src/app/home/demo-board/demo-board.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { Component, OnInit } from '@angular/core';
import { Board } from 'src/app/kanban/model/board.model';
import * as uuid from 'uuid';

@Component({
selector: 'app-demo-board',
Expand All @@ -10,39 +11,49 @@ import { Board } from 'src/app/kanban/model/board.model';
export class DemoBoardComponent {
boards: Board[] = [
{
id: '0',
id: uuid.v4(),
title: 'Todo',
priority: 0,
tasks: [
{
description: 'Plan my next awesome project',
label: 'yellow'
description: 'Define architecture 🏛',
label: 'blue'
},
{
description: 'Call back investor 💰',
label: 'purple'
},
{ description: 'Reschedule my meeting', label: 'blue' }
{
description: 'Set up cloud infrastructure ☁️',
label: 'green'
}
]
},
{
id: '1',
id: uuid.v4(),
title: 'In progress',
priority: 1,
tasks: [
{
description: 'Plan my next awesome project',
description: 'Plan my next awesome project 🔥',
label: 'yellow'
},
{ description: 'Reschedule my meeting', label: 'blue' }
{
description: 'Get more coffee ☕️',
label: 'red'
}
]
},
{
id: '2',
id: uuid.v4(),
title: 'Done',
priority: 2,
tasks: [
{
description: 'Plan my next awesome project',
label: 'yellow'
description: 'Get some coffee ☕️',
label: 'gray'
},
{ description: 'Reschedule my meeting', label: 'blue' }
{ description: 'Reschedule my meeting 🗓', label: 'gray' }
]
}
];
Expand Down
22 changes: 19 additions & 3 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<header>
<h1>This is the Home Page</h1>
</header>
<div class="layout header">
<img class="logo" src="assets/app-logo.png" />
<h1>Welcome to Kanban 看板</h1>
<p>
The Kanban storyboard app inspired by Trello. <br />
Based on the course by
<a href="https://fireship.io/courses/angular/">Fireship</a>.
</p>
<p>Built with Angular and Firebase 🔥.</p>
<button routerLink="/login" mat-raised-button color="primary">
Sign up for Free
</button>
</div>
<div class="layout">
<h1>Play with the demo!</h1>
<div class="demo-board-container">
<mat-card><app-demo-board></app-demo-board></mat-card>
</div>
</div>
18 changes: 16 additions & 2 deletions src/app/home/home.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
header {
text-align: center;
.layout {
max-width: 80vw;
margin: 5vh auto;
}

.logo {
max-height: 200px;
}

.header {
min-height: 20vh;
}

.demo-board-container {
display: flex;
justify-content: center;
}
3 changes: 2 additions & 1 deletion src/app/kanban/kanban-board/kanban-board.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

.header {
display: flex;
align-items: center;
}

.avatar {
margin-right: 10px;
border-radius: 50%;
height: min-content;
max-height: 60px;
}

.title {
Expand Down
2 changes: 1 addition & 1 deletion src/app/kanban/kanban.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ import { KanbanBoardComponent } from './kanban-board/kanban-board.component';
FormsModule,
DragDropModule
],
exports: [BoardComponent]
exports: [BoardListComponent, BoardComponent]
})
export class KanbanModule {}
3 changes: 1 addition & 2 deletions src/app/user/login-page/login-page.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
}

mat-card {
min-width: 150px;
max-width: 500px;
width: 100%;
margin: 100px auto;
margin: 5vw auto;
}
Binary file added src/assets/app-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/default-user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94a3b9a

Please sign in to comment.