Spaces:
Runtime error
Runtime error
Really-amin
commited on
Commit
•
710e022
1
Parent(s):
0a1471b
Update static/index.html
Browse files- static/index.html +37 -0
static/index.html
CHANGED
@@ -1099,6 +1099,43 @@
|
|
1099 |
// Send to WebSocket
|
1100 |
ws.send(message);
|
1101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1102 |
</script>
|
1103 |
</body>
|
1104 |
|
|
|
1099 |
// Send to WebSocket
|
1100 |
ws.send(message);
|
1101 |
}
|
1102 |
+
|
1103 |
+
// Toggle theme function
|
1104 |
+
function toggleTheme() {
|
1105 |
+
document.body.classList.toggle('dark-theme');
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
// Toggle sound function
|
1109 |
+
function toggleSound() {
|
1110 |
+
const soundToggle = document.getElementById('soundToggle');
|
1111 |
+
soundToggle.classList.toggle('muted');
|
1112 |
+
if (soundToggle.classList.contains('muted')) {
|
1113 |
+
soundToggle.title = 'صدا خاموش است';
|
1114 |
+
// Add logic to mute sound
|
1115 |
+
} else {
|
1116 |
+
soundToggle.title = 'صدا روشن است';
|
1117 |
+
// Add logic to unmute sound
|
1118 |
+
}
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
// Clear chat function
|
1122 |
+
function clearChat() {
|
1123 |
+
messagesContainer.innerHTML = '';
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
// Download chat function
|
1127 |
+
function downloadChat() {
|
1128 |
+
const chatContent = messagesContainer.innerHTML;
|
1129 |
+
const blob = new Blob([chatContent], { type: 'text/html' });
|
1130 |
+
const url = URL.createObjectURL(blob);
|
1131 |
+
const a = document.createElement('a');
|
1132 |
+
a.href = url;
|
1133 |
+
a.download = 'chat.html';
|
1134 |
+
document.body.appendChild(a);
|
1135 |
+
a.click();
|
1136 |
+
document.body.removeChild(a);
|
1137 |
+
URL.revokeObjectURL(url);
|
1138 |
+
}
|
1139 |
</script>
|
1140 |
</body>
|
1141 |
|