FunWith commited on
Commit
aa5cdae
Β·
verified Β·
1 Parent(s): 17c6267

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. static/app.js +167 -1
  2. static/index.html +25 -0
  3. static/styles.css +83 -0
static/app.js CHANGED
@@ -546,6 +546,19 @@ function setupCallControls() {
546
 
547
  // Background blur
548
  document.getElementById("bgBlurBtn").addEventListener("click", toggleBgBlur);
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  }
550
 
551
  function toggleMic() {
@@ -1064,7 +1077,7 @@ function showToast(message) {
1064
 
1065
  // ── Side Panel Helper ───────────────────────────────────────────────────
1066
  function closeSidePanels(except) {
1067
- const panels = ["chatPanel", "participantsPanel", "whiteboardPanel", "pollsPanel", "breakoutPanel"];
1068
  panels.forEach(id => {
1069
  if (id !== except) document.getElementById(id).classList.remove("open");
1070
  });
@@ -1502,3 +1515,156 @@ function toggleBgBlur() {
1502
  }
1503
  }
1504
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
 
547
  // Background blur
548
  document.getElementById("bgBlurBtn").addEventListener("click", toggleBgBlur);
549
+
550
+ // Meeting Notes
551
+ document.getElementById("notesBtn").addEventListener("click", () => {
552
+ const panel = document.getElementById("notesPanel");
553
+ const open = !panel.classList.contains("open");
554
+ closeSidePanels("notesPanel");
555
+ panel.classList.toggle("open", open);
556
+ if (open) refreshNotesSummaries();
557
+ });
558
+ document.getElementById("closeNotesBtn").addEventListener("click", () => {
559
+ document.getElementById("notesPanel").classList.remove("open");
560
+ });
561
+ document.getElementById("saveNotesBtn").addEventListener("click", saveNotes);
562
  }
563
 
564
  function toggleMic() {
 
1077
 
1078
  // ── Side Panel Helper ───────────────────────────────────────────────────
1079
  function closeSidePanels(except) {
1080
+ const panels = ["chatPanel", "participantsPanel", "whiteboardPanel", "pollsPanel", "breakoutPanel", "notesPanel"];
1081
  panels.forEach(id => {
1082
  if (id !== except) document.getElementById(id).classList.remove("open");
1083
  });
 
1515
  }
1516
  }
1517
  }
1518
+
1519
+ // ── Meeting Notes ───────────────────────────────────────────────────────
1520
+ function refreshNotesSummaries() {
1521
+ // Polls summary
1522
+ const pollsContent = document.getElementById("notesPollsContent");
1523
+ const pollKeys = Object.keys(activePolls);
1524
+ if (pollKeys.length) {
1525
+ pollsContent.innerHTML = pollKeys.map(pid => {
1526
+ const p = activePolls[pid];
1527
+ const total = p.total_votes || 0;
1528
+ const results = p.results || p.options.map(() => 0);
1529
+ let html = `<div class="notes-poll"><strong>${escapeHtml(p.question)}</strong>${p.active ? '' : ' <em>(ended)</em>'}`;
1530
+ html += '<ul>' + p.options.map((opt, i) => {
1531
+ const count = results[i] || 0;
1532
+ const pct = total > 0 ? Math.round(count / total * 100) : 0;
1533
+ return `<li>${escapeHtml(opt)}: ${count} vote${count !== 1 ? 's' : ''} (${pct}%)</li>`;
1534
+ }).join('') + '</ul></div>';
1535
+ return html;
1536
+ }).join('');
1537
+ } else {
1538
+ pollsContent.textContent = 'No polls yet.';
1539
+ }
1540
+
1541
+ // Whiteboard snapshot
1542
+ const wbContent = document.getElementById("notesWhiteboardContent");
1543
+ const canvas = document.getElementById("whiteboardCanvas");
1544
+ if (canvas && canvas._initialized) {
1545
+ const ctx = canvas.getContext("2d");
1546
+ const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
1547
+ const hasContent = imageData.data.some((v, i) => i % 4 !== 3 && v !== 0);
1548
+ if (hasContent) {
1549
+ const dataUrl = canvas.toDataURL("image/png");
1550
+ wbContent.innerHTML = `<img src="${dataUrl}" class="notes-wb-img" alt="Whiteboard snapshot">`;
1551
+ } else {
1552
+ wbContent.innerHTML = '<em>Whiteboard is empty.</em>';
1553
+ }
1554
+ } else {
1555
+ wbContent.innerHTML = '<em>Open whiteboard to capture.</em>';
1556
+ }
1557
+
1558
+ // Breakout rooms summary
1559
+ const brContent = document.getElementById("notesBreakoutContent");
1560
+ const brList = document.getElementById("breakoutActiveList");
1561
+ if (brList && brList.children.length > 0) {
1562
+ brContent.innerHTML = brList.innerHTML;
1563
+ } else {
1564
+ brContent.textContent = 'No breakout rooms yet.';
1565
+ }
1566
+ }
1567
+
1568
+ function saveNotes() {
1569
+ refreshNotesSummaries();
1570
+
1571
+ const userNotes = document.getElementById("notesTextarea").value;
1572
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
1573
+ const meetingDuration = document.getElementById("meetingTimer").textContent;
1574
+ const participantCount = Object.keys(peerConnections).length + 1;
1575
+
1576
+ // Build participants list
1577
+ const participants = [myName + " (You)"];
1578
+ for (const pid in peerConnections) {
1579
+ participants.push(peerConnections[pid].name || "Peer");
1580
+ }
1581
+
1582
+ // Build polls text
1583
+ let pollsText = "";
1584
+ const pollKeys = Object.keys(activePolls);
1585
+ if (pollKeys.length) {
1586
+ pollsText = pollKeys.map(pid => {
1587
+ const p = activePolls[pid];
1588
+ const total = p.total_votes || 0;
1589
+ const results = p.results || p.options.map(() => 0);
1590
+ let t = ` Q: ${p.question}${p.active ? '' : ' (ended)'}`;
1591
+ p.options.forEach((opt, i) => {
1592
+ const count = results[i] || 0;
1593
+ const pct = total > 0 ? Math.round(count / total * 100) : 0;
1594
+ t += `\n - ${opt}: ${count} vote${count !== 1 ? 's' : ''} (${pct}%)`;
1595
+ });
1596
+ t += `\n Total votes: ${total}`;
1597
+ return t;
1598
+ }).join("\n\n");
1599
+ }
1600
+
1601
+ // Build text content
1602
+ let content = `QuickMeet - Meeting Notes\n`;
1603
+ content += `========================\n\n`;
1604
+ content += `Room: ${roomId}\n`;
1605
+ content += `Date: ${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}\n`;
1606
+ content += `Duration: ${meetingDuration}\n`;
1607
+ content += `Participants (${participantCount}): ${participants.join(", ")}\n\n`;
1608
+
1609
+ if (userNotes.trim()) {
1610
+ content += `--- Notes ---\n${userNotes}\n\n`;
1611
+ }
1612
+
1613
+ if (pollsText) {
1614
+ content += `--- Polls ---\n${pollsText}\n\n`;
1615
+ }
1616
+
1617
+ // Breakout rooms text
1618
+ const brList = document.getElementById("breakoutActiveList");
1619
+ if (brList && brList.children.length > 0) {
1620
+ content += `--- Breakout Rooms ---\n`;
1621
+ brList.querySelectorAll(".breakout-room-row").forEach(row => {
1622
+ const name = row.querySelector("strong")?.textContent || "Room";
1623
+ const peers = [...row.querySelectorAll(".br-peer-chip")].map(el => el.textContent).join(", ");
1624
+ content += ` ${name}: ${peers || "empty"}\n`;
1625
+ });
1626
+ content += "\n";
1627
+ }
1628
+
1629
+ // Chat log
1630
+ const chatMsgs = document.querySelectorAll("#chatMessages .chat-msg");
1631
+ if (chatMsgs.length) {
1632
+ content += `--- Chat Log ---\n`;
1633
+ chatMsgs.forEach(msg => {
1634
+ const nameEl = msg.querySelector(".chat-name");
1635
+ const timeEl = msg.querySelector(".chat-time");
1636
+ const textEl = msg.querySelector(".chat-text");
1637
+ content += ` [${timeEl?.textContent || ''}] ${nameEl?.textContent || ''}: ${textEl?.textContent || ''}\n`;
1638
+ });
1639
+ content += "\n";
1640
+ }
1641
+
1642
+ // Save as text file
1643
+ const blob = new Blob([content], { type: "text/plain" });
1644
+ const url = URL.createObjectURL(blob);
1645
+ const a = document.createElement("a");
1646
+ a.href = url;
1647
+ a.download = `QuickMeet-Notes-${roomId}-${timestamp}.txt`;
1648
+ a.click();
1649
+ URL.revokeObjectURL(url);
1650
+
1651
+ // Also save whiteboard image separately if it has content
1652
+ const canvas = document.getElementById("whiteboardCanvas");
1653
+ if (canvas && canvas._initialized) {
1654
+ const ctx = canvas.getContext("2d");
1655
+ const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
1656
+ const hasContent = imageData.data.some((v, i) => i % 4 !== 3 && v !== 0);
1657
+ if (hasContent) {
1658
+ canvas.toBlob(function(imgBlob) {
1659
+ const imgUrl = URL.createObjectURL(imgBlob);
1660
+ const imgA = document.createElement("a");
1661
+ imgA.href = imgUrl;
1662
+ imgA.download = `QuickMeet-Whiteboard-${roomId}-${timestamp}.png`;
1663
+ imgA.click();
1664
+ URL.revokeObjectURL(imgUrl);
1665
+ }, "image/png");
1666
+ }
1667
+ }
1668
+
1669
+ showToast("Meeting notes saved!");
1670
+ }
static/index.html CHANGED
@@ -155,6 +155,30 @@
155
  <div id="activePollsList"></div>
156
  </div>
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  <!-- Breakout Rooms Panel -->
159
  <div class="side-panel" id="breakoutPanel">
160
  <div class="panel-header-bar">
@@ -234,6 +258,7 @@
234
  <button id="whiteboardBtn" class="dropdown-item"><span class="material-icons-round">draw</span> Whiteboard</button>
235
  <button id="pollsBtn" class="dropdown-item"><span class="material-icons-round">poll</span> Polls</button>
236
  <button id="breakoutBtn" class="dropdown-item"><span class="material-icons-round">dashboard</span> Breakout Rooms</button>
 
237
  <button id="bgBlurBtn" class="dropdown-item"><span class="material-icons-round">blur_on</span> Background Blur</button>
238
  </div>
239
  </div>
 
155
  <div id="activePollsList"></div>
156
  </div>
157
 
158
+ <!-- Meeting Notes Panel -->
159
+ <div class="side-panel" id="notesPanel">
160
+ <div class="panel-header-bar">
161
+ <h3>Meeting Notes</h3>
162
+ <button id="closeNotesBtn" class="icon-btn">βœ•</button>
163
+ </div>
164
+ <textarea id="notesTextarea" placeholder="Type your meeting notes here..."></textarea>
165
+ <div class="notes-sections">
166
+ <details id="notesPollsSummary">
167
+ <summary>Polls Summary</summary>
168
+ <div id="notesPollsContent" class="notes-auto-content">No polls yet.</div>
169
+ </details>
170
+ <details id="notesWhiteboardSummary">
171
+ <summary>Whiteboard Snapshot</summary>
172
+ <div id="notesWhiteboardContent" class="notes-auto-content"><em>Open whiteboard to capture.</em></div>
173
+ </details>
174
+ <details id="notesBreakoutSummary">
175
+ <summary>Breakout Rooms</summary>
176
+ <div id="notesBreakoutContent" class="notes-auto-content">No breakout rooms yet.</div>
177
+ </details>
178
+ </div>
179
+ <button id="saveNotesBtn" class="btn btn-small" style="width:100%;margin-top:8px"><span class="material-icons-round" style="font-size:16px;vertical-align:middle">save</span> Save Notes</button>
180
+ </div>
181
+
182
  <!-- Breakout Rooms Panel -->
183
  <div class="side-panel" id="breakoutPanel">
184
  <div class="panel-header-bar">
 
258
  <button id="whiteboardBtn" class="dropdown-item"><span class="material-icons-round">draw</span> Whiteboard</button>
259
  <button id="pollsBtn" class="dropdown-item"><span class="material-icons-round">poll</span> Polls</button>
260
  <button id="breakoutBtn" class="dropdown-item"><span class="material-icons-round">dashboard</span> Breakout Rooms</button>
261
+ <button id="notesBtn" class="dropdown-item"><span class="material-icons-round">description</span> Meeting Notes</button>
262
  <button id="bgBlurBtn" class="dropdown-item"><span class="material-icons-round">blur_on</span> Background Blur</button>
263
  </div>
264
  </div>
static/styles.css CHANGED
@@ -982,6 +982,89 @@ input[type="text"]::placeholder {
982
  font-variant-numeric: tabular-nums;
983
  }
984
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
  /* ─── Whiteboard ─────────────────────────────────────────── */
986
  #whiteboardCanvas {
987
  background: #fff;
 
982
  font-variant-numeric: tabular-nums;
983
  }
984
 
985
+ /* ─── Meeting Notes Panel ────────────────────────────────── */
986
+ #notesPanel {
987
+ display: flex;
988
+ flex-direction: column;
989
+ }
990
+
991
+ #notesTextarea {
992
+ flex: 1;
993
+ min-height: 120px;
994
+ max-height: 300px;
995
+ resize: vertical;
996
+ border: 1px solid var(--hairline);
997
+ border-radius: var(--radius-sm);
998
+ padding: 10px 12px;
999
+ font-family: inherit;
1000
+ font-size: 13px;
1001
+ line-height: 1.5;
1002
+ color: var(--text-primary);
1003
+ background: var(--bg);
1004
+ outline: none;
1005
+ transition: border-color var(--transition);
1006
+ }
1007
+ #notesTextarea:focus {
1008
+ border-color: var(--blue-600);
1009
+ }
1010
+ #notesTextarea::placeholder {
1011
+ color: var(--text-hint);
1012
+ }
1013
+
1014
+ .notes-sections {
1015
+ margin-top: 8px;
1016
+ display: flex;
1017
+ flex-direction: column;
1018
+ gap: 4px;
1019
+ overflow-y: auto;
1020
+ max-height: 250px;
1021
+ }
1022
+
1023
+ .notes-sections details {
1024
+ border: 1px solid var(--hairline);
1025
+ border-radius: var(--radius-sm);
1026
+ overflow: hidden;
1027
+ }
1028
+
1029
+ .notes-sections summary {
1030
+ padding: 8px 12px;
1031
+ font-size: 13px;
1032
+ font-weight: 500;
1033
+ cursor: pointer;
1034
+ background: var(--surface-alt);
1035
+ color: var(--text-primary);
1036
+ user-select: none;
1037
+ }
1038
+ .notes-sections summary:hover {
1039
+ background: var(--hairline);
1040
+ }
1041
+
1042
+ .notes-auto-content {
1043
+ padding: 8px 12px;
1044
+ font-size: 12px;
1045
+ color: var(--text-secondary);
1046
+ line-height: 1.5;
1047
+ }
1048
+
1049
+ .notes-auto-content ul {
1050
+ list-style: disc;
1051
+ margin: 4px 0 4px 16px;
1052
+ }
1053
+
1054
+ .notes-auto-content li {
1055
+ margin: 2px 0;
1056
+ }
1057
+
1058
+ .notes-poll {
1059
+ margin-bottom: 8px;
1060
+ }
1061
+
1062
+ .notes-wb-img {
1063
+ width: 100%;
1064
+ border-radius: var(--radius-sm);
1065
+ border: 1px solid var(--hairline);
1066
+ }
1067
+
1068
  /* ─── Whiteboard ─────────────────────────────────────────── */
1069
  #whiteboardCanvas {
1070
  background: #fff;