-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
219 lines (196 loc) · 11.3 KB
/
Copy pathindex.html
File metadata and controls
219 lines (196 loc) · 11.3 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta name="theme-color" content="#007aff">
<meta name="color-scheme" content="light dark">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Call">
<meta name="application-name" content="Call">
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<title>Make a Call | WeCanUseAI</title>
<meta name="description" content="Peer-to-peer voice calls in the browser, built on WebRTC.">
<link rel="canonical" href="https://call.wecanuseai.com/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="WeCanUseAI">
<meta property="og:title" content="Make a Call">
<meta property="og:description" content="Peer-to-peer voice calls in the browser, built on WebRTC.">
<meta property="og:url" content="https://call.wecanuseai.com/">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Make a Call">
<meta name="twitter:description" content="Peer-to-peer voice calls in the browser, built on WebRTC.">
<!-- Favicon from favicon.wecanuseai.com -->
<link rel="icon" type="image/x-icon" href="https://favicon.wecanuseai.com/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="https://favicon.wecanuseai.com/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://favicon.wecanuseai.com/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="https://favicon.wecanuseai.com/favicon-48x48.png">
<link rel="manifest" href="https://favicon.wecanuseai.com/manifest.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="https://favicon.wecanuseai.com/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://favicon.wecanuseai.com/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://favicon.wecanuseai.com/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://favicon.wecanuseai.com/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://favicon.wecanuseai.com/apple-touch-icon-76x76.png">
<meta name="msapplication-TileColor" content="#007aff">
<meta name="msapplication-TileImage" content="https://favicon.wecanuseai.com/mstile-144x144.png">
<meta name="msapplication-config" content="https://favicon.wecanuseai.com/browserconfig.xml">
<link rel="stylesheet" href="style.css">
<script type="module">
import { prepare, layout } from 'https://esm.sh/@chenglou/pretext';
window.Pretext = { prepare, layout };
</script>
</head>
<body>
<div class="container">
<header>
<h1>call.wecanuseai.com</h1>
<p>Private rooms with messaging and voice calls</p>
</header>
<div class="main-content">
<div class="call-setup" id="callSetup">
<div class="input-group">
<label for="channelInput">Room ID</label>
<input type="text" id="channelInput" placeholder="Enter room ID or leave blank for new room" maxlength="20">
</div>
<div class="input-group">
<label for="nameInput">Your Name</label>
<input type="text" id="nameInput" placeholder="Enter your name" maxlength="30" required>
</div>
<div class="input-group">
<label for="maxCallers">Max Participants</label>
<select id="maxCallers">
<option value="0">Unlimited</option>
<option value="2">2 people</option>
<option value="5" selected>5 people</option>
<option value="10">10 people</option>
</select>
</div>
<div class="input-group">
<label class="checkbox-label" for="offlineModeToggle" style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
<input type="checkbox" id="offlineModeToggle">
<span>Decentralized Mode (No Server / Offline)</span>
</label>
<small style="color: #666; font-size: 12px;">In this mode, no connection to Firebase is made.</small>
</div>
<button id="joinBtn" class="btn-primary">Join Room</button>
<button id="quickCallBtn" class="btn-secondary">Create New Room</button>
</div>
<div class="call-interface hidden" id="callInterface">
<div class="room-header">
<h3 id="roomTitle" title="Click to rename">Room</h3>
<div class="room-status">
<span id="callStatus">Connected</span> •
<span id="callerCount">1</span>/<span id="maxCallerCount">5</span> participants
</div>
</div>
<div class="share-section" id="shareSection">
<div class="input-group">
<label>Share Room (Firebase)</label>
<div style="display: flex; gap: 8px;">
<input type="text" id="shareUrl" readonly style="flex: 1;">
<button id="copyBtn" class="btn-secondary" style="width: auto; padding: 10px 16px;">Copy</button>
</div>
</div>
<div class="advanced-tab" id="advancedTab">🔼 Advanced P2P</div>
<div class="advanced-content hidden" id="advancedContent">
<div class="input-group">
<label>Direct P2P Link (No Server)</label>
<div style="display: flex; gap: 8px;">
<input type="text" id="p2pShareUrl" readonly style="flex: 1;">
<button id="copyP2PBtn" class="btn-secondary" style="width: auto; padding: 10px 16px;">Copy P2P</button>
</div>
</div>
<div class="manual-p2p" style="margin-top: 15px; border-top: 1px solid #ddd; padding-top: 15px;">
<p style="font-weight: 600; margin-bottom: 8px;">Manual Connection (Offline)</p>
<p style="font-size: 12px; color: #666; margin-bottom: 10px;">Copy your offer and send it to your friend, then paste their answer here.</p>
<div class="input-group">
<label>1. My Connection Data</label>
<div style="display: flex; gap: 8px;">
<input type="text" id="myConnectionData" readonly placeholder="Generating..." style="flex: 1; font-family: monospace; font-size: 10px;">
<button id="copyMyDataBtn" class="btn-secondary" style="width: auto; padding: 10px;">Copy</button>
</div>
</div>
<div class="input-group">
<label>2. Friend's Connection Data</label>
<div style="display: flex; gap: 8px;">
<input type="text" id="friendConnectionData" placeholder="Paste data here..." style="flex: 1; font-family: monospace; font-size: 10px;">
<button id="applyFriendDataBtn" class="btn-primary" style="width: auto; padding: 10px;">Connect</button>
</div>
</div>
</div>
<div id="qrCodeContainer" class="qr-container"></div>
<p class="p2p-info">
<small>🔒 Direct peer-to-peer connection - no server required after initial handshake</small>
</p>
</div>
</div>
<div class="control-group">
<button id="startCallBtn" class="btn-control">📞 Start Call</button>
<button id="speakerBtn" class="btn-control">🔊 Speaker</button>
<button id="endCallBtn" class="btn-control danger">📵 End Call</button>
</div>
<div class="message-section">
<div class="messages" id="messagesList"></div>
<div class="message-input-group">
<input type="text" id="messageInput" placeholder="Type a message..." maxlength="200" autocomplete="off" spellcheck="true">
<button id="sendMessageBtn" class="btn-send" aria-label="Send message">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
</svg>
</button>
</div>
</div>
<div class="participants-section">
<div class="section-header">
<label>Participants</label>
</div>
<div id="participantsList" class="participants-list"></div>
</div>
</div>
<div class="chat-history" id="chatHistory">
<div class="section-header">
<label>Recent Rooms</label>
</div>
<div id="historyList" class="history-list"></div>
</div>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-auth.js"></script>
<script src="config.js"></script>
<script type="module" src="src/js/main.js"></script>
<!-- Haptic feedback for mobile -->
<script>
// Add haptic feedback for mobile interactions
if ('vibrate' in navigator) {
document.addEventListener('click', (e) => {
if (e.target.matches('button, .btn-quick, .btn-control, .btn-share')) {
navigator.vibrate(50);
}
});
}
</script>
<footer class="wecanuseai-footer">
<a href="https://wecanuseai.com">Back to wecanuseai.com</a>
</footer>
<footer role="contentinfo" class="wcua-footer">
<p>© <span class="copyright-year"></span> WeCanUseAI. Empowering creativity with AI.</p>
<nav class="wcua-footer-links" aria-label="Footer navigation">
<a href="https://wecanuseai.com/">Home</a>
<a href="https://wecanuseai.com/privacy.html">Privacy</a>
<a href="https://wecanuseai.com/terms.html">Terms</a>
<a href="https://wecanuseai.com/contact.html">Contact</a>
</nav>
</footer>
<script>
document.querySelectorAll('.copyright-year').forEach(el => {
el.textContent = new Date().getFullYear();
});
</script>
</body>
</html>