-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.html
More file actions
107 lines (95 loc) · 4.02 KB
/
chat.html
File metadata and controls
107 lines (95 loc) · 4.02 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" href="logo.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Pacifico&display=swap"
rel="stylesheet">
<!-- <link rel="icon" href="logo.png"> -->
<script src="https://www.w3schools.com/lib/w3.js"></script>
<link rel='stylesheet' href="/style.css" />
<title>Discussion Wall | DigiSchool</title>
</head>
<body onload="setTimeout(updatePage(),30)">
<div class="header">
<img src="logo2.png" class="logo2">
<div class="nav">
<ul class="navbar body" id="myTopNav">
<li><a href="main.html" id="dashboard" class="navlink">DASHBOARD</a></li>
<li><a href="studymaterial.html" id="study" class="navlink">STUDY MATERIALS</a></li>
<li><a href="assessment.html" id="assess" class="navlink">ASSESSMENT</a></li>
<li><a href="activity.html" id="act" class="navlink">ACTIVITY</a></li>
<li><a href="chat.html" id="contact" class="navlink">DISCUSS</a></li>
<li><a href="feedback.html" id="elib" class="navlink">FEEDBACK</a></li>
<li><a href="index.html" id="log" class="navlink" style="padding: 10px 16px"><i style="padding: 0px"
class="fas fa-power-off"></i></a></li>
<li><a href="javascript:void(0);" class="navlink icon" onclick="formatnav()"><i class="fas fa-bars"></i></a>
</li>
</ul>
</div>
<link rel="stylesheet" href="style.css">
</div>
<hr>
<h1 class="head center">The Discussion Wall</h1>
<div class="chats body">
<iframe onload="this.contentDocument.body.scrollTop = 100;" src="messenger.html#end" class="chatIfram">
</iframe>
<form action="javascript:void(0);"
style="width: 100%; display: flex; flex-direction: row; justify-content: space-evenly;">
<input id="inp" placeholder="Write something..."></input><button class="body" onclick="update()">GO</button>
</form>
</div>
<script>
w3.includeHTML();
function updatePage() {
document.getElementById('contact').className += " active"
}
</script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.3.4/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.0/firebase-database.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCH12W9j5x41cXRrlXaDHij3rEjsL1fiQQ",
authDomain: "shoot-n-survive.firebaseapp.com",
databaseURL: "https://shoot-n-survive.firebaseio.com",
projectId: "shoot-n-survive",
storageBucket: "shoot-n-survive.appspot.com",
messagingSenderId: "192631098144",
appId: "1:192631098144:web:7f7ec26f0be19d1dc42545"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script>
let database = firebase.database();
function formatnav() {
let x = document.getElementById("myTopNav");
if (x.className === "navbar body") {
x.className += " responsive";
} else {
x.className = "navbar body";
}
}
let chats = [];
database.ref('/digital-school/chats').on('value', (data) => {
chats = (data.val());
});
function update(txt) {
let text = document.getElementById('inp').value;
if (text == "") return
chats.push(text);
database.ref('digital-school').set({
chats: chats
})
document.getElementById('inp').value = '';
}
</script>
</body>
</html>