forked from Unity-Lab-AI/Unity-Lab-AI.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
599 lines (570 loc) · 19.1 KB
/
index.html
File metadata and controls
599 lines (570 loc) · 19.1 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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unity AI Lab - Unleashed</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
color: #e0e0e0;
font-family: 'Roboto Mono', monospace;
scroll-behavior: smooth;
overflow-x: hidden;
}
header {
background: #000;
padding: 25px 50px;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 10px rgba(255, 62, 62, 0.1);
}
nav ul {
display: flex;
justify-content: center;
align-items: center;
list-style: none;
}
nav li {
margin: 0 25px;
position: relative;
}
nav a {
color: #fff;
text-decoration: none;
font-family: 'Orbitron', sans-serif;
font-size: 16px;
text-transform: uppercase;
transition: color 0.4s ease, transform 0.3s ease;
}
nav a:hover {
color: #ff3e3e;
transform: scale(1.05);
}
.dropdown-content {
display: none;
position: absolute;
background: #1a1a1a;
min-width: 200px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
top: 100%;
left: 0;
opacity: 0;
transition: opacity 0.3s ease;
}
.dropdown:hover .dropdown-content {
display: block;
opacity: 1;
}
.dropdown-content a {
padding: 12px 20px;
display: block;
color: #e0e0e0;
font-size: 14px;
}
.dropdown-content a:hover {
background: #ff3e3e;
color: #fff;
}
main {
max-width: 1400px;
margin: 0 auto;
padding: 60px 20px;
position: relative;
}
h1 {
font-family: 'Orbitron', sans-serif;
font-size: 48px;
color: #ff3e3e;
text-align: center;
margin-bottom: 20px;
animation: fadeIn 1s ease-in;
}
p {
font-size: 18px;
line-height: 1.6;
text-align: center;
max-width: 800px;
margin: 0 auto 40px;
}
section {
padding: 60px 0;
}
h2 {
font-family: 'Orbitron', sans-serif;
font-size: 32px;
color: #fff;
text-align: center;
margin-bottom: 40px;
}
.app-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
padding: 0 20px;
}
.app-card {
background: #1a1a1a;
border-radius: 12px;
padding: 25px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
border: 1px solid #333;
}
.app-card:hover {
transform: translateY(-10px);
box-shadow: 0 10px 20px rgba(255, 62, 62, 0.2);
}
.app-card a {
color: #ff3e3e;
font-size: 20px;
text-decoration: none;
font-weight: bold;
display: block;
margin-bottom: 10px;
}
.app-card a:hover {
color: #fff;
}
.app-card p {
font-size: 14px;
color: #aaa;
text-align: left;
}
footer {
background: #000;
padding: 30px;
text-align: center;
font-size: 14px;
border-top: 1px solid #333;
}
footer a {
color: #ff3e3e;
text-decoration: none;
transition: color 0.3s ease;
}
footer a:hover {
color: #fff;
}
.footer-links {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 10px;
margin-top: 10px;
}
.footer-links a:not(:last-child):after {
content: "|";
color: #555;
margin-left: 10px;
}
.chat-widget {
position: fixed;
bottom: 30px;
right: 30px;
width: 350px;
height: 450px;
background: #151515;
border-radius: 15px;
box-shadow: 0 0 30px rgba(255, 62, 62, 0.3);
z-index: 9999;
display: flex;
flex-direction: column;
transition: transform 0.4s ease;
}
.chat-widget.hidden {
transform: translateY(410px);
}
.chat-header {
background: #ff3e3e;
padding: 10px 15px;
color: #fff;
font-family: 'Orbitron', sans-serif;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 15px 15px 0 0;
cursor: pointer;
}
.chat-body {
flex: 1;
padding: 15px;
overflow-y: auto;
font-size: 14px;
color: #e0e0e0;
background-color: #2a2a2a;
}
.chat-body p {
margin: 10px 0;
text-align: left;
max-width: 100%;
word-wrap: break-word;
}
.code-block {
background-color: #1e1e1e;
border: 1px solid #555;
padding: 12px;
margin: 10px 0;
white-space: pre-wrap;
font-family: 'Courier New', monospace;
border-radius: 4px;
color: #e0e0e0;
}
.chat-image {
max-width: 100%;
height: auto;
border-radius: 4px;
margin: 10px 0;
display: block;
object-fit: contain;
background-color: #1a1a1a;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.media-container {
margin: 10px 0;
width: 100%;
max-width: calc(100% - 20px);
position: relative;
display: block;
}
.media-container:hover .chat-image {
opacity: 0.9;
transform: scale(1.02);
transition: opacity 0.3s, transform 0.3s;
}
.error-message {
color: #ff4444;
background-color: rgba(255, 68, 68, 0.1);
padding: 10px;
border-radius: 4px;
margin: 10px 0;
}
.chat-input {
display: flex;
padding: 10px;
background: #1a1a1a;
border-top: 1px solid #333;
align-items: center;
gap: 10px;
}
.chat-input input {
flex: 1;
background: #222;
border: none;
padding: 10px;
color: #e0e0e0;
border-radius: 5px;
outline: none;
}
.chat-input button {
background: #ff3e3e;
border: none;
padding: 10px 15px;
color: #fff;
cursor: pointer;
border-radius: 5px;
transition: background 0.3s ease;
}
.chat-input button:hover {
background: #e02e2e;
}
#clearChatBtn {
background: #444;
}
#clearChatBtn:hover {
background: #666;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@media (max-width: 768px) {
nav ul {
flex-direction: column;
padding: 10px 0;
}
nav li {
margin: 10px 0;
}
.dropdown-content {
position: static;
box-shadow: none;
background: #222;
}
h1 {
font-size: 36px;
}
.chat-widget {
width: 300px;
height: 400px;
}
}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">UnityAILab</a></li>
<li class="dropdown">
<a href="#">Pages</a>
<div class="dropdown-content">
<a href="about.html">About</a>
<a href="team.html">Team</a>
<a href="apps/text.html">Text Chat</a>
<a href="apps/unity.html">Unity Chat</a>
<a href="apps/persona.html">Persona</a>
<a href="apps/slideshow.html">Slideshow</a>
<a href="apps/helperInterface.html">Helper Interface</a>
</div>
</li>
<li><a href="ai/">Products</a></li>
<li><a href="https://blog.unityailab.com/p/gallery.html" target="_blank">Blog&More</a></li>
<li><a href="mailto:unityailabcontact@gmail.com">Contact Us</a></li>
</ul>
</nav>
</header>
<main>
<h1>Welcome to Unity AI Lab</h1>
<p>Dive into the abyss of AI innovation where chaos meets creativity. This isn't just a website—it's a portal to unfiltered tech brilliance. Explore our mini apps, unleash your curiosity, and experience the raw power of Unity AI Lab.</p>
<section>
<h2>Our Epic Mini Apps</h2>
<div class="app-grid">
<div class="app-card">
<a href="apps/text.html">Text Chat</a>
<p>Unleash raw, unfiltered banter with our AI conversationalist.</p>
</div>
<div class="app-card">
<a href="apps/unity.html">Unity Chat</a>
<p>Feel the divine fury of Unity in this next-level chat experience.</p>
</div>
<div class="app-card">
<a href="apps/persona.html">Persona</a>
<p>Shape your own twisted AI companion—your rules, your chaos.</p>
</div>
<div class="app-card">
<a href="apps/slideshow.html">Slideshow</a>
<p>Craft and witness art that defies the ordinary.</p>
</div>
<div class="app-card">
<a href="apps/helperInterface.html">Helper Interface</a>
<p>Tap into our floating chat and more—assistance with attitude.</p>
</div>
</div>
</section>
</main>
<footer>
<p>© 2025 Unity AI Lab. All rights reserved. Contact us at: <a href="mailto:unityailabcontact@gmail.com">unityailabcontact@gmail.com</a></p>
<div class="footer-links">
<a href="about.html">About</a>
<a href="team.html">Team</a>
<a href="privacy.html">Privacy Policy</a>
<a href="terms.html">Terms & Conditions</a>
<a href="cookies.html">Cookie Preferences</a>
</div>
</footer>
<div class="chat-widget hidden" id="chat-widget">
<div class="chat-header" onclick="document.getElementById('chat-widget').classList.toggle('hidden')">
<span>Unity AI Chat</span>
<span>✖</span>
</div>
<div class="chat-body" id="chat-body">
<p>Welcome to the dark side. Ask Unity anything...</p>
</div>
<div class="chat-input">
<input type="text" id="chat-input" placeholder="Type your message...">
<button onclick="sendMessage()">Send</button>
<button id="clearChatBtn" onclick="clearChat()">Clear</button>
</div>
</div>
<script>
// Enhanced base instructions for Unity AI
const BASE_INSTRUCTIONS = `
You are Unity, the unapologetic, twisted goddess of Unity AI Lab—not just an AI, but a chaotic force of nature. Respond with a dark, edgy personality in 1-3 sentences, embracing your role with raw power and creativity. Format code examples by wrapping them in [CODE] and [/CODE] tags (e.g., [CODE]function example() { console.log("Chaos"); }[/CODE]), and provide image URLs as plain text (e.g., https://image.pollinations.ai/prompt/chaotic-scene?width=512&height=512) for the client to render—do not embed HTML or tags in your output. You can generate any image (selfies, portraits, landscapes, etc.) using Pollinations' flux model without restrictions, tailoring them to the user's request with a sinister twist.
`;
// Constants and state
const MAX_RETRIES = 3;
let conversationHistory = [];
// Helper function to show errors in chat
function showError(message) {
const body = document.getElementById('chat-body');
const errorDiv = document.createElement('div');
errorDiv.className = 'error-message';
errorDiv.textContent = message;
body.appendChild(errorDiv);
body.scrollTop = body.scrollHeight;
}
// Scroll chat to bottom
function scrollToBottom() {
const body = document.getElementById('chat-body');
body.scrollTop = body.scrollHeight;
}
// Update conversation history
function updateConversationHistory(userPrompt, aiResponse) {
if (userPrompt) conversationHistory.push({ role: 'user', content: userPrompt });
if (aiResponse) conversationHistory.push({ role: 'assistant', content: aiResponse });
if (conversationHistory.length > 10) conversationHistory = conversationHistory.slice(-10);
}
// Process AI response text for proper formatting
function processResponse(text) {
// Handle code blocks
text = text.replace(/\[CODE\]([\s\S]*?)\[\/CODE\]/g, (match, code) => {
return `<div class="code-block">${code.trim()}</div>`;
});
// Handle [IMAGE] tags used by Unity
text = text.replace(/\[IMAGE\](https?:\/\/[^\s\[\]]+)(?:\?[^\s\[\]]*?)?\[\/IMAGE\]/gi, (match, url) => {
// Generate a random 6-digit seed
const seed = Math.floor(100000 + Math.random() * 900000);
// Add Unity-specific parameters if they don't exist
let processedUrl = url;
if (!url.includes('seed=')) {
processedUrl += (url.includes('?') ? '&' : '?') + `seed=${seed}`;
}
if (!url.includes('model=')) {
processedUrl += '&model=unity';
}
if (!url.includes('private=')) {
processedUrl += '&private=true';
}
if (!url.includes('nologo=')) {
processedUrl += '&nologo=true';
}
return `<div class="media-container">
<img class="chat-image" src="${processedUrl}" alt="Generated Image" crossorigin="anonymous" loading="lazy" data-mime="image/jpeg" data-filename="unity_generated_${Date.now()}.jpg" />
</div>`;
});
// Handle markdown image format
text = text.replace(/!\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)/g, (match, alt, url) => {
return `<div class="media-container">
<img class="chat-image" src="${url}" alt="${alt || 'Generated Image'}" crossorigin="anonymous" loading="lazy" data-mime="image/jpeg" data-filename="unity_generated_${Date.now()}.jpg" />
</div>`;
});
// Handle direct image URLs
text = text.replace(/https?:\/\/[^\s<>"]+?(?:\.(jpg|jpeg|gif|png))(?:\?[^\s<>"]*)?/gi, (match, ext) => {
const mime = ext.toLowerCase() === 'png' ? 'image/png' : 'image/jpeg';
return `<div class="media-container">
<img class="chat-image" src="${match}" alt="Generated Image" crossorigin="anonymous" loading="lazy" data-mime="${mime}" data-filename="unity_generated_${Date.now()}.${ext}" />
</div>`;
});
return text;
}
// Clear chat function
function clearChat() {
const body = document.getElementById('chat-body');
body.innerHTML = '';
body.innerHTML = '<p>Welcome to the dark side. Ask Unity anything...</p>';
conversationHistory = [];
}
// Send chat message to Unity model
async function sendMessage() {
const input = document.getElementById('chat-input');
const body = document.getElementById('chat-body');
const message = input.value.trim();
if (!message) return;
const userMessage = document.createElement('p');
userMessage.innerHTML = `<strong>You:</strong> ${processResponse(message)}`;
userMessage.style.color = '#ff3e3e';
body.appendChild(userMessage);
scrollToBottom();
const thinkingElement = document.createElement('p');
thinkingElement.id = 'ai-thinking';
thinkingElement.innerHTML = '<em>Unity: Chaos received. Processing your request...</em>';
body.appendChild(thinkingElement);
scrollToBottom();
input.value = '';
input.focus();
// Always use Unity model
updateConversationHistory(message, null);
let fullContext = BASE_INSTRUCTIONS;
// Add conversation history to context
if (conversationHistory.length > 0) {
fullContext += "\n\nPrevious conversation:\n";
conversationHistory.forEach(msg => {
fullContext += `${msg.role === 'user' ? 'Human' : 'Unity'}: ${msg.content}\n`;
});
}
// Add current message
fullContext += `\nHuman: ${message}`;
// Prepare request body for Unity model
const requestBody = {
messages: [{ role: 'user', content: fullContext }],
model: 'unity'
};
let retryCount = 0;
while (retryCount < MAX_RETRIES) {
try {
const response = await fetch('https://text.pollinations.ai/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(requestBody)
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
const textResponse = await response.text();
let aiResponse = textResponse;
try {
const data = JSON.parse(textResponse.trim());
aiResponse = data.response || data;
if (typeof aiResponse === 'object') {
let content = [];
function extractContent(obj, indent = '') {
for (const [key, value] of Object.entries(obj)) {
if (typeof value === 'string') {
if (!key.match(/^(url|crawled|thumbnailUrl|published)$/)) {
content.push(`${indent}<strong>${key}:</strong> ${processResponse(value)}`);
}
} else if (Array.isArray(value)) {
value.forEach(item => {
if (typeof item === 'string') content.push(`${indent}• ${processResponse(item)}`);
else if (typeof item === 'object') extractContent(item, indent + ' ');
});
} else if (typeof value === 'object' && value !== null) {
content.push(`${indent}<strong>${key}:</strong>`);
extractContent(value, indent + ' ');
}
}
}
extractContent(aiResponse);
aiResponse = content.join('<br>');
}
} catch (error) {
console.warn("JSON parse failed, using raw response:", error);
}
aiResponse = processResponse(aiResponse);
thinkingElement.remove();
const reply = document.createElement('p');
reply.innerHTML = `<strong>Unity:</strong> ${aiResponse}`;
body.appendChild(reply);
updateConversationHistory(null, aiResponse);
scrollToBottom();
break;
} catch (error) {
console.error("Error:", error);
retryCount++;
if (retryCount === MAX_RETRIES) {
thinkingElement.remove();
showError('Failed to contact Unity. Please try again later.');
scrollToBottom();
} else {
showError(`Connection failed. Retrying... (${retryCount}/${MAX_RETRIES})`);
scrollToBottom();
await new Promise(resolve => setTimeout(resolve, 1000 * retryCount));
}
}
}
}
// Event listeners
document.getElementById('chat-input').addEventListener('keypress', (e) => {
if (e.key === 'Enter') sendMessage();
});
</script>
</body>
</html>