Spaces:
Running
Running
Update index.html
Browse files- index.html +345 -17
index.html
CHANGED
@@ -1,19 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!doctype html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
|
1 |
+
<!--
|
2 |
+
ZewAI-1.5-PRO — Super-Advanced Fake AI Frontend
|
3 |
+
Single-file HTML (open in browser). No backend required.
|
4 |
+
Features:
|
5 |
+
- Conversational UI with persona/model selector
|
6 |
+
- Fake "thinking" progress + typing animation
|
7 |
+
- Mock image generator (procedural canvas art)
|
8 |
+
- Voice output (SpeechSynthesis) for responses
|
9 |
+
- Settings, themes, logs, export conversation
|
10 |
+
- Download as .html button
|
11 |
+
|
12 |
+
This is intentionally a front-end simulation only — no real AI calls.
|
13 |
+
Feel free to edit the canned responses and behavior.
|
14 |
+
-->
|
15 |
+
|
16 |
<!doctype html>
|
17 |
+
<html lang="en">
|
18 |
+
<head>
|
19 |
+
<meta charset="utf-8" />
|
20 |
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
21 |
+
<title>ZewAI-1.5-PRO — Fake SuperAI</title>
|
22 |
+
<style>
|
23 |
+
:root{--bg:#0f1724;--panel:#0b1220;--accent:#7c3aed;--muted:#9aa4b2;--glass: rgba(255,255,255,0.03)}
|
24 |
+
*{box-sizing:border-box}
|
25 |
+
html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Roboto,'Helvetica Neue',Arial}
|
26 |
+
body{background:linear-gradient(180deg,#071021 0%, #071827 50%, #04101a 100%);color:#e6eef6}
|
27 |
+
.app{max-width:1100px;margin:28px auto;padding:20px;border-radius:14px;background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);box-shadow:0 6px 30px rgba(2,6,23,0.7)}
|
28 |
+
header{display:flex;gap:18px;align-items:center}
|
29 |
+
.logo{width:64px;height:64px;border-radius:12px;background:linear-gradient(135deg,var(--accent),#06b6d4);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px}
|
30 |
+
h1{margin:0;font-size:20px}
|
31 |
+
.meta{color:var(--muted);font-size:13px}
|
32 |
+
|
33 |
+
.main{display:grid;grid-template-columns:320px 1fr;gap:18px;margin-top:18px}
|
34 |
+
.sidebar{background:var(--panel);padding:14px;border-radius:12px;height:78vh;overflow:auto}
|
35 |
+
.controls label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px}
|
36 |
+
select,input[type=range],.btn{width:100%}
|
37 |
+
.btn{display:inline-block;padding:10px 12px;border-radius:8px;background:linear-gradient(90deg,var(--accent),#06b6d4);color:white;border:none;cursor:pointer}
|
38 |
+
.small{font-size:13px;padding:8px}
|
39 |
+
.chat-panel{background:var(--glass);padding:14px;border-radius:12px;height:78vh;display:flex;flex-direction:column}
|
40 |
+
.messages{flex:1;overflow:auto;padding-right:6px}
|
41 |
+
.message{margin:10px 0;display:flex;gap:10px}
|
42 |
+
.me{justify-content:flex-end}
|
43 |
+
.bubble{max-width:78%;padding:12px 14px;border-radius:12px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));box-shadow:0 1px 0 rgba(255,255,255,0.02)}
|
44 |
+
.bubble.me{background:linear-gradient(90deg,#1e293b,#0f1724);color:#cfe8ff}
|
45 |
+
.status{font-size:12px;color:var(--muted);margin-bottom:6px}
|
46 |
+
.composer{display:flex;gap:8px;margin-top:10px}
|
47 |
+
.composer textarea{flex:1;resize:none;padding:12px;border-radius:10px;border:1px solid rgba(255,255,255,0.03);background:transparent;color:inherit;min-height:60px}
|
48 |
+
.toolbar{display:flex;gap:8px;align-items:center}
|
49 |
+
.fake-image{width:220px;height:120px;border-radius:10px;background:#071827;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px}
|
50 |
+
.log{font-family:monospace;font-size:12px;color:var(--muted);margin-top:12px;white-space:pre-wrap}
|
51 |
+
|
52 |
+
footer{margin-top:12px;display:flex;justify-content:space-between;align-items:center}
|
53 |
+
.chip{display:inline-flex;gap:8px;align-items:center;padding:8px;border-radius:999px;background:rgba(255,255,255,0.02)}
|
54 |
+
|
55 |
+
/* typing caret */
|
56 |
+
.typing{display:inline-block;vertical-align:bottom;width:8px;height:12px;background:linear-gradient(180deg,#fff,#fff);margin-left:6px;border-radius:2px;animation:blink 1s steps(2) infinite}
|
57 |
+
@keyframes blink{50%{opacity:0}}
|
58 |
+
|
59 |
+
/* responsive */
|
60 |
+
@media (max-width:880px){.main{grid-template-columns:1fr;}.sidebar{order:2;height:240px}.chat-panel{order:1;height:60vh}}
|
61 |
+
</style>
|
62 |
+
</head>
|
63 |
+
<body>
|
64 |
+
<div class="app" role="application" aria-label="ZewAI 1.5 PRO simulator">
|
65 |
+
<header>
|
66 |
+
<div class="logo">ZEW</div>
|
67 |
+
<div>
|
68 |
+
<h1>ZewAI-1.5-PRO <small style="color:var(--muted);font-weight:600;margin-left:8px">(Simulated)</small></h1>
|
69 |
+
<div class="meta">Super-advanced fake AI interface — locally simulated behaviors, no network calls.</div>
|
70 |
+
</div>
|
71 |
+
</header>
|
72 |
+
|
73 |
+
<div class="main">
|
74 |
+
<aside class="sidebar" role="region" aria-label="Controls">
|
75 |
+
<div class="controls">
|
76 |
+
<label>Model Persona</label>
|
77 |
+
<select id="persona">
|
78 |
+
<option value="oracle">Oracle — poetic & mystical</option>
|
79 |
+
<option value="professor">Professor — technical & precise</option>
|
80 |
+
<option value="friend">Friend — casual & funny</option>
|
81 |
+
<option value="ceo">CEO — short & decisive</option>
|
82 |
+
<option value="mystery">MYSTERY — unpredictable</option>
|
83 |
+
</select>
|
84 |
+
|
85 |
+
<label>Creativity</label>
|
86 |
+
<input id="creativity" type="range" min="0" max="100" value="40" />
|
87 |
+
|
88 |
+
<label>Response Length</label>
|
89 |
+
<select id="length">
|
90 |
+
<option value="short">Short</option>
|
91 |
+
<option value="medium" selected>Medium</option>
|
92 |
+
<option value="long">Long</option>
|
93 |
+
</select>
|
94 |
+
|
95 |
+
<label>Enable Voice Output</label>
|
96 |
+
<div style="display:flex;gap:8px;margin-top:6px"><button id="voiceToggle" class="btn small">Toggle Voice</button><div id="voiceState" class="chip">Off</div></div>
|
97 |
+
|
98 |
+
<hr style="margin:12px 0;border:none;border-top:1px solid rgba(255,255,255,0.03)" />
|
99 |
+
<label>Actions</label>
|
100 |
+
<div style="display:flex;gap:8px;margin-top:6px;flex-wrap:wrap">
|
101 |
+
<button id="genImage" class="btn small">Generate Fake Image</button>
|
102 |
+
<button id="exportHtml" class="btn small">Download .html</button>
|
103 |
+
<button id="clearChat" class="btn small" style="background:linear-gradient(90deg,#ef4444,#f97316)">Clear Chat</button>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<hr style="margin:12px 0;border:none;border-top:1px solid rgba(255,255,255,0.03)" />
|
107 |
+
<div class="fake-image" id="imagePreview">Procedural Image</div>
|
108 |
+
|
109 |
+
<div class="log" id="miniLog">System ready — ZewAI-1.5-PRO (simulation)</div>
|
110 |
+
</div>
|
111 |
+
</aside>
|
112 |
+
|
113 |
+
<section class="chat-panel" role="main">
|
114 |
+
<div class="status">Model: <span id="currentModel">Oracle</span> · Creativity: <span id="currentCreat">40</span> · Length: <span id="currentLen">Medium</span></div>
|
115 |
+
<div class="messages" id="messages" aria-live="polite"></div>
|
116 |
+
|
117 |
+
<div class="composer">
|
118 |
+
<textarea id="prompt" placeholder="Type your prompt to ZewAI-1.5-PRO... (try: 'Plan a tiny Mars mission')"></textarea>
|
119 |
+
<div style="display:flex;flex-direction:column;gap:8px">
|
120 |
+
<div class="toolbar">
|
121 |
+
<button id="sendBtn" class="btn">Send</button>
|
122 |
+
<button id="surprise" class="btn small">Surprise Me</button>
|
123 |
+
</div>
|
124 |
+
<div style="font-size:12px;color:var(--muted)">Tip: This frontend simulates different personalities and generates playful outputs locally.</div>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<footer>
|
129 |
+
<div class="chip">ZewAI-1.5-PRO Simulator</div>
|
130 |
+
<div style="font-size:12px;color:var(--muted)">Built with ❤️ for demo purposes</div>
|
131 |
+
</footer>
|
132 |
+
</section>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<script>
|
137 |
+
// ======= Utilities ========
|
138 |
+
const $ = id => document.getElementById(id);
|
139 |
+
const messages = $('messages');
|
140 |
+
const persona = $('persona');
|
141 |
+
const creativity = $('creativity');
|
142 |
+
const lengthSel = $('length');
|
143 |
+
const currentModel = $('currentModel');
|
144 |
+
const currentCreat = $('currentCreat');
|
145 |
+
const currentLen = $('currentLen');
|
146 |
+
const promptBox = $('prompt');
|
147 |
+
const voiceToggle = $('voiceToggle');
|
148 |
+
const voiceState = $('voiceState');
|
149 |
+
const miniLog = $('miniLog');
|
150 |
+
let voiceEnabled = false;
|
151 |
+
|
152 |
+
// canned fragments and behaviors
|
153 |
+
const FRAGMENTS = {
|
154 |
+
oracle: [
|
155 |
+
"In the quiet between stars, I sense possibilities.",
|
156 |
+
"The paths fold like paper; choose the crease you call home.",
|
157 |
+
"I weave small futures from the threads of your question."
|
158 |
+
],
|
159 |
+
professor: [
|
160 |
+
"Step 1: Define variables. Step 2: Iterate. Step 3: Test.",
|
161 |
+
"Based on commonly accepted models, the optimal approach is...",
|
162 |
+
"Consider edge cases: performance, safety, and reproducibility."
|
163 |
+
],
|
164 |
+
friend: [
|
165 |
+
"Haha, interesting — let's make it fun!",
|
166 |
+
"Okay buddy, here's what I'd do if I were you...",
|
167 |
+
"Noted. Also: snacks."
|
168 |
+
],
|
169 |
+
ceo: [
|
170 |
+
"Short plan: prioritize, delegate, measure.",
|
171 |
+
"We move fast, ship early, and iterate.",
|
172 |
+
"Focus on impact and ruthlessly remove distractions."
|
173 |
+
],
|
174 |
+
mystery: [
|
175 |
+
"..."]
|
176 |
+
};
|
177 |
+
|
178 |
+
const adjectives = ["lucid","stellar","radical","gentle","methodical","quirky","bold","subtle"];
|
179 |
+
|
180 |
+
function logMini(text){ miniLog.textContent = text }
|
181 |
+
|
182 |
+
// ======= Message helpers ========
|
183 |
+
function appendMessage(text, who='ai', meta=''){
|
184 |
+
const wrap = document.createElement('div');
|
185 |
+
wrap.className = 'message' + (who==='me' ? ' me' : '');
|
186 |
+
const bubble = document.createElement('div');
|
187 |
+
bubble.className = 'bubble' + (who==='me' ? ' me' : '');
|
188 |
+
bubble.innerHTML = text + (meta?`<div style="font-size:11px;color:var(--muted);margin-top:6px">${meta}</div>`:'');
|
189 |
+
wrap.appendChild(bubble);
|
190 |
+
messages.appendChild(wrap);
|
191 |
+
messages.scrollTop = messages.scrollHeight;
|
192 |
+
}
|
193 |
+
|
194 |
+
// typing animation
|
195 |
+
function typeText(targetEl, fullText, speed=20, onDone=null){
|
196 |
+
let i=0;
|
197 |
+
const node = document.createElement('span');
|
198 |
+
targetEl.appendChild(node);
|
199 |
+
const caret = document.createElement('span'); caret.className='typing'; targetEl.appendChild(caret);
|
200 |
+
const t = setInterval(()=>{
|
201 |
+
node.textContent = fullText.slice(0,i+1);
|
202 |
+
i++;
|
203 |
+
if(i>=fullText.length){ clearInterval(t); caret.remove(); if(onDone) onDone(); }
|
204 |
+
messages.scrollTop = messages.scrollHeight;
|
205 |
+
}, speed);
|
206 |
+
}
|
207 |
+
|
208 |
+
// generate fake response
|
209 |
+
function generateFakeResponse(prompt){
|
210 |
+
const pers = persona.value;
|
211 |
+
const creat = Number(creativity.value)/100;
|
212 |
+
const len = lengthSel.value; // short medium long
|
213 |
+
|
214 |
+
// base fragments
|
215 |
+
const pool = FRAGMENTS[pers] || [].concat(...Object.values(FRAGMENTS));
|
216 |
+
const pick = arr => arr[Math.floor(Math.random()*arr.length)];
|
217 |
+
const seed = pick(pool);
|
218 |
+
|
219 |
+
// craft variation based on creativity and length
|
220 |
+
let extra = '';
|
221 |
+
const adjCount = Math.round(creat*3);
|
222 |
+
for(let i=0;i<adjCount;i++) extra += ' ' + pick(adjectives);
|
223 |
+
|
224 |
+
// echo prompt-derived noun extraction (naive)
|
225 |
+
const nounMatch = prompt.match(/\b(planet|plan|code|mission|robot|image|song|idea|startup)\b/i);
|
226 |
+
const noun = nounMatch ? nounMatch[0] : 'concept';
|
227 |
+
|
228 |
+
let body = '';
|
229 |
+
if(len==='short') body = `${seed} ${extra}`;
|
230 |
+
else if(len==='medium') body = `${seed} I analysed your request about "${noun}" and propose: ${pick(['A concise plan','A simple mockup','A list of priorities','A starter prompt'])} — ${pick(['begin with research','prototype quickly','test frequently','keep it small'])}. ${extra}`;
|
231 |
+
else body = `${seed} Regarding "${noun}", imagine a sequence: 1) ${pick(['define scope','sketch architecture','build MVP','validate with users'])}; 2) ${pick(['iterate','scale','optimize','secure'])}; 3) ${pick(['measure outcomes','document decisions','handoff to team','prepare launch'])}. ${extra} If you want, I can expand any step.`;
|
232 |
+
|
233 |
+
// occasional unpredictability for mystery persona
|
234 |
+
if(pers==='mystery' && Math.random()>0.6) body += ' — the stars disagree.';
|
235 |
+
|
236 |
+
// small delay to simulate thinking
|
237 |
+
return body;
|
238 |
+
}
|
239 |
+
|
240 |
+
// main send flow
|
241 |
+
async function sendPrompt(){
|
242 |
+
const text = promptBox.value.trim();
|
243 |
+
if(!text) return;
|
244 |
+
appendMessage(escapeHtml(text), 'me');
|
245 |
+
promptBox.value = '';
|
246 |
+
// show thinking status
|
247 |
+
const statusId = 'status-'+Date.now();
|
248 |
+
appendMessage('<em>Processing your request...</em>', 'ai');
|
249 |
+
const lastBubble = messages.querySelectorAll('.bubble');
|
250 |
+
const aiBubble = lastBubble[lastBubble.length-1];
|
251 |
+
|
252 |
+
// fake progressive thinking indicator
|
253 |
+
const thinkingTimes = 1200 + Math.random()*1800 * (1 + (100-Number(creativity.value))/100);
|
254 |
+
logMini('Analyzing...');
|
255 |
+
|
256 |
+
await new Promise(r=>setTimeout(r, thinkingTimes));
|
257 |
+
|
258 |
+
// replace ai bubble with typed response
|
259 |
+
aiBubble.innerHTML = '';
|
260 |
+
const response = generateFakeResponse(text);
|
261 |
+
typeText(aiBubble, response, Math.max(8, 28 - Number(creativity.value)/4), ()=>{
|
262 |
+
logMini('Response delivered');
|
263 |
+
if(voiceEnabled) speak(response);
|
264 |
+
});
|
265 |
+
}
|
266 |
+
|
267 |
+
// simple HTML escape
|
268 |
+
function escapeHtml(s){ return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>') }
|
269 |
+
|
270 |
+
// ======= Fake image generator (procedural) ========
|
271 |
+
function generateProceduralImage(){
|
272 |
+
const canvas = document.createElement('canvas'); canvas.width=640; canvas.height=360;
|
273 |
+
const ctx = canvas.getContext('2d');
|
274 |
+
// background
|
275 |
+
ctx.fillStyle = '#061022'; ctx.fillRect(0,0,canvas.width,canvas.height);
|
276 |
+
// random gradient
|
277 |
+
const g = ctx.createLinearGradient(0,0,canvas.width,canvas.height);
|
278 |
+
g.addColorStop(0, randomColor()); g.addColorStop(1, randomColor()); ctx.fillStyle=g; ctx.globalAlpha=0.12; ctx.fillRect(0,0,canvas.width,canvas.height);
|
279 |
+
// draw random circles
|
280 |
+
for(let i=0;i<30;i++){
|
281 |
+
ctx.beginPath();
|
282 |
+
const x = Math.random()*canvas.width; const y = Math.random()*canvas.height; const r = 6+Math.random()*90;
|
283 |
+
ctx.fillStyle = randomColor(); ctx.globalAlpha=0.08 + Math.random()*0.22; ctx.arc(x,y,r,0,Math.PI*2); ctx.fill();
|
284 |
+
}
|
285 |
+
// draw some lines
|
286 |
+
ctx.globalAlpha=0.9; ctx.lineWidth=1.5;
|
287 |
+
for(let i=0;i<8;i++){
|
288 |
+
ctx.beginPath(); ctx.moveTo(Math.random()*canvas.width, Math.random()*canvas.height);
|
289 |
+
ctx.bezierCurveTo(Math.random()*canvas.width, Math.random()*canvas.height, Math.random()*canvas.width, Math.random()*canvas.height, Math.random()*canvas.width, Math.random()*canvas.height);
|
290 |
+
ctx.strokeStyle = randomColor(); ctx.stroke();
|
291 |
+
}
|
292 |
+
// starfield
|
293 |
+
for(let i=0;i<150;i++){ ctx.fillStyle='#fff'; ctx.globalAlpha=Math.random()*0.9; ctx.fillRect(Math.random()*canvas.width, Math.random()*canvas.height, Math.random()*2.2, Math.random()*2.2)}
|
294 |
+
|
295 |
+
// convert to dataURL and set preview
|
296 |
+
const data = canvas.toDataURL('image/png');
|
297 |
+
$('imagePreview').innerHTML = '';
|
298 |
+
const img = document.createElement('img'); img.src=data; img.style.maxWidth='100%'; img.style.borderRadius='8px';
|
299 |
+
$('imagePreview').appendChild(img);
|
300 |
+
// also add chat message with image
|
301 |
+
appendMessage('<div><strong>Generated image (procedural):</strong><br/><img src="'+data+'" style="max-width:320px;border-radius:10px;margin-top:8px"/></div>', 'ai');
|
302 |
+
logMini('Procedural image created');
|
303 |
+
}
|
304 |
+
function randomColor(){ return `hsl(${Math.floor(Math.random()*360)} ${50+Math.floor(Math.random()*40)}% ${30+Math.floor(Math.random()*50)}%)` }
|
305 |
+
|
306 |
+
// ======= Voice ========
|
307 |
+
function speak(text){
|
308 |
+
if(!('speechSynthesis' in window)) return;
|
309 |
+
const u = new SpeechSynthesisUtterance(text);
|
310 |
+
const voices = speechSynthesis.getVoices();
|
311 |
+
if(voices.length) u.voice = voices.find(v=>/en|default/i.test(v.lang))||voices[0];
|
312 |
+
u.rate = 1 - (Number(creativity.value)/300);
|
313 |
+
speechSynthesis.cancel(); speechSynthesis.speak(u);
|
314 |
+
}
|
315 |
+
|
316 |
+
// ======= Export current file as HTML ========
|
317 |
+
function downloadSelf(){
|
318 |
+
const html = document.documentElement.outerHTML;
|
319 |
+
const blob = new Blob([html], {type:'text/html'});
|
320 |
+
const url = URL.createObjectURL(blob);
|
321 |
+
const a = document.createElement('a'); a.href = url; a.download = 'ZewAI-1.5-PRO.html'; document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url);
|
322 |
+
logMini('Downloaded current page as HTML');
|
323 |
+
}
|
324 |
+
|
325 |
+
// ======= Event wiring ========
|
326 |
+
$('sendBtn').addEventListener('click', sendPrompt);
|
327 |
+
promptBox.addEventListener('keydown', e=>{ if(e.key==='Enter' && !e.shiftKey){ e.preventDefault(); sendPrompt(); } });
|
328 |
+
persona.addEventListener('change', ()=>{ currentModel.textContent = persona.options[persona.selectedIndex].text; });
|
329 |
+
creativity.addEventListener('input', ()=>{ currentCreat.textContent = creativity.value });
|
330 |
+
lengthSel.addEventListener('change', ()=>{ currentLen.textContent = lengthSel.value.charAt(0).toUpperCase() + lengthSel.value.slice(1) });
|
331 |
+
$('genImage').addEventListener('click', generateProceduralImage);
|
332 |
+
$('exportHtml').addEventListener('click', downloadSelf);
|
333 |
+
$('clearChat').addEventListener('click', ()=>{ messages.innerHTML=''; logMini('Chat cleared'); });
|
334 |
+
$('surprise').addEventListener('click', ()=>{ promptBox.value = ['Tell me a crazy startup idea','Plan a tiny Mars mission','Write a short sci‑fi scene','Make a 3-step robot plan'].sort(()=>0.5-Math.random())[0]; });
|
335 |
+
voiceToggle.addEventListener('click', ()=>{ voiceEnabled = !voiceEnabled; voiceState.textContent = voiceEnabled ? 'On' : 'Off'; voiceState.style.background=''; logMini('Voice ' + (voiceEnabled?'enabled':'disabled')) });
|
336 |
+
|
337 |
+
// friendly welcome
|
338 |
+
setTimeout(()=>{
|
339 |
+
appendMessage('Hello — I am ZewAI-1.5-PRO (simulated). Ask me anything. Try the "Generate Fake Image" button or select different personas and creativity levels to see different behaviors.');
|
340 |
+
}, 800);
|
341 |
+
|
342 |
+
// expose some functions for debugging in console
|
343 |
+
window._zew = {generateProceduralImage, generateFakeResponse};
|
344 |
+
</script>
|
345 |
+
</body>
|
346 |
</html>
|
347 |
+
|