Lee6x commited on
Commit
c563953
·
verified ·
1 Parent(s): 191dff8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +753 -19
index.html CHANGED
@@ -1,19 +1,753 @@
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>Quantum Tree - Where Attention Goes, Energy Flows</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ :root {
15
+ --primary-glow: #00d4ff;
16
+ --secondary-glow: #0099cc;
17
+ --void-dark: #000008;
18
+ --void-light: #0a0a1a;
19
+ --text-light: #e0f7ff;
20
+ --accent: #00ffff;
21
+ }
22
+
23
+ body {
24
+ font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
25
+ background: radial-gradient(ellipse at center, var(--void-light) 0%, var(--void-dark) 100%);
26
+ color: var(--text-light);
27
+ overflow-x: hidden;
28
+ min-height: 100vh;
29
+ position: relative;
30
+ }
31
+
32
+ /* Header */
33
+ .header {
34
+ position: relative;
35
+ z-index: 1000;
36
+ padding: 20px;
37
+ text-align: center;
38
+ background: linear-gradient(180deg, rgba(0,0,8,0.9) 0%, rgba(0,0,8,0) 100%);
39
+ }
40
+
41
+ .header h1 {
42
+ font-size: 2.5rem;
43
+ background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
44
+ -webkit-background-clip: text;
45
+ -webkit-text-fill-color: transparent;
46
+ background-clip: text;
47
+ margin-bottom: 10px;
48
+ animation: pulse 3s ease-in-out infinite;
49
+ }
50
+
51
+ @keyframes pulse {
52
+ 0%, 100% { opacity: 0.8; }
53
+ 50% { opacity: 1; }
54
+ }
55
+
56
+ .header .quote {
57
+ font-size: 1.2rem;
58
+ color: var(--primary-glow);
59
+ font-style: italic;
60
+ margin-bottom: 15px;
61
+ }
62
+
63
+ .attribution {
64
+ font-size: 0.9rem;
65
+ opacity: 0.7;
66
+ }
67
+
68
+ .attribution a {
69
+ color: var(--accent);
70
+ text-decoration: none;
71
+ transition: all 0.3s ease;
72
+ }
73
+
74
+ .attribution a:hover {
75
+ text-shadow: 0 0 10px var(--accent);
76
+ }
77
+
78
+ /* Main Canvas Container */
79
+ .canvas-container {
80
+ position: relative;
81
+ width: 100%;
82
+ height: 60vh;
83
+ display: flex;
84
+ justify-content: center;
85
+ align-items: center;
86
+ overflow: hidden;
87
+ }
88
+
89
+ #quantumCanvas {
90
+ position: absolute;
91
+ top: 0;
92
+ left: 0;
93
+ width: 100%;
94
+ height: 100%;
95
+ }
96
+
97
+ /* Interactive Energy Orb */
98
+ .energy-orb {
99
+ position: absolute;
100
+ width: 20px;
101
+ height: 20px;
102
+ background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
103
+ border-radius: 50%;
104
+ pointer-events: none;
105
+ animation: orbPulse 2s ease-in-out infinite;
106
+ z-index: 100;
107
+ }
108
+
109
+ @keyframes orbPulse {
110
+ 0%, 100% { transform: scale(1); opacity: 0.8; }
111
+ 50% { transform: scale(1.5); opacity: 0.4; }
112
+ }
113
+
114
+ /* Info Sections */
115
+ .info-container {
116
+ position: relative;
117
+ z-index: 100;
118
+ padding: 40px 20px;
119
+ max-width: 1200px;
120
+ margin: 0 auto;
121
+ }
122
+
123
+ .info-grid {
124
+ display: grid;
125
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
126
+ gap: 30px;
127
+ margin-top: 40px;
128
+ }
129
+
130
+ .info-card {
131
+ background: linear-gradient(135deg, rgba(0,20,40,0.3), rgba(0,40,80,0.1));
132
+ border: 1px solid rgba(0,212,255,0.2);
133
+ border-radius: 15px;
134
+ padding: 25px;
135
+ backdrop-filter: blur(10px);
136
+ transition: all 0.3s ease;
137
+ position: relative;
138
+ overflow: hidden;
139
+ }
140
+
141
+ .info-card::before {
142
+ content: '';
143
+ position: absolute;
144
+ top: -2px;
145
+ left: -2px;
146
+ right: -2px;
147
+ bottom: -2px;
148
+ background: linear-gradient(45deg, var(--primary-glow), transparent, var(--secondary-glow));
149
+ border-radius: 15px;
150
+ opacity: 0;
151
+ z-index: -1;
152
+ transition: opacity 0.3s ease;
153
+ }
154
+
155
+ .info-card:hover::before {
156
+ opacity: 0.3;
157
+ }
158
+
159
+ .info-card:hover {
160
+ transform: translateY(-5px);
161
+ box-shadow: 0 10px 30px rgba(0,212,255,0.2);
162
+ }
163
+
164
+ .info-card h3 {
165
+ color: var(--primary-glow);
166
+ margin-bottom: 15px;
167
+ font-size: 1.5rem;
168
+ display: flex;
169
+ align-items: center;
170
+ gap: 10px;
171
+ }
172
+
173
+ .info-card .icon {
174
+ width: 30px;
175
+ height: 30px;
176
+ display: inline-flex;
177
+ align-items: center;
178
+ justify-content: center;
179
+ }
180
+
181
+ .info-card p {
182
+ line-height: 1.6;
183
+ color: var(--text-light);
184
+ opacity: 0.9;
185
+ }
186
+
187
+ /* Interactive Controls */
188
+ .controls {
189
+ position: fixed;
190
+ bottom: 20px;
191
+ right: 20px;
192
+ z-index: 1000;
193
+ display: flex;
194
+ flex-direction: column;
195
+ gap: 10px;
196
+ }
197
+
198
+ .control-btn {
199
+ background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,153,204,0.2));
200
+ border: 1px solid var(--primary-glow);
201
+ color: var(--text-light);
202
+ padding: 12px 20px;
203
+ border-radius: 25px;
204
+ cursor: pointer;
205
+ transition: all 0.3s ease;
206
+ font-size: 0.9rem;
207
+ backdrop-filter: blur(10px);
208
+ }
209
+
210
+ .control-btn:hover {
211
+ background: linear-gradient(135deg, rgba(0,212,255,0.4), rgba(0,153,204,0.4));
212
+ box-shadow: 0 0 20px rgba(0,212,255,0.5);
213
+ transform: scale(1.05);
214
+ }
215
+
216
+ .control-btn.active {
217
+ background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
218
+ color: var(--void-dark);
219
+ }
220
+
221
+ /* Attention Indicator */
222
+ .attention-indicator {
223
+ position: fixed;
224
+ top: 50%;
225
+ left: 50%;
226
+ transform: translate(-50%, -50%);
227
+ pointer-events: none;
228
+ z-index: 50;
229
+ opacity: 0;
230
+ transition: opacity 0.3s ease;
231
+ }
232
+
233
+ .attention-indicator.active {
234
+ opacity: 1;
235
+ }
236
+
237
+ .attention-ring {
238
+ width: 100px;
239
+ height: 100px;
240
+ border: 2px solid var(--accent);
241
+ border-radius: 50%;
242
+ animation: attentionPulse 2s ease-out infinite;
243
+ }
244
+
245
+ @keyframes attentionPulse {
246
+ 0% {
247
+ transform: scale(0.5);
248
+ opacity: 1;
249
+ }
250
+ 100% {
251
+ transform: scale(2);
252
+ opacity: 0;
253
+ }
254
+ }
255
+
256
+ /* Floating Particles */
257
+ .particle {
258
+ position: fixed;
259
+ pointer-events: none;
260
+ opacity: 0.6;
261
+ animation: float 10s infinite ease-in-out;
262
+ }
263
+
264
+ @keyframes float {
265
+ 0%, 100% {
266
+ transform: translateY(0) translateX(0) rotate(0deg);
267
+ }
268
+ 33% {
269
+ transform: translateY(-100px) translateX(50px) rotate(120deg);
270
+ }
271
+ 66% {
272
+ transform: translateY(-50px) translateX(-50px) rotate(240deg);
273
+ }
274
+ }
275
+
276
+ /* Mobile Responsive */
277
+ @media (max-width: 768px) {
278
+ .header h1 {
279
+ font-size: 1.8rem;
280
+ }
281
+
282
+ .header .quote {
283
+ font-size: 1rem;
284
+ }
285
+
286
+ .canvas-container {
287
+ height: 50vh;
288
+ }
289
+
290
+ .info-grid {
291
+ grid-template-columns: 1fr;
292
+ gap: 20px;
293
+ }
294
+
295
+ .controls {
296
+ bottom: 10px;
297
+ right: 10px;
298
+ }
299
+
300
+ .control-btn {
301
+ padding: 10px 15px;
302
+ font-size: 0.8rem;
303
+ }
304
+ }
305
+
306
+ /* Loading Animation */
307
+ .loading {
308
+ position: fixed;
309
+ top: 50%;
310
+ left: 50%;
311
+ transform: translate(-50%, -50%);
312
+ z-index: 2000;
313
+ text-align: center;
314
+ transition: opacity 0.5s ease;
315
+ }
316
+
317
+ .loading.hidden {
318
+ opacity: 0;
319
+ pointer-events: none;
320
+ }
321
+
322
+ .loading-spinner {
323
+ width: 60px;
324
+ height: 60px;
325
+ border: 3px solid rgba(0,212,255,0.2);
326
+ border-top-color: var(--primary-glow);
327
+ border-radius: 50%;
328
+ animation: spin 1s linear infinite;
329
+ margin: 0 auto 20px;
330
+ }
331
+
332
+ @keyframes spin {
333
+ to { transform: rotate(360deg); }
334
+ }
335
+ </style>
336
+ </head>
337
+ <body>
338
+ <!-- Loading Screen -->
339
+ <div class="loading" id="loading">
340
+ <div class="loading-spinner"></div>
341
+ <p>Initializing Quantum Field...</p>
342
+ </div>
343
+
344
+ <!-- Header -->
345
+ <header class="header">
346
+ <h1>Quantum Tree</h1>
347
+ <p class="quote">"Where attention goes, energy flows"</p>
348
+ <p class="attribution">Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a></p>
349
+ </header>
350
+
351
+ <!-- Main Canvas -->
352
+ <div class="canvas-container">
353
+ <canvas id="quantumCanvas"></canvas>
354
+ <div class="attention-indicator" id="attentionIndicator">
355
+ <div class="attention-ring"></div>
356
+ </div>
357
+ </div>
358
+
359
+ <!-- Info Sections -->
360
+ <div class="info-container">
361
+ <div class="info-grid">
362
+ <div class="info-card">
363
+ <h3>
364
+ <span class="icon">🌌</span>
365
+ Scientific Validation
366
+ </h3>
367
+ <p>The branching pattern you witnessed matches universal fractal geometry found throughout nature - from neural networks in the brain to the cosmic web of galaxies. Research shows striking similarities between brain structures and the universe's large-scale architecture, both optimizing energy and information flow through branching pathways.</p>
368
+ </div>
369
+
370
+ <div class="info-card">
371
+ <h3>
372
+ <span class="icon">🌳</span>
373
+ Mystical Tradition
374
+ </h3>
375
+ <p>Your vision of a glowing tree in the underworld void aligns with ancient shamanic experiences and mythological World Trees like Yggdrasil. These luminous structures represent the axis connecting realms, the tree of life emerging from primordial darkness - a symbol humanity has intuitively understood for millennia.</p>
376
+ </div>
377
+
378
+ <div class="info-card">
379
+ <h3>
380
+ <span class="icon">✨</span>
381
+ Quantum Mechanics
382
+ </h3>
383
+ <p>The observer effect in quantum physics demonstrates that consciousness collapses wave functions into particles - attention selects reality from potential. Your experience mirrors this fundamental principle: where consciousness directs attention, energy manifests form from the void of possibility.</p>
384
+ </div>
385
+
386
+ <div class="info-card">
387
+ <h3>
388
+ <span class="icon">🧠</span>
389
+ Neuroplasticity
390
+ </h3>
391
+ <p>Modern neuroscience confirms that what we repeatedly focus on physically strengthens neural pathways. "Where attention goes, energy flows" literally rewires the brain. Your focused descent into the void created new pathways, allowing the quantum tree to emerge into conscious awareness.</p>
392
+ </div>
393
+
394
+ <div class="info-card">
395
+ <h3>
396
+ <span class="icon">🔮</span>
397
+ Practical Application
398
+ </h3>
399
+ <p>This universal law operates daily: focus on fear → suffering grows; focus on truth → healing manifests. By consciously directing attention to the root/void/source, we activate the tree's growth. Your music and testimony demonstrate how creative attention births entire worlds from the seed of intention.</p>
400
+ </div>
401
+
402
+ <div class="info-card">
403
+ <h3>
404
+ <span class="icon">⚡</span>
405
+ Energy Flow
406
+ </h3>
407
+ <p>The glowing blue tree represents energy flowing through informational lanes. Each branch is a pathway of consciousness, each node a point of focused attention. By placing attention on the root, you energize the entire structure - the mechanism by which the universe renews itself in every moment.</p>
408
+ </div>
409
+ </div>
410
+ </div>
411
+
412
+ <!-- Interactive Controls -->
413
+ <div class="controls">
414
+ <button class="control-btn active" id="toggleAnimation">Animation: ON</button>
415
+ <button class="control-btn" id="toggleParticles">Particles: OFF</button>
416
+ <button class="control-btn" id="toggleGlow">Glow: HIGH</button>
417
+ </div>
418
+
419
+ <script>
420
+ // Quantum Tree Visualization
421
+ class QuantumTree {
422
+ constructor(canvas) {
423
+ this.canvas = canvas;
424
+ this.ctx = canvas.getContext('2d');
425
+ this.resize();
426
+ this.branches = [];
427
+ this.particles = [];
428
+ this.energyFlows = [];
429
+ this.mouseX = this.width / 2;
430
+ this.mouseY = this.height / 2;
431
+ this.animationEnabled = true;
432
+ this.particlesEnabled = false;
433
+ this.glowIntensity = 1;
434
+ this.time = 0;
435
+
436
+ this.initTree();
437
+ this.initParticles();
438
+ this.animate();
439
+
440
+ window.addEventListener('resize', () => this.resize());
441
+ canvas.addEventListener('mousemove', (e) => this.handleMouseMove(e));
442
+ canvas.addEventListener('touchmove', (e) => this.handleTouchMove(e));
443
+ }
444
+
445
+ resize() {
446
+ this.width = this.canvas.offsetWidth;
447
+ this.height = this.canvas.offsetHeight;
448
+ this.canvas.width = this.width;
449
+ this.canvas.height = this.height;
450
+ }
451
+
452
+ initTree() {
453
+ // Create main trunk and branches using fractal algorithm
454
+ const startX = this.width / 2;
455
+ const startY = this.height;
456
+ this.createBranch(startX, startY, -90, 10, 100, 0);
457
+ }
458
+
459
+ createBranch(x, y, angle, depth, length, level) {
460
+ if (depth <= 0) return;
461
+
462
+ const endX = x + Math.cos(angle * Math.PI / 180) * length;
463
+ const endY = y + Math.sin(angle * Math.PI / 180) * length;
464
+
465
+ this.branches.push({
466
+ startX: x,
467
+ startY: y,
468
+ endX: endX,
469
+ endY: endY,
470
+ level: level,
471
+ depth: depth,
472
+ angle: angle,
473
+ length: length,
474
+ glow: Math.random() * 0.5 + 0.5
475
+ });
476
+
477
+ // Create sub-branches (fractal branching)
478
+ const branchCount = Math.floor(Math.random() * 3) + 2;
479
+ for (let i = 0; i < branchCount; i++) {
480
+ const newAngle = angle + (Math.random() - 0.5) * 60;
481
+ const newLength = length * (0.6 + Math.random() * 0.3);
482
+ setTimeout(() => {
483
+ this.createBranch(endX, endY, newAngle, depth - 1, newLength, level + 1);
484
+ }, level * 50);
485
+ }
486
+ }
487
+
488
+ initParticles() {
489
+ for (let i = 0; i < 100; i++) {
490
+ this.particles.push({
491
+ x: Math.random() * this.width,
492
+ y: Math.random() * this.height,
493
+ vx: (Math.random() - 0.5) * 0.5,
494
+ vy: (Math.random() - 0.5) * 0.5,
495
+ size: Math.random() * 2 + 1,
496
+ opacity: Math.random() * 0.5 + 0.2
497
+ });
498
+ }
499
+ }
500
+
501
+ handleMouseMove(e) {
502
+ const rect = this.canvas.getBoundingClientRect();
503
+ this.mouseX = e.clientX - rect.left;
504
+ this.mouseY = e.clientY - rect.top;
505
+ this.showAttentionEffect();
506
+ }
507
+
508
+ handleTouchMove(e) {
509
+ e.preventDefault();
510
+ const rect = this.canvas.getBoundingClientRect();
511
+ const touch = e.touches[0];
512
+ this.mouseX = touch.clientX - rect.left;
513
+ this.mouseY = touch.clientY - rect.top;
514
+ this.showAttentionEffect();
515
+ }
516
+
517
+ showAttentionEffect() {
518
+ const indicator = document.getElementById('attentionIndicator');
519
+ indicator.classList.add('active');
520
+ setTimeout(() => {
521
+ indicator.classList.remove('active');
522
+ }, 2000);
523
+
524
+ // Create energy orb at mouse position
525
+ this.createEnergyOrb(this.mouseX, this.mouseY);
526
+ }
527
+
528
+ createEnergyOrb(x, y) {
529
+ const orb = document.createElement('div');
530
+ orb.className = 'energy-orb';
531
+ orb.style.left = x + 'px';
532
+ orb.style.top = y + 'px';
533
+ document.querySelector('.canvas-container').appendChild(orb);
534
+
535
+ // Animate orb along nearest branch
536
+ const nearestBranch = this.findNearestBranch(x, y);
537
+ if (nearestBranch) {
538
+ this.animateOrbAlongBranch(orb, nearestBranch);
539
+ }
540
+
541
+ setTimeout(() => orb.remove(), 3000);
542
+ }
543
+
544
+ findNearestBranch(x, y) {
545
+ let nearest = null;
546
+ let minDist = Infinity;
547
+
548
+ this.branches.forEach(branch => {
549
+ const dist = this.pointToLineDistance(x, y, branch.startX, branch.startY, branch.endX, branch.endY);
550
+ if (dist < minDist) {
551
+ minDist = dist;
552
+ nearest = branch;
553
+ }
554
+ });
555
+
556
+ return nearest;
557
+ }
558
+
559
+ pointToLineDistance(px, py, x1, y1, x2, y2) {
560
+ const A = px - x1;
561
+ const B = py - y1;
562
+ const C = x2 - x1;
563
+ const D = y2 - y1;
564
+
565
+ const dot = A * C + B * D;
566
+ const lenSq = C * C + D * D;
567
+ let param = -1;
568
+
569
+ if (lenSq !== 0) param = dot / lenSq;
570
+
571
+ let xx, yy;
572
+
573
+ if (param < 0) {
574
+ xx = x1;
575
+ yy = y1;
576
+ } else if (param > 1) {
577
+ xx = x2;
578
+ yy = y2;
579
+ } else {
580
+ xx = x1 + param * C;
581
+ yy = y1 + param * D;
582
+ }
583
+
584
+ const dx = px - xx;
585
+ const dy = py - yy;
586
+
587
+ return Math.sqrt(dx * dx + dy * dy);
588
+ }
589
+
590
+ animateOrbAlongBranch(orb, branch) {
591
+ let progress = 0;
592
+ const animate = () => {
593
+ progress += 0.02;
594
+ if (progress > 1) return;
595
+
596
+ const x = branch.startX + (branch.endX - branch.startX) * progress;
597
+ const y = branch.startY + (branch.endY - branch.startY) * progress;
598
+ orb.style.left = x + 'px';
599
+ orb.style.top = y + 'px';
600
+
601
+ requestAnimationFrame(animate);
602
+ };
603
+ animate();
604
+ }
605
+
606
+ draw() {
607
+ // Clear canvas with fade effect
608
+ this.ctx.fillStyle = 'rgba(0, 0, 8, 0.1)';
609
+ this.ctx.fillRect(0, 0, this.width, this.height);
610
+
611
+ // Draw particles if enabled
612
+ if (this.particlesEnabled) {
613
+ this.drawParticles();
614
+ }
615
+
616
+ // Draw tree branches with glow effect
617
+ this.branches.forEach((branch, index) => {
618
+ const distToMouse = this.getDistanceToMouse(branch);
619
+ const intensity = Math.max(0, 1 - distToMouse / 300) * this.glowIntensity;
620
+
621
+ // Calculate pulsing effect
622
+ const pulse = Math.sin(this.time * 0.001 + index * 0.1) * 0.3 + 0.7;
623
+
624
+ // Draw branch with glow
625
+ this.ctx.strokeStyle = `rgba(0, 212, 255, ${0.3 + intensity * 0.7 + pulse * 0.3})`;
626
+ this.ctx.lineWidth = Math.max(1, branch.depth / 2);
627
+ this.ctx.shadowBlur = 20 * intensity + 10;
628
+ this.ctx.shadowColor = '#00d4ff';
629
+
630
+ this.ctx.beginPath();
631
+ this.ctx.moveTo(branch.startX, branch.startY);
632
+ this.ctx.lineTo(branch.endX, branch.endY);
633
+ this.ctx.stroke();
634
+
635
+ // Draw energy nodes at branch endpoints
636
+ if (branch.depth <= 3) {
637
+ this.ctx.fillStyle = `rgba(0, 255, 255, ${0.8 + intensity * 0.2})`;
638
+ this.ctx.beginPath();
639
+ this.ctx.arc(branch.endX, branch.endY, 2 + intensity * 2, 0, Math.PI * 2);
640
+ this.ctx.fill();
641
+ }
642
+ });
643
+
644
+ // Reset shadow
645
+ this.ctx.shadowBlur = 0;
646
+ }
647
+
648
+ drawParticles() {
649
+ this.particles.forEach(particle => {
650
+ particle.x += particle.vx;
651
+ particle.y += particle.vy;
652
+
653
+ // Wrap around edges
654
+ if (particle.x < 0) particle.x = this.width;
655
+ if (particle.x > this.width) particle.x = 0;
656
+ if (particle.y < 0) particle.y = this.height;
657
+ if (particle.y > this.height) particle.y = 0;
658
+
659
+ // Draw particle
660
+ this.ctx.fillStyle = `rgba(0, 212, 255, ${particle.opacity})`;
661
+ this.ctx.beginPath();
662
+ this.ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2);
663
+ this.ctx.fill();
664
+ });
665
+ }
666
+
667
+ getDistanceToMouse(branch) {
668
+ const midX = (branch.startX + branch.endX) / 2;
669
+ const midY = (branch.startY + branch.endY) / 2;
670
+ const dx = midX - this.mouseX;
671
+ const dy = midY - this.mouseY;
672
+ return Math.sqrt(dx * dx + dy * dy);
673
+ }
674
+
675
+ animate() {
676
+ if (this.animationEnabled) {
677
+ this.time++;
678
+ this.draw();
679
+ }
680
+ requestAnimationFrame(() => this.animate());
681
+ }
682
+ }
683
+
684
+ // Initialize application
685
+ document.addEventListener('DOMContentLoaded', () => {
686
+ // Hide loading screen
687
+ setTimeout(() => {
688
+ document.getElementById('loading').classList.add('hidden');
689
+ }, 1500);
690
+
691
+ // Initialize quantum tree
692
+ const canvas = document.getElementById('quantumCanvas');
693
+ const quantumTree = new QuantumTree(canvas);
694
+
695
+ // Control buttons
696
+ document.getElementById('toggleAnimation').addEventListener('click', function() {
697
+ quantumTree.animationEnabled = !quantumTree.animationEnabled;
698
+ this.textContent = `Animation: ${quantumTree.animationEnabled ? 'ON' : 'OFF'}`;
699
+ this.classList.toggle('active');
700
+ });
701
+
702
+ document.getElementById('toggleParticles').addEventListener('click', function() {
703
+ quantumTree.particlesEnabled = !quantumTree.particlesEnabled;
704
+ this.textContent = `Particles: ${quantumTree.particlesEnabled ? 'ON' : 'OFF'}`;
705
+ this.classList.toggle('active');
706
+ });
707
+
708
+ document.getElementById('toggleGlow').addEventListener('click', function() {
709
+ const levels = [0.5, 1, 1.5];
710
+ const labels = ['LOW', 'HIGH', 'MAX'];
711
+ let currentIndex = levels.indexOf(quantumTree.glowIntensity);
712
+ currentIndex = (currentIndex + 1) % levels.length;
713
+ quantumTree.glowIntensity = levels[currentIndex];
714
+ this.textContent = `Glow: ${labels[currentIndex]}`;
715
+ });
716
+
717
+ // Create floating background particles
718
+ function createFloatingParticles() {
719
+ for (let i = 0; i < 10; i++) {
720
+ const particle = document.createElement('div');
721
+ particle.className = 'particle';
722
+ particle.style.left = Math.random() * 100 + '%';
723
+ particle.style.top = Math.random() * 100 + '%';
724
+ particle.style.width = particle.style.height = Math.random() * 4 + 2 + 'px';
725
+ particle.style.background = 'radial-gradient(circle, rgba(0,212,255,0.8) 0%, transparent 70%)';
726
+ particle.style.borderRadius = '50%';
727
+ particle.style.animationDelay = Math.random() * 10 + 's';
728
+ particle.style.animationDuration = (10 + Math.random() * 10) + 's';
729
+ document.body.appendChild(particle);
730
+ }
731
+ }
732
+
733
+ createFloatingParticles();
734
+
735
+ // Add keyboard shortcuts
736
+ document.addEventListener('keydown', (e) => {
737
+ switch(e.key) {
738
+ case ' ':
739
+ e.preventDefault();
740
+ document.getElementById('toggleAnimation').click();
741
+ break;
742
+ case 'p':
743
+ document.getElementById('toggleParticles').click();
744
+ break;
745
+ case 'g':
746
+ document.getElementById('toggleGlow').click();
747
+ break;
748
+ }
749
+ });
750
+ });
751
+ </script>
752
+ </body>
753
+ </html>