-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
115 lines (108 loc) · 2.82 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Chat Interface</title>
<link rel="stylesheet" href="css/index.css" />
</head>
<body>
<template id="user-header-template">
<style>
:host {
text-align: right;
display: block;
padding: 0px 8px;
font-size: 24px;
font-weight: bold;
}
</style>
Welcome <slot></slot>
</template>
<template id="room-template">
<style>
:host {
display: block;
padding: 8px;
border-bottom: 1px solid gray;
cursor: pointer;
}
</style>
<div>Room: <slot name="roomId"></slot></div>
<div>To: <slot name="receiver"></slot></div>
</template>
<template id="conversation-pane-template">
<style>
:host {
display: block;
padding: 8px;
}
room-component {
margin-bottom: 8px;
}
</style>
<slot></slot>
</template>
<template id="message-template">
<style>
.message-wrapper {
display: block;
}
.message-wrapper.sent {
text-align: right;
}
.message-wrapper.received {
text-align: left;
}
.message {
display: inline-block;
padding: 8px;
margin-bottom: 4px;
border-radius: 8px;
}
.sent .message {
background-color: lightblue;
}
.received .message {
background-color: lightgreen;
}
</style>
<slot class="message-wrapper"></slot>
</template>
<template id="add-message-template">
<style>
:host {
display: block;
padding: 8px;
}
.container {
display: flex;
flex-direction: column;
gap: 8px;
}
textarea {
resize: vertical;
min-height: 60px;
}
</style>
<div class="container">
<textarea id="messageText" placeholder="Type your message"></textarea>
<button id="sendMessage">Send</button>
</div>
</template>
<div class="container">
<room-list class="leftPane" userid=""></room-list>
<div class="rightPane">
<user-header></user-header>
<conversation-pane userid="" roomid=""></conversation-pane>
<add-message userid="" roomid=""></add-message>
</div>
</div>
<script src="js/config.js"></script>
<script src="js/components/user-header.js"></script>
<script src="js/components/room-list.js"></script>
<script src="js/components/room.js"></script>
<script src="js/components/conversation-pane.js"></script>
<script src="js/components/message.js"></script>
<script src="js/components/add-message.js"></script>
</body>
</html>