app.component.html
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<div class="demo-layout mdl-layout mdl-js-layout mdl-layout--fixed-header">
<!-- Header section containing logo -->
<header class="mdl-layout__header mdl-color-text--white mdl-color--light-blue-700">
<div class="mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-grid">
<div class="mdl-layout__header-row mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-cell--12-col-desktop">
<h3><i class="material-icons">chat_bubble_outline</i> Friendly Chat</h3>
</div>
<div id="user-container">
<div *ngIf="currentUser" id="user-pic" [ngStyle]="profilePicStyles"></div>
<div *ngIf="currentUser" id="user-name">{{ (user | async)?.displayName }}</div>
<button *ngIf="currentUser" id="sign-out" (click)="logout()" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-color-text--white">
Sign-out
</button>
<button *ngIf="!currentUser" id="sign-in" (click)="login()" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-color-text--white">
<i class="material-icons">account_circle</i>Sign-in with Google
</button>
</div>
</div>
</header>
<main class="mdl-layout__content mdl-color--grey-100">
<div id="messages-card-container" class="mdl-cell mdl-cell--12-col mdl-grid">
<!-- Messages container -->
<div id="messages-card" class="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--6-col-tablet mdl-cell--6-col-desktop">
<div class="mdl-card__supporting-text mdl-color-text--grey-600">
<div id="messages">
<span id="message-filler"></span>
<div class="message-container" *ngFor="let message of messages | async">
<div class="spacing">
<div class="pic" [style.background-image]="'url(' + message.photoUrl + ')'"></div>
</div>
<div class="message">
<span *ngIf="message.text" [style]="message.sentiment | stylize">{{ message.text }}</span>
<img *ngIf="message.imageUrl" [src]="message.imageUrl + (message.moderated ? '&moderated=1' : '')">
</div>
<div class="name">{{ message.name }}</div>
</div>
</div>
<div *ngIf="topics"><em>Recent topics: {{ topics }}</em></div>
<form id="message-form" (submit)="saveMessage($event, box)">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input #box class="mdl-textfield__input" type="text" id="message"
(keyup)="update(box.value)" (blur)="update(box.value)"
placeholder="Message...">
</div>
<button id="submit" [disabled]="!value" type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect">
Send
</button>
</form>
<form id="image-form" action="#">
<input id="mediaCapture" type="file" accept="image/*,capture=camera" (change)="saveImageMessage($event)">
<button id="submitImage" title="Add an image" (click)="onImageClick($event)"
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-color--amber-400 mdl-color-text--white">
<i class="material-icons">image</i>
</button>
</form>
</div>
</div>
</div>
</main>
</div>