-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
49 lines (39 loc) · 1.51 KB
/
Copy pathscript.js
File metadata and controls
49 lines (39 loc) · 1.51 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
window.addEventListener('load', function () {
const loadingScreen = document.getElementById('loading-screen');
loadingScreen.style.opacity = '0';
setTimeout(() => {
loadingScreen.style.display = 'none';
}, 5000);
});
window.addEventListener("DOMContentLoaded", () => {
// FAB functionality
const fab = document.getElementById('xFab');
const mainBtn = document.getElementById('fabMain');
const scrim = document.getElementById('scrim');
function toggle() { fab.classList.toggle('open'); }
mainBtn.addEventListener('click', toggle);
scrim.addEventListener('click', toggle);
// Close when tapping outside the FAB
document.addEventListener('click', (e) => {
if (!fab.contains(e.target) && fab.classList.contains('open')) fab.classList.remove('open');
});
const chatbot = document.getElementById("myText");
const showBtn = document.getElementById("show-btn");
const hideBtn = document.getElementById("hide-btn");
chatbot.classList.remove("active");
showBtn.style.display = "block";
showBtn.addEventListener("click", () => {
chatbot.classList.add("active");
showBtn.style.display = "none";
});
hideBtn.addEventListener("click", () => {
chatbot.classList.remove("active");
showBtn.style.display = "block";
});
document.querySelectorAll('.post-grok').forEach(function (grokBtn) {
grokBtn.addEventListener('click', function () {
chatbot.classList.add('active');
showBtn.style.display = 'none';
});
});
});