-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimply-chat.html
65 lines (59 loc) · 2.02 KB
/
simply-chat.html
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
63
64
65
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Simple Chat</title>
</head>
<body>
<div class="container">
<header>
<h1>Simply Chat</h1>
{{> loginButtons}}
<div class='online'>
{{#if onlineUsers}}
{{#each onlineUsers}}
<img src='online.png' width='10px'/> {{username}}
{{/each}}
{{/if}}
</div>
<p></p>
</header>
<div class="chat-box">
<!-- create a task template for each chat -->
{{#each chats}}
{{> chat}}
{{/each}}
</div>
{{#if currentUser}}
<div style="{{#if whoisTyping}}font-family:courier;font-style: italic;width:100%;margin-top:5px;{{/if}}">
{{#if whoisTyping}}
{{#each whoisTyping}}
{{username}} is {{typing}}...
{{/each}}
{{/if}}
</div>
<form class="new-msg">
<div class="enter-message">
<input type="text" name="text" class="msg" placeholder="Enter your message"/>
<input type="submit" class="send" value='Send'/>
</div>
</form>
<div class="developer">Developer: [email protected]</div>
{{/if}}
</div>
</body>
<!-- template handles each chat message or just put between {#each}
hard coded profile pics for two test accounts-->
<template name="chat">
<div class="message-box {{#if equals username currentUser.username}} left-img{{/if}} {{#unless equals username currentUser.username}} right-img {{/unless}}">
<div class="picture">
<img src="
http://www.freeiconspng.com/uploads/little-funny-penguin-png-2.png"
title = "user name"/>
</div>
<div class=" {{#if equals username currentUser.username}} message {{/if}} {{#unless equals username currentUser.username}} message2 {{/unless}}">
<button class="delete"><span style="font-size:10px;">({{createdAt}} {{username}})</span> ×</button>
<span style="word-wrap: break-word;">{{text}}</span>
</div>
</div>
</template>