-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (83 loc) · 3.24 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
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="styles.css" />
<title>Ninja Chat</title>
</head>
<body>
<!-- container & title -->
<div class="container my-4">
<h1 class="my-4 text-center">Ninja Chat</h1>
<!-- buttons for chatrooms -->
<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 / 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-mssg"></div>
</form>
</div>
<script src="http://cdn.date-fns.org/v1.9.0/date_fns.min.js"></script>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.13.0/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.13.0/firebase-analytics.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyAdiVfri0UVWYOpOLl9JtQHV3LqT5J5Xfg",
authDomain: "java-script-a8590.firebaseapp.com",
projectId: "java-script-a8590",
storageBucket: "java-script-a8590.appspot.com",
messagingSenderId: "435589501733",
appId: "1:435589501733:web:02f2da24380144d76d40cc",
measurementId: "G-TMQT1H277J"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
</script>
<script src="scripts/chat.js"></script>
<script src="scripts/ui.js"></script>
<script src="scripts/app.js"></script>
</body>
</html>