-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (78 loc) · 3.01 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="style.css" />
<title>Chat Web App</title>
</head>
<body>
<!-- container and title -->
<div class="container my-5">
<h1 class="my-4 text-center">Let's Chat</h1>
<!-- buttons for chatroom -->
<div class="chat-rooms mb-3 text-center">
<div class="my-2">Choose a chatroom:</div>
<button class="btn" id="general">#general</button>
<button class="btn" id="gaming">#gaming</button>
<button class="btn" id="music">#music</button>
<button class="btn" id="ninjas">#ninjas</button>
</div>
<!-- chat list or window -->
<div class="chat-window">
<ul class="chat-list list-group"></ul>
</div>
<!-- new chat form -->
<form class="new-chat my-3">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">Your Message</div>
</div>
<input type="text" id="message" class="form-control" required />
<div class="input-group-append">
<input type="submit" class="btn" value="send" />
</div>
</div>
</form>
<!-- update name form -->
<form class="new-name my-3">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">Update Name</div>
</div>
<input type="text" id="name" class="form-control" required />
<div class="input-group-append">
<input type="submit" class="btn" value="update" />
</div>
</div>
<div class="update-msg"></div>
</form>
</div>
<script src="http://cdn.date-fns.org/v1.9.0/date_fns.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.9.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.9.1/firebase-firestore.js"></script>
<script>
const config = {
apiKey: "AIzaSyDqR09CQdK1xCF56krAv3ZcNCGu2WmJ1UI",
authDomain: "chat-application-bed43.firebaseapp.com",
projectId: "chat-application-bed43",
storageBucket: "chat-application-bed43.appspot.com",
messagingSenderId: "900789877414",
appId: "1:900789877414:web:5a3fb8b3dd386db2175267",
measurementId: "G-TW8WNB6EP5",
};
firebase.initializeApp(config);
const db = firebase.firestore();
</script>
<script src="chat.js"></script>
<script src="ui.js"></script>
<script src="app.js"></script>
</body>
</html>