freddyaboulton HF Staff commited on
Commit
b0614ed
·
verified ·
1 Parent(s): 250897a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +63 -30
index.html CHANGED
@@ -9,14 +9,21 @@
9
  :root {
10
  --primary-gradient: linear-gradient(135deg, #f9a45c 0%, #e66465 100%);
11
  --background-cream: #faf8f5;
 
 
12
  --text-dark: #2d2d2d;
 
 
 
 
13
  }
14
 
15
  body {
16
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
17
  margin: 0;
18
  padding: 0;
19
- background-color: var(--background-cream);
 
20
  color: var(--text-dark);
21
  min-height: 100vh;
22
  }
@@ -43,18 +50,26 @@
43
 
44
  .container {
45
  max-width: 1000px;
46
- margin: 1.5rem auto;
 
47
  padding: 0 2rem;
48
  }
49
 
50
  .transcript-container {
51
- border-radius: 8px;
52
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
 
 
53
  padding: 1.5rem;
54
- height: 300px;
 
55
  overflow-y: auto;
56
- margin-bottom: 1.5rem;
57
- border: 1px solid rgba(0, 0, 0, 0.1);
 
 
 
 
58
  }
59
 
60
  .controls {
@@ -88,22 +103,39 @@
88
 
89
  /* Transcript text styling */
90
  .transcript-container p {
91
- margin: 0.4rem 0;
92
- padding: 0.6rem;
 
 
93
  background: var(--background-cream);
94
- border-radius: 4px;
95
- line-height: 1.4;
96
- font-size: 0.95rem;
 
 
 
 
 
 
 
 
97
  }
98
 
99
- /* Custom scrollbar - made thinner */
 
 
 
 
 
100
  .transcript-container::-webkit-scrollbar {
101
- width: 6px;
 
102
  }
103
 
104
  .transcript-container::-webkit-scrollbar-track {
105
- background: var(--background-cream);
106
- border-radius: 3px;
 
107
  }
108
 
109
  .transcript-container::-webkit-scrollbar-thumb {
@@ -414,6 +446,21 @@
414
  updateButtonState();
415
  });
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  // Create data channel for messages
418
  const dataChannel = peerConnection.createDataChannel('text');
419
  dataChannel.onmessage = handleMessage;
@@ -422,20 +469,6 @@
422
  const offer = await peerConnection.createOffer();
423
  await peerConnection.setLocalDescription(offer);
424
 
425
- await new Promise((resolve) => {
426
- if (peerConnection.iceGatheringState === "complete") {
427
- resolve();
428
- } else {
429
- const checkState = () => {
430
- if (peerConnection.iceGatheringState === "complete") {
431
- peerConnection.removeEventListener("icegatheringstatechange", checkState);
432
- resolve();
433
- }
434
- };
435
- peerConnection.addEventListener("icegatheringstatechange", checkState);
436
- }
437
- });
438
-
439
  webrtc_id = Math.random().toString(36).substring(7);
440
 
441
  const response = await fetch('/webrtc/offer', {
 
9
  :root {
10
  --primary-gradient: linear-gradient(135deg, #f9a45c 0%, #e66465 100%);
11
  --background-cream: #faf8f5;
12
+ --background-cream-end: #f7f5f2;
13
+ /* Slightly warmer end color for body gradient */
14
  --text-dark: #2d2d2d;
15
+ --transcript-bg: #ffffff;
16
+ /* White background for transcript area */
17
+ --transcript-border: #e0e0e0;
18
+ /* Light border for transcript items */
19
  }
20
 
21
  body {
22
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
23
  margin: 0;
24
  padding: 0;
25
+ /* Apply a subtle vertical gradient to the body */
26
+ background: linear-gradient(to bottom, var(--background-cream), var(--background-cream-end));
27
  color: var(--text-dark);
28
  min-height: 100vh;
29
  }
 
50
 
51
  .container {
52
  max-width: 1000px;
53
+ margin: 2.5rem auto;
54
+ /* Increased top/bottom margin */
55
  padding: 0 2rem;
56
  }
57
 
58
  .transcript-container {
59
+ border-radius: 12px;
60
+ /* Slightly larger radius */
61
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
62
+ /* Enhanced shadow */
63
  padding: 1.5rem;
64
+ height: 350px;
65
+ /* Increased height */
66
  overflow-y: auto;
67
+ margin-bottom: 2rem;
68
+ /* Increased margin */
69
+ border: 1px solid rgba(0, 0, 0, 0.05);
70
+ /* Softer border */
71
+ background-color: var(--transcript-bg);
72
+ /* Use the new variable */
73
  }
74
 
75
  .controls {
 
103
 
104
  /* Transcript text styling */
105
  .transcript-container p {
106
+ margin: 0.6rem 0;
107
+ /* Increased vertical margin */
108
+ padding: 0.8rem 1rem;
109
+ /* Increased padding */
110
  background: var(--background-cream);
111
+ /* Use the lighter cream for contrast */
112
+ border-radius: 6px;
113
+ /* Slightly larger radius */
114
+ line-height: 1.5;
115
+ /* Improved line spacing */
116
+ font-size: 0.98rem;
117
+ /* Slightly larger font */
118
+ border-left: 3px solid var(--transcript-border);
119
+ /* Add a subtle left border */
120
+ transition: background-color 0.2s ease;
121
+ /* Smooth hover effect */
122
  }
123
 
124
+ .transcript-container p:hover {
125
+ background-color: #fdfbf9;
126
+ /* Slightly change background on hover */
127
+ }
128
+
129
+ /* Custom scrollbar - update track color */
130
  .transcript-container::-webkit-scrollbar {
131
+ width: 8px;
132
+ /* Slightly wider scrollbar */
133
  }
134
 
135
  .transcript-container::-webkit-scrollbar-track {
136
+ background: var(--background-cream-end);
137
+ /* Match body end gradient */
138
+ border-radius: 4px;
139
  }
140
 
141
  .transcript-container::-webkit-scrollbar-thumb {
 
446
  updateButtonState();
447
  });
448
 
449
+ peerConnection.onicecandidate = ({ candidate }) => {
450
+ if (candidate) {
451
+ console.debug("Sending ICE candidate", candidate);
452
+ fetch('/webrtc/offer', {
453
+ method: 'POST',
454
+ headers: { 'Content-Type': 'application/json' },
455
+ body: JSON.stringify({
456
+ candidate: candidate.toJSON(),
457
+ webrtc_id: webrtc_id,
458
+ type: "ice-candidate",
459
+ })
460
+ })
461
+ }
462
+ };
463
+
464
  // Create data channel for messages
465
  const dataChannel = peerConnection.createDataChannel('text');
466
  dataChannel.onmessage = handleMessage;
 
469
  const offer = await peerConnection.createOffer();
470
  await peerConnection.setLocalDescription(offer);
471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  webrtc_id = Math.random().toString(36).substring(7);
473
 
474
  const response = await fetch('/webrtc/offer', {