MMD-Coder commited on
Commit
9ce629e
·
verified ·
1 Parent(s): 5498c37

a website like minichat or ome.tv or something like that. i wanna login and sign-in too (with email and username and password and first,last name - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +556 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Connectme
3
- emoji: 🚀
4
  colorFrom: purple
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: connectme
3
+ emoji: 🐳
4
  colorFrom: purple
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,556 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ConnectMe - Random Video Chat</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
12
+ }
13
+ .chat-container {
14
+ height: calc(100vh - 80px);
15
+ }
16
+ .video-container {
17
+ position: relative;
18
+ padding-bottom: 56.25%; /* 16:9 aspect ratio */
19
+ height: 0;
20
+ overflow: hidden;
21
+ }
22
+ .video-container video {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ object-fit: cover;
29
+ }
30
+ .floating-input {
31
+ transition: all 0.3s ease;
32
+ }
33
+ .floating-input:focus ~ label,
34
+ .floating-input:not(:placeholder-shown) ~ label {
35
+ transform: translateY(-1.5rem) scale(0.85);
36
+ color: #667eea;
37
+ }
38
+ .toggle-form {
39
+ display: none;
40
+ }
41
+ .toggle-form:checked + .form-container {
42
+ display: block;
43
+ }
44
+ .shake {
45
+ animation: shake 0.5s;
46
+ }
47
+ @keyframes shake {
48
+ 0%, 100% { transform: translateX(0); }
49
+ 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
50
+ 20%, 40%, 60%, 80% { transform: translateX(5px); }
51
+ }
52
+ </style>
53
+ </head>
54
+ <body class="bg-gray-100 font-sans">
55
+ <!-- Navigation -->
56
+ <nav class="gradient-bg text-white shadow-lg">
57
+ <div class="container mx-auto px-4 py-3 flex justify-between items-center">
58
+ <div class="flex items-center space-x-2">
59
+ <i class="fas fa-video text-2xl"></i>
60
+ <span class="text-xl font-bold">ConnectMe</span>
61
+ </div>
62
+ <div class="hidden md:flex space-x-6">
63
+ <a href="#" class="hover:text-gray-200">Home</a>
64
+ <a href="#" class="hover:text-gray-200">About</a>
65
+ <a href="#" class="hover:text-gray-200">Safety</a>
66
+ <a href="#" class="hover:text-gray-200">Contact</a>
67
+ </div>
68
+ <div class="flex items-center space-x-4">
69
+ <button id="loginBtn" class="px-4 py-2 rounded-full bg-white text-indigo-600 font-semibold hover:bg-gray-100 transition">Login</button>
70
+ <button id="signupBtn" class="px-4 py-2 rounded-full border-2 border-white text-white font-semibold hover:bg-white hover:text-indigo-600 transition">Sign Up</button>
71
+ <button class="md:hidden text-white">
72
+ <i class="fas fa-bars text-2xl"></i>
73
+ </button>
74
+ </div>
75
+ </div>
76
+ </nav>
77
+
78
+ <!-- Hero Section -->
79
+ <section class="gradient-bg text-white py-16">
80
+ <div class="container mx-auto px-4 text-center">
81
+ <h1 class="text-4xl md:text-6xl font-bold mb-6">Meet New People Instantly</h1>
82
+ <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">Connect with random people from around the world through live video chat. No registration required to start!</p>
83
+ <div class="flex flex-col md:flex-row justify-center space-y-4 md:space-y-0 md:space-x-4">
84
+ <button id="startChatBtn" class="px-8 py-4 bg-white text-indigo-600 rounded-full text-xl font-bold hover:bg-gray-100 transition transform hover:scale-105">Start Chatting Now</button>
85
+ <button class="px-8 py-4 border-2 border-white rounded-full text-xl font-bold hover:bg-white hover:text-indigo-600 transition transform hover:scale-105">How It Works</button>
86
+ </div>
87
+ </div>
88
+ </section>
89
+
90
+ <!-- Features Section -->
91
+ <section class="py-16 bg-white">
92
+ <div class="container mx-auto px-4">
93
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Why Choose ConnectMe?</h2>
94
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
95
+ <div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition">
96
+ <div class="text-indigo-600 mb-4">
97
+ <i class="fas fa-globe text-4xl"></i>
98
+ </div>
99
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Global Connections</h3>
100
+ <p class="text-gray-600">Meet people from all over the world and learn about different cultures.</p>
101
+ </div>
102
+ <div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition">
103
+ <div class="text-indigo-600 mb-4">
104
+ <i class="fas fa-shield-alt text-4xl"></i>
105
+ </div>
106
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Safe & Secure</h3>
107
+ <p class="text-gray-600">Our advanced moderation system keeps the platform safe for everyone.</p>
108
+ </div>
109
+ <div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition">
110
+ <div class="text-indigo-600 mb-4">
111
+ <i class="fas fa-random text-4xl"></i>
112
+ </div>
113
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Instant Matching</h3>
114
+ <p class="text-gray-600">Get connected with random people in seconds with just one click.</p>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ </section>
119
+
120
+ <!-- Chat Demo Section -->
121
+ <section class="py-16 bg-gray-100">
122
+ <div class="container mx-auto px-4">
123
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">How It Works</h2>
124
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden max-w-4xl mx-auto">
125
+ <div class="video-container">
126
+ <div class="absolute inset-0 bg-gray-800 flex items-center justify-center">
127
+ <div class="text-center text-white">
128
+ <i class="fas fa-user-circle text-8xl mb-4"></i>
129
+ <p class="text-xl">Connecting you with a random stranger...</p>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ <div class="p-6">
134
+ <div class="flex justify-center space-x-4">
135
+ <button class="px-6 py-3 bg-indigo-600 text-white rounded-full font-semibold hover:bg-indigo-700 transition">
136
+ <i class="fas fa-random mr-2"></i> Next Person
137
+ </button>
138
+ <button class="px-6 py-3 bg-red-600 text-white rounded-full font-semibold hover:bg-red-700 transition">
139
+ <i class="fas fa-times mr-2"></i> Disconnect
140
+ </button>
141
+ <button class="px-6 py-3 bg-green-600 text-white rounded-full font-semibold hover:bg-green-700 transition">
142
+ <i class="fas fa-heart mr-2"></i> Add Friend
143
+ </button>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ </section>
149
+
150
+ <!-- Login Modal -->
151
+ <div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
152
+ <div class="bg-white rounded-xl shadow-2xl w-full max-w-md overflow-hidden">
153
+ <div class="gradient-bg p-6 text-white">
154
+ <h2 class="text-2xl font-bold">Welcome Back!</h2>
155
+ <p>Login to access all features</p>
156
+ </div>
157
+ <div class="p-6">
158
+ <form id="loginForm" class="space-y-6">
159
+ <div class="relative">
160
+ <input type="email" id="loginEmail" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
161
+ <label for="loginEmail" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Email Address</label>
162
+ </div>
163
+ <div class="relative">
164
+ <input type="password" id="loginPassword" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
165
+ <label for="loginPassword" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Password</label>
166
+ </div>
167
+ <div class="flex justify-between items-center">
168
+ <div class="flex items-center">
169
+ <input type="checkbox" id="rememberMe" class="mr-2">
170
+ <label for="rememberMe" class="text-gray-600">Remember me</label>
171
+ </div>
172
+ <a href="#" class="text-indigo-600 hover:underline">Forgot password?</a>
173
+ </div>
174
+ <button type="submit" class="w-full py-3 bg-indigo-600 text-white rounded-lg font-semibold hover:bg-indigo-700 transition">Login</button>
175
+ </form>
176
+ <div class="mt-6 text-center">
177
+ <p class="text-gray-600">Don't have an account? <button id="switchToSignup" class="text-indigo-600 font-semibold hover:underline">Sign up</button></p>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ <!-- Signup Modal -->
184
+ <div id="signupModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
185
+ <div class="bg-white rounded-xl shadow-2xl w-full max-w-md overflow-hidden">
186
+ <div class="gradient-bg p-6 text-white">
187
+ <h2 class="text-2xl font-bold">Create Your Account</h2>
188
+ <p>Join our community today</p>
189
+ </div>
190
+ <div class="p-6">
191
+ <form id="signupForm" class="space-y-6">
192
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
193
+ <div class="relative">
194
+ <input type="text" id="firstName" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
195
+ <label for="firstName" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">First Name</label>
196
+ </div>
197
+ <div class="relative">
198
+ <input type="text" id="lastName" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
199
+ <label for="lastName" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Last Name</label>
200
+ </div>
201
+ </div>
202
+ <div class="relative">
203
+ <input type="text" id="username" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
204
+ <label for="username" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Username</label>
205
+ </div>
206
+ <div class="relative">
207
+ <input type="email" id="signupEmail" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
208
+ <label for="signupEmail" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Email Address</label>
209
+ </div>
210
+ <div class="relative">
211
+ <input type="password" id="signupPassword" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
212
+ <label for="signupPassword" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Password</label>
213
+ </div>
214
+ <div class="relative">
215
+ <input type="password" id="confirmPassword" class="floating-input w-full px-4 py-2 border-b-2 border-gray-300 focus:border-indigo-600 outline-none" placeholder=" " required>
216
+ <label for="confirmPassword" class="absolute left-4 top-2 text-gray-500 pointer-events-none transition-all">Confirm Password</label>
217
+ </div>
218
+ <div class="flex items-center">
219
+ <input type="checkbox" id="terms" class="mr-2" required>
220
+ <label for="terms" class="text-gray-600">I agree to the <a href="#" class="text-indigo-600 hover:underline">Terms of Service</a> and <a href="#" class="text-indigo-600 hover:underline">Privacy Policy</a></label>
221
+ </div>
222
+ <button type="submit" class="w-full py-3 bg-indigo-600 text-white rounded-lg font-semibold hover:bg-indigo-700 transition">Sign Up</button>
223
+ </form>
224
+ <div class="mt-6 text-center">
225
+ <p class="text-gray-600">Already have an account? <button id="switchToLogin" class="text-indigo-600 font-semibold hover:underline">Login</button></p>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ </div>
230
+
231
+ <!-- Chat Interface (Hidden by default) -->
232
+ <div id="chatInterface" class="hidden fixed inset-0 bg-gray-900 z-50">
233
+ <div class="chat-container flex flex-col">
234
+ <!-- Video Area -->
235
+ <div class="flex-1 flex">
236
+ <div class="w-1/2 bg-gray-800 relative">
237
+ <video id="localVideo" autoplay muted class="w-full h-full object-cover"></video>
238
+ <div class="absolute bottom-4 left-4 bg-black bg-opacity-50 text-white px-3 py-1 rounded-full">
239
+ <span id="localUsername">You</span>
240
+ </div>
241
+ </div>
242
+ <div class="w-1/2 bg-gray-800 relative">
243
+ <div id="remoteVideoPlaceholder" class="absolute inset-0 bg-gray-700 flex items-center justify-center">
244
+ <div class="text-center text-white">
245
+ <i class="fas fa-user-circle text-8xl mb-4"></i>
246
+ <p class="text-xl">Looking for someone to connect with...</p>
247
+ </div>
248
+ </div>
249
+ <video id="remoteVideo" autoplay class="w-full h-full object-cover hidden"></video>
250
+ <div id="remoteUsernameTag" class="absolute bottom-4 left-4 bg-black bg-opacity-50 text-white px-3 py-1 rounded-full hidden">
251
+ <span id="remoteUsername">Stranger</span>
252
+ </div>
253
+ </div>
254
+ </div>
255
+
256
+ <!-- Controls -->
257
+ <div class="bg-gray-800 p-4 flex justify-center space-x-6">
258
+ <button id="nextBtn" class="bg-indigo-600 hover:bg-indigo-700 text-white rounded-full w-12 h-12 flex items-center justify-center">
259
+ <i class="fas fa-random text-xl"></i>
260
+ </button>
261
+ <button id="disconnectBtn" class="bg-red-600 hover:bg-red-700 text-white rounded-full w-12 h-12 flex items-center justify-center">
262
+ <i class="fas fa-times text-xl"></i>
263
+ </button>
264
+ <button id="micBtn" class="bg-gray-600 hover:bg-gray-700 text-white rounded-full w-12 h-12 flex items-center justify-center">
265
+ <i class="fas fa-microphone text-xl"></i>
266
+ </button>
267
+ <button id="camBtn" class="bg-gray-600 hover:bg-gray-700 text-white rounded-full w-12 h-12 flex items-center justify-center">
268
+ <i class="fas fa-video text-xl"></i>
269
+ </button>
270
+ <button id="reportBtn" class="bg-yellow-600 hover:bg-yellow-700 text-white rounded-full w-12 h-12 flex items-center justify-center">
271
+ <i class="fas fa-flag text-xl"></i>
272
+ </button>
273
+ </div>
274
+
275
+ <!-- Chat Box -->
276
+ <div class="bg-gray-700 p-4 hidden" id="textChatContainer">
277
+ <div class="h-40 overflow-y-auto mb-4" id="chatMessages">
278
+ <!-- Messages will appear here -->
279
+ </div>
280
+ <div class="flex">
281
+ <input type="text" id="chatInput" placeholder="Type your message..." class="flex-1 px-4 py-2 rounded-l-lg focus:outline-none">
282
+ <button id="sendBtn" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-r-lg">
283
+ <i class="fas fa-paper-plane"></i>
284
+ </button>
285
+ </div>
286
+ </div>
287
+ </div>
288
+ </div>
289
+
290
+ <!-- Footer -->
291
+ <footer class="bg-gray-800 text-white py-8">
292
+ <div class="container mx-auto px-4">
293
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
294
+ <div>
295
+ <h3 class="text-xl font-bold mb-4">ConnectMe</h3>
296
+ <p class="text-gray-400">The best way to meet new people from around the world through live video chat.</p>
297
+ </div>
298
+ <div>
299
+ <h4 class="font-bold mb-4">Quick Links</h4>
300
+ <ul class="space-y-2">
301
+ <li><a href="#" class="text-gray-400 hover:text-white">Home</a></li>
302
+ <li><a href="#" class="text-gray-400 hover:text-white">About Us</a></li>
303
+ <li><a href="#" class="text-gray-400 hover:text-white">Safety Tips</a></li>
304
+ <li><a href="#" class="text-gray-400 hover:text-white">Community Guidelines</a></li>
305
+ </ul>
306
+ </div>
307
+ <div>
308
+ <h4 class="font-bold mb-4">Legal</h4>
309
+ <ul class="space-y-2">
310
+ <li><a href="#" class="text-gray-400 hover:text-white">Terms of Service</a></li>
311
+ <li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li>
312
+ <li><a href="#" class="text-gray-400 hover:text-white">Cookie Policy</a></li>
313
+ </ul>
314
+ </div>
315
+ <div>
316
+ <h4 class="font-bold mb-4">Connect With Us</h4>
317
+ <div class="flex space-x-4">
318
+ <a href="#" class="text-gray-400 hover:text-white text-2xl"><i class="fab fa-facebook"></i></a>
319
+ <a href="#" class="text-gray-400 hover:text-white text-2xl"><i class="fab fa-twitter"></i></a>
320
+ <a href="#" class="text-gray-400 hover:text-white text-2xl"><i class="fab fa-instagram"></i></a>
321
+ <a href="#" class="text-gray-400 hover:text-white text-2xl"><i class="fab fa-tiktok"></i></a>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400">
326
+ <p>&copy; 2023 ConnectMe. All rights reserved.</p>
327
+ </div>
328
+ </div>
329
+ </footer>
330
+
331
+ <script>
332
+ // DOM Elements
333
+ const loginBtn = document.getElementById('loginBtn');
334
+ const signupBtn = document.getElementById('signupBtn');
335
+ const loginModal = document.getElementById('loginModal');
336
+ const signupModal = document.getElementById('signupModal');
337
+ const switchToSignup = document.getElementById('switchToSignup');
338
+ const switchToLogin = document.getElementById('switchToLogin');
339
+ const startChatBtn = document.getElementById('startChatBtn');
340
+ const chatInterface = document.getElementById('chatInterface');
341
+ const disconnectBtn = document.getElementById('disconnectBtn');
342
+ const nextBtn = document.getElementById('nextBtn');
343
+ const micBtn = document.getElementById('micBtn');
344
+ const camBtn = document.getElementById('camBtn');
345
+ const reportBtn = document.getElementById('reportBtn');
346
+ const chatInput = document.getElementById('chatInput');
347
+ const sendBtn = document.getElementById('sendBtn');
348
+ const chatMessages = document.getElementById('chatMessages');
349
+ const textChatContainer = document.getElementById('textChatContainer');
350
+ const remoteVideo = document.getElementById('remoteVideo');
351
+ const remoteVideoPlaceholder = document.getElementById('remoteVideoPlaceholder');
352
+ const remoteUsernameTag = document.getElementById('remoteUsernameTag');
353
+ const localVideo = document.getElementById('localVideo');
354
+
355
+ // Modal toggle functions
356
+ function openLoginModal() {
357
+ loginModal.classList.remove('hidden');
358
+ signupModal.classList.add('hidden');
359
+ }
360
+
361
+ function openSignupModal() {
362
+ signupModal.classList.remove('hidden');
363
+ loginModal.classList.add('hidden');
364
+ }
365
+
366
+ function closeModals() {
367
+ loginModal.classList.add('hidden');
368
+ signupModal.classList.add('hidden');
369
+ }
370
+
371
+ // Event Listeners
372
+ loginBtn.addEventListener('click', openLoginModal);
373
+ signupBtn.addEventListener('click', openSignupModal);
374
+ switchToSignup.addEventListener('click', openSignupModal);
375
+ switchToLogin.addEventListener('click', openLoginModal);
376
+
377
+ // Close modals when clicking outside
378
+ window.addEventListener('click', (e) => {
379
+ if (e.target === loginModal || e.target === signupModal) {
380
+ closeModals();
381
+ }
382
+ });
383
+
384
+ // Form submission
385
+ document.getElementById('loginForm').addEventListener('submit', (e) => {
386
+ e.preventDefault();
387
+ // Here you would normally validate and send to server
388
+ alert('Login functionality would be implemented here');
389
+ closeModals();
390
+ });
391
+
392
+ document.getElementById('signupForm').addEventListener('submit', (e) => {
393
+ e.preventDefault();
394
+ // Validate passwords match
395
+ const password = document.getElementById('signupPassword').value;
396
+ const confirmPassword = document.getElementById('confirmPassword').value;
397
+
398
+ if (password !== confirmPassword) {
399
+ document.getElementById('signupForm').classList.add('shake');
400
+ setTimeout(() => {
401
+ document.getElementById('signupForm').classList.remove('shake');
402
+ }, 500);
403
+ alert('Passwords do not match!');
404
+ return;
405
+ }
406
+
407
+ // Here you would normally validate and send to server
408
+ alert('Signup functionality would be implemented here');
409
+ closeModals();
410
+ });
411
+
412
+ // Chat functionality
413
+ startChatBtn.addEventListener('click', () => {
414
+ // In a real app, this would check if user is logged in first
415
+ chatInterface.classList.remove('hidden');
416
+ document.body.style.overflow = 'hidden';
417
+
418
+ // Simulate getting user media
419
+ navigator.mediaDevices.getUserMedia({ video: true, audio: true })
420
+ .then(stream => {
421
+ localVideo.srcObject = stream;
422
+
423
+ // Simulate connecting to a stranger after 2 seconds
424
+ setTimeout(() => {
425
+ remoteVideoPlaceholder.classList.add('hidden');
426
+ remoteVideo.classList.remove('hidden');
427
+ remoteUsernameTag.classList.remove('hidden');
428
+ textChatContainer.classList.remove('hidden');
429
+
430
+ // Simulate receiving a message
431
+ setTimeout(() => {
432
+ addMessage('Stranger', 'Hi there! How are you today?', false);
433
+ }, 1000);
434
+ }, 2000);
435
+ })
436
+ .catch(err => {
437
+ console.error('Error accessing media devices:', err);
438
+ alert('Could not access your camera/microphone. Please check permissions.');
439
+ });
440
+ });
441
+
442
+ disconnectBtn.addEventListener('click', () => {
443
+ // Stop all media streams
444
+ if (localVideo.srcObject) {
445
+ localVideo.srcObject.getTracks().forEach(track => track.stop());
446
+ }
447
+ if (remoteVideo.srcObject) {
448
+ remoteVideo.srcObject.getTracks().forEach(track => track.stop());
449
+ }
450
+
451
+ chatInterface.classList.add('hidden');
452
+ document.body.style.overflow = 'auto';
453
+
454
+ // Reset video elements
455
+ remoteVideoPlaceholder.classList.remove('hidden');
456
+ remoteVideo.classList.add('hidden');
457
+ remoteUsernameTag.classList.add('hidden');
458
+ textChatContainer.classList.add('hidden');
459
+ chatMessages.innerHTML = '';
460
+ });
461
+
462
+ nextBtn.addEventListener('click', () => {
463
+ // Simulate connecting to a new stranger
464
+ remoteVideoPlaceholder.classList.remove('hidden');
465
+ remoteVideo.classList.add('hidden');
466
+ remoteUsernameTag.classList.add('hidden');
467
+ chatMessages.innerHTML = '';
468
+
469
+ setTimeout(() => {
470
+ remoteVideoPlaceholder.classList.add('hidden');
471
+ remoteVideo.classList.remove('hidden');
472
+ remoteUsernameTag.classList.remove('hidden');
473
+
474
+ // Simulate receiving a message
475
+ setTimeout(() => {
476
+ addMessage('New Stranger', 'Hello! Nice to meet you!', false);
477
+ }, 1000);
478
+ }, 1500);
479
+ });
480
+
481
+ let micOn = true;
482
+ micBtn.addEventListener('click', () => {
483
+ micOn = !micOn;
484
+ if (localVideo.srcObject) {
485
+ localVideo.srcObject.getAudioTracks()[0].enabled = micOn;
486
+ }
487
+ micBtn.innerHTML = micOn ? '<i class="fas fa-microphone text-xl"></i>' : '<i class="fas fa-microphone-slash text-xl"></i>';
488
+ micBtn.classList.toggle('bg-gray-600');
489
+ micBtn.classList.toggle('bg-red-600');
490
+ });
491
+
492
+ let camOn = true;
493
+ camBtn.addEventListener('click', () => {
494
+ camOn = !camOn;
495
+ if (localVideo.srcObject) {
496
+ localVideo.srcObject.getVideoTracks()[0].enabled = camOn;
497
+ }
498
+ camBtn.innerHTML = camOn ? '<i class="fas fa-video text-xl"></i>' : '<i class="fas fa-video-slash text-xl"></i>';
499
+ camBtn.classList.toggle('bg-gray-600');
500
+ camBtn.classList.toggle('bg-red-600');
501
+ });
502
+
503
+ reportBtn.addEventListener('click', () => {
504
+ alert('Report functionality would be implemented here');
505
+ });
506
+
507
+ function addMessage(sender, message, isLocal) {
508
+ const messageDiv = document.createElement('div');
509
+ messageDiv.classList.add('mb-2');
510
+
511
+ const senderSpan = document.createElement('span');
512
+ senderSpan.classList.add('font-bold', isLocal ? 'text-indigo-400' : 'text-green-400');
513
+ senderSpan.textContent = sender + ': ';
514
+
515
+ const messageSpan = document.createElement('span');
516
+ messageSpan.classList.add('text-white');
517
+ messageSpan.textContent = message;
518
+
519
+ messageDiv.appendChild(senderSpan);
520
+ messageDiv.appendChild(messageSpan);
521
+ chatMessages.appendChild(messageDiv);
522
+
523
+ // Scroll to bottom
524
+ chatMessages.scrollTop = chatMessages.scrollHeight;
525
+ }
526
+
527
+ sendBtn.addEventListener('click', () => {
528
+ const message = chatInput.value.trim();
529
+ if (message) {
530
+ addMessage('You', message, true);
531
+ chatInput.value = '';
532
+
533
+ // Simulate response after 1 second
534
+ setTimeout(() => {
535
+ const responses = [
536
+ "That's interesting!",
537
+ "Tell me more about that.",
538
+ "I see what you mean.",
539
+ "Nice weather today, isn't it?",
540
+ "Where are you from?",
541
+ "What do you like to do for fun?"
542
+ ];
543
+ const randomResponse = responses[Math.floor(Math.random() * responses.length)];
544
+ addMessage('Stranger', randomResponse, false);
545
+ }, 1000);
546
+ }
547
+ });
548
+
549
+ chatInput.addEventListener('keypress', (e) => {
550
+ if (e.key === 'Enter') {
551
+ sendBtn.click();
552
+ }
553
+ });
554
+ </script>
555
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=MMD-Coder/connectme" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
556
+ </html>