reflexive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/logo0.jpg ADDED
Binary file
package/logo1.jpg ADDED
Binary file
package/logo2.jpg ADDED
Binary file
@@ -0,0 +1,435 @@
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>Reflexive Nexus</title>
7
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
8
+ <style>
9
+ * { margin: 0; padding: 0; box-sizing: border-box; }
10
+ body {
11
+ font-family: 'Courier New', monospace;
12
+ background: #000;
13
+ min-height: 100vh;
14
+ overflow-x: hidden;
15
+ color: #fff;
16
+ }
17
+ #canvas-container {
18
+ position: fixed;
19
+ top: 0;
20
+ left: 0;
21
+ width: 100%;
22
+ height: 100%;
23
+ z-index: 0;
24
+ }
25
+ .content {
26
+ position: relative;
27
+ z-index: 1;
28
+ max-width: 900px;
29
+ margin: 0 auto;
30
+ padding: 40px 20px;
31
+ }
32
+ h1 {
33
+ text-align: center;
34
+ font-size: 3em;
35
+ margin-bottom: 10px;
36
+ text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 40px rgba(100, 200, 255, 0.3);
37
+ animation: glow 2s ease-in-out infinite alternate;
38
+ }
39
+ @keyframes glow {
40
+ from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 40px rgba(100, 200, 255, 0.3); }
41
+ to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(100, 200, 255, 0.6); }
42
+ }
43
+ .theme {
44
+ text-align: center;
45
+ font-style: italic;
46
+ opacity: 0.8;
47
+ margin-bottom: 30px;
48
+ font-size: 1.1em;
49
+ }
50
+ #story-text {
51
+ font-size: 1.3em;
52
+ line-height: 1.9;
53
+ margin: 30px 0;
54
+ padding: 30px;
55
+ background: rgba(0, 0, 0, 0.7);
56
+ border: 2px solid rgba(100, 200, 255, 0.3);
57
+ border-radius: 15px;
58
+ min-height: 200px;
59
+ box-shadow: 0 0 30px rgba(100, 200, 255, 0.2);
60
+ backdrop-filter: blur(10px);
61
+ transition: all 0.5s ease;
62
+ }
63
+ .quality-bar {
64
+ margin: 20px 0;
65
+ padding: 20px;
66
+ background: rgba(0, 0, 0, 0.7);
67
+ border: 2px solid rgba(100, 200, 255, 0.3);
68
+ border-radius: 15px;
69
+ backdrop-filter: blur(10px);
70
+ }
71
+ .quality-fill {
72
+ height: 25px;
73
+ background: linear-gradient(90deg, #00ff88 0%, #00ffff 50%, #0088ff 100%);
74
+ border-radius: 12px;
75
+ transition: width 0.8s ease;
76
+ box-shadow: 0 0 20px rgba(0, 255, 200, 0.5);
77
+ }
78
+ .stats {
79
+ display: flex;
80
+ justify-content: space-around;
81
+ margin-top: 15px;
82
+ font-size: 1em;
83
+ font-weight: bold;
84
+ }
85
+ .chat-box {
86
+ margin: 25px 0;
87
+ padding: 25px;
88
+ background: rgba(0, 0, 0, 0.8);
89
+ border: 2px solid rgba(100, 200, 255, 0.5);
90
+ border-radius: 15px;
91
+ box-shadow: 0 0 30px rgba(100, 200, 255, 0.3);
92
+ backdrop-filter: blur(10px);
93
+ }
94
+ .chat-input {
95
+ width: 100%;
96
+ padding: 15px;
97
+ font-size: 1.1em;
98
+ background: rgba(0, 0, 0, 0.6);
99
+ border: 2px solid rgba(100, 200, 255, 0.4);
100
+ border-radius: 10px;
101
+ color: #fff;
102
+ font-family: 'Courier New', monospace;
103
+ }
104
+ .chat-input:focus {
105
+ outline: none;
106
+ border-color: rgba(100, 200, 255, 0.8);
107
+ box-shadow: 0 0 20px rgba(100, 200, 255, 0.4);
108
+ }
109
+ .chat-input::placeholder {
110
+ color: rgba(255, 255, 255, 0.4);
111
+ }
112
+ .chat-send-btn {
113
+ margin-top: 12px;
114
+ padding: 15px 35px;
115
+ background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%);
116
+ border: none;
117
+ border-radius: 10px;
118
+ color: #000;
119
+ font-size: 1.1em;
120
+ font-weight: bold;
121
+ cursor: pointer;
122
+ transition: all 0.3s ease;
123
+ font-family: 'Courier New', monospace;
124
+ }
125
+ .chat-send-btn:hover {
126
+ transform: translateY(-3px);
127
+ box-shadow: 0 0 30px rgba(0, 255, 200, 0.6);
128
+ }
129
+ .divider {
130
+ margin: 25px 0;
131
+ text-align: center;
132
+ color: rgba(100, 200, 255, 0.6);
133
+ font-style: italic;
134
+ font-size: 1.1em;
135
+ }
136
+ .choice-btn {
137
+ display: block;
138
+ width: 100%;
139
+ padding: 20px;
140
+ margin: 15px 0;
141
+ font-size: 1.2em;
142
+ background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 255, 0.2) 100%);
143
+ border: 2px solid rgba(0, 255, 200, 0.4);
144
+ border-radius: 12px;
145
+ color: #fff;
146
+ cursor: pointer;
147
+ transition: all 0.3s ease;
148
+ text-align: left;
149
+ font-family: 'Courier New', monospace;
150
+ backdrop-filter: blur(5px);
151
+ }
152
+ .choice-btn:hover {
153
+ background: linear-gradient(135deg, rgba(0, 255, 136, 0.4) 0%, rgba(0, 200, 255, 0.4) 100%);
154
+ transform: translateX(15px);
155
+ box-shadow: 0 0 30px rgba(0, 255, 200, 0.4);
156
+ border-color: rgba(0, 255, 200, 0.8);
157
+ }
158
+ #start-btn {
159
+ display: block;
160
+ margin: 50px auto;
161
+ padding: 25px 50px;
162
+ font-size: 1.5em;
163
+ background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%);
164
+ border: none;
165
+ border-radius: 15px;
166
+ color: #000;
167
+ font-weight: bold;
168
+ cursor: pointer;
169
+ transition: all 0.3s ease;
170
+ font-family: 'Courier New', monospace;
171
+ }
172
+ #start-btn:hover {
173
+ transform: scale(1.1);
174
+ box-shadow: 0 0 50px rgba(0, 255, 200, 0.8);
175
+ }
176
+ .hidden { display: none; }
177
+ </style>
178
+ </head>
179
+ <body>
180
+ <div id="canvas-container"></div>
181
+ <div class="content">
182
+ <h1>⚡ REFLEXIVE NEXUS ⚡</h1>
183
+ <p class="theme">THEME_PLACEHOLDER</p>
184
+
185
+ <div id="start-screen">
186
+ <button id="start-btn">► INITIATE SEQUENCE</button>
187
+ </div>
188
+
189
+ <div id="game-screen" class="hidden">
190
+ <div id="story-text"></div>
191
+
192
+ <div class="quality-bar">
193
+ <div class="quality-fill" id="quality-bar" style="width: 50%"></div>
194
+ <div class="stats">
195
+ <span>⚡ QUALITY: <span id="quality-pct">50%</span></span>
196
+ <span>📍 SCENE: <span id="scene-count">0</span></span>
197
+ <span>💫 FLOW: <span id="engagement">50%</span></span>
198
+ </div>
199
+ </div>
200
+
201
+ <div class="chat-box">
202
+ <input type="text" id="chat-input" class="chat-input" placeholder="► Enter command..." />
203
+ <button id="chat-send" class="chat-send-btn">⚡ EXECUTE</button>
204
+ </div>
205
+
206
+ <div class="divider">— SUGGESTED ACTIONS —</div>
207
+
208
+ <div class="choices" id="choices-container"></div>
209
+ </div>
210
+ </div>
211
+
212
+ <script>
213
+ // Three.js scene setup
214
+ let scene, camera, renderer, particles;
215
+ let particleSystem;
216
+ let currentMood = 'neutral';
217
+
218
+ function initThree() {
219
+ scene = new THREE.Scene();
220
+ camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
221
+ camera.position.z = 50;
222
+
223
+ renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
224
+ renderer.setSize(window.innerWidth, window.innerHeight);
225
+ document.getElementById('canvas-container').appendChild(renderer.domElement);
226
+
227
+ // Create particle system
228
+ const particleCount = 2000;
229
+ const geometry = new THREE.BufferGeometry();
230
+ const positions = new Float32Array(particleCount * 3);
231
+ const colors = new Float32Array(particleCount * 3);
232
+ const sizes = new Float32Array(particleCount);
233
+
234
+ for (let i = 0; i < particleCount; i++) {
235
+ positions[i * 3] = (Math.random() - 0.5) * 100;
236
+ positions[i * 3 + 1] = (Math.random() - 0.5) * 100;
237
+ positions[i * 3 + 2] = (Math.random() - 0.5) * 100;
238
+
239
+ colors[i * 3] = 0.2 + Math.random() * 0.8;
240
+ colors[i * 3 + 1] = 0.5 + Math.random() * 0.5;
241
+ colors[i * 3 + 2] = 1.0;
242
+
243
+ sizes[i] = Math.random() * 2;
244
+ }
245
+
246
+ geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
247
+ geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));
248
+ geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));
249
+
250
+ const material = new THREE.ShaderMaterial({
251
+ uniforms: {
252
+ time: { value: 0 },
253
+ mood: { value: 0.5 }
254
+ },
255
+ vertexShader: `
256
+ attribute float size;
257
+ attribute vec3 color;
258
+ varying vec3 vColor;
259
+ uniform float time;
260
+ uniform float mood;
261
+
262
+ void main() {
263
+ vColor = color;
264
+ vec3 pos = position;
265
+ pos.x += sin(time * 0.5 + position.y * 0.01) * mood * 3.0;
266
+ pos.y += cos(time * 0.3 + position.x * 0.01) * mood * 3.0;
267
+ pos.z += sin(time * 0.4 + position.x * 0.01) * mood * 2.0;
268
+
269
+ vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0);
270
+ gl_PointSize = size * (300.0 / -mvPosition.z) * (0.5 + mood);
271
+ gl_Position = projectionMatrix * mvPosition;
272
+ }
273
+ `,
274
+ fragmentShader: `
275
+ varying vec3 vColor;
276
+ uniform float mood;
277
+
278
+ void main() {
279
+ vec2 center = gl_PointCoord - vec2(0.5);
280
+ float dist = length(center);
281
+ if (dist > 0.5) discard;
282
+
283
+ float alpha = 1.0 - (dist * 2.0);
284
+ alpha *= (0.3 + mood * 0.7);
285
+
286
+ gl_FragColor = vec4(vColor, alpha);
287
+ }
288
+ `,
289
+ transparent: true,
290
+ vertexColors: true,
291
+ blending: THREE.AdditiveBlending,
292
+ depthTest: false
293
+ });
294
+
295
+ particleSystem = new THREE.Points(geometry, material);
296
+ scene.add(particleSystem);
297
+
298
+ animate();
299
+ }
300
+
301
+ function animate() {
302
+ requestAnimationFrame(animate);
303
+
304
+ const time = Date.now() * 0.001;
305
+ particleSystem.material.uniforms.time.value = time;
306
+
307
+ particleSystem.rotation.x += 0.0005;
308
+ particleSystem.rotation.y += 0.001;
309
+
310
+ renderer.render(scene, camera);
311
+ }
312
+
313
+ function setParticleMood(quality, engagement) {
314
+ const mood = (quality + engagement) / 2;
315
+ particleSystem.material.uniforms.mood.value = mood;
316
+
317
+ // Update colors based on quality
318
+ const colors = particleSystem.geometry.attributes.color;
319
+ for (let i = 0; i < colors.count; i++) {
320
+ if (mood > 0.7) {
321
+ colors.array[i * 3] = 0.0 + Math.random() * 0.3;
322
+ colors.array[i * 3 + 1] = 1.0;
323
+ colors.array[i * 3 + 2] = 0.5 + Math.random() * 0.5;
324
+ } else if (mood < 0.3) {
325
+ colors.array[i * 3] = 1.0;
326
+ colors.array[i * 3 + 1] = 0.0 + Math.random() * 0.3;
327
+ colors.array[i * 3 + 2] = 0.0 + Math.random() * 0.3;
328
+ } else {
329
+ colors.array[i * 3] = 0.2 + Math.random() * 0.5;
330
+ colors.array[i * 3 + 1] = 0.5 + Math.random() * 0.5;
331
+ colors.array[i * 3 + 2] = 1.0;
332
+ }
333
+ }
334
+ colors.needsUpdate = true;
335
+ }
336
+
337
+ window.addEventListener('resize', () => {
338
+ camera.aspect = window.innerWidth / window.innerHeight;
339
+ camera.updateProjectionMatrix();
340
+ renderer.setSize(window.innerWidth, window.innerHeight);
341
+ });
342
+
343
+ initThree();
344
+
345
+ // Game logic
346
+ let sessionId = null;
347
+
348
+ document.getElementById('start-btn').addEventListener('click', async () => {
349
+ const response = await fetch('/api/start', { method: 'POST' });
350
+ const data = await response.json();
351
+ sessionId = data.sessionId;
352
+
353
+ document.getElementById('start-screen').classList.add('hidden');
354
+ document.getElementById('game-screen').classList.remove('hidden');
355
+
356
+ displayGameState(data.state);
357
+ });
358
+
359
+ async function makeChoice(choiceIndex) {
360
+ const response = await fetch('/api/choice', {
361
+ method: 'POST',
362
+ headers: { 'Content-Type': 'application/json' },
363
+ body: JSON.stringify({ sessionId, choiceIndex })
364
+ });
365
+ const data = await response.json();
366
+ displayGameState(data.state);
367
+ }
368
+
369
+ async function sendCustomPrompt(prompt) {
370
+ const response = await fetch('/api/prompt', {
371
+ method: 'POST',
372
+ headers: { 'Content-Type': 'application/json' },
373
+ body: JSON.stringify({ sessionId, prompt })
374
+ });
375
+ const data = await response.json();
376
+ displayGameState(data.state);
377
+ }
378
+
379
+ document.getElementById('chat-send').addEventListener('click', () => {
380
+ const input = document.getElementById('chat-input');
381
+ const prompt = input.value.trim();
382
+ if (prompt) {
383
+ sendCustomPrompt(prompt);
384
+ input.value = '';
385
+ }
386
+ });
387
+
388
+ document.getElementById('chat-input').addEventListener('keypress', (e) => {
389
+ if (e.key === 'Enter') {
390
+ const prompt = e.target.value.trim();
391
+ if (prompt) {
392
+ sendCustomPrompt(prompt);
393
+ e.target.value = '';
394
+ }
395
+ }
396
+ });
397
+
398
+ function displayGameState(state) {
399
+ const storyText = document.getElementById('story-text');
400
+ storyText.textContent = state.text;
401
+
402
+ // Animate text appearance
403
+ storyText.style.opacity = '0';
404
+ setTimeout(() => { storyText.style.opacity = '1'; }, 50);
405
+
406
+ const choicesContainer = document.getElementById('choices-container');
407
+ choicesContainer.innerHTML = '';
408
+
409
+ if (state.choices.length === 0) {
410
+ choicesContainer.innerHTML = '<p style="text-align: center; font-size: 1.5em;">◉ SEQUENCE COMPLETE ◉</p>';
411
+ return;
412
+ }
413
+
414
+ state.choices.forEach((choice, index) => {
415
+ const btn = document.createElement('button');
416
+ btn.className = 'choice-btn';
417
+ btn.textContent = '▸ ' + choice.text;
418
+ btn.addEventListener('click', () => makeChoice(index));
419
+ choicesContainer.appendChild(btn);
420
+ });
421
+
422
+ if (state.quality !== undefined) {
423
+ const qualityPct = Math.round(state.quality * 100);
424
+ document.getElementById('quality-bar').style.width = qualityPct + '%';
425
+ document.getElementById('quality-pct').textContent = qualityPct + '%';
426
+ document.getElementById('scene-count').textContent = state.sceneCount || 0;
427
+ document.getElementById('engagement').textContent = Math.round((state.engagement || 0.5) * 100) + '%';
428
+
429
+ // Update particle effects based on quality
430
+ setParticleMood(state.quality, state.engagement || 0.5);
431
+ }
432
+ }
433
+ </script>
434
+ </body>
435
+ </html>