lonestar108 commited on
Commit
23e86a2
·
verified ·
1 Parent(s): 442408b

same but better

Browse files
Files changed (2) hide show
  1. about.html +90 -0
  2. index.html +139 -36
about.html ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>About - QuantumPrimeSync</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ </head>
12
+ <body class="bg-gray-900 text-white">
13
+ <!-- Header -->
14
+ <header class="bg-gray-800 py-6">
15
+ <div class="container mx-auto px-4">
16
+ <div class="flex justify-between items-center">
17
+ <h1 class="text-3xl font-bold text-purple-400">QuantumPrimeSync</h1>
18
+ <nav>
19
+ <ul class="flex space-x-6">
20
+ <li><a href="index.html" class="hover:text-purple-400 transition-colors">Home</a></li>
21
+ <li><a href="about.html" class="text-purple-400">About</a></li>
22
+ </ul>
23
+ </nav>
24
+ </div>
25
+ </div>
26
+ </header>
27
+
28
+ <!-- Main Content -->
29
+ <main class="container mx-auto px-4 py-12">
30
+ <div class="max-w-3xl mx-auto">
31
+ <h1 class="text-4xl font-bold mb-8 text-center">About QuantumPrimeSync</h1>
32
+
33
+ <div class="bg-gray-800 rounded-xl p-8 mb-8">
34
+ <h2 class="text-2xl font-semibold mb-4 text-purple-300">Concept</h2>
35
+ <p class="mb-4">
36
+ QuantumPrimeSync is a mesmerizing particle simulation that explores the harmony between mathematics and physics.
37
+ Each particle represents a number with unique properties, creating a visual representation of mathematical relationships.
38
+ </p>
39
+ <p class="mb-4">
40
+ The simulation demonstrates how particles with shared prime factors naturally attract to each other, forming
41
+ clusters and patterns that mirror the fundamental structure of numbers.
42
+ </p>
43
+ </div>
44
+
45
+ <div class="bg-gray-800 rounded-xl p-8 mb-8">
46
+ <h2 class="text-2xl font-semibold mb-4 text-purple-300">How It Works</h2>
47
+ <ul class="list-disc pl-6 space-y-2 mb-4">
48
+ <li>Each particle has a unique value between 2 and 100</li>
49
+ <li>Particles calculate their prime factors upon creation</li>
50
+ <li>Particles with shared prime factors experience attraction</li>
51
+ <li>The strength of attraction increases with more shared factors</li>
52
+ <li>Particle phase affects attraction/repulsion behavior</li>
53
+ </ul>
54
+ <p>
55
+ The visualization creates beautiful emergent patterns as particles form clusters based on their mathematical relationships.
56
+ </p>
57
+ </div>
58
+
59
+ <div class="bg-gray-800 rounded-xl p-8">
60
+ <h2 class="text-2xl font-semibold mb-4 text-purple-300">Controls</h2>
61
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
62
+ <div class="bg-gray-700 p-4 rounded-lg">
63
+ <h3 class="font-semibold mb-2">Distance Settings</h3>
64
+ <p class="text-sm">Adjust min/max distances to control interaction range</p>
65
+ </div>
66
+ <div class="bg-gray-700 p-4 rounded-lg">
67
+ <h3 class="font-semibold mb-2">Force Control</h3>
68
+ <p class="text-sm">Modify attraction/repulsion strength</p>
69
+ </div>
70
+ <div class="bg-gray-700 p-4 rounded-lg">
71
+ <h3 class="font-semibold mb-2">Particle Interaction</h3>
72
+ <p class="text-sm">Click anywhere to add new particles</p>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </main>
78
+
79
+ <!-- Footer -->
80
+ <footer class="bg-gray-800 py-8 mt-12">
81
+ <div class="container mx-auto px-4 text-center">
82
+ <p>QuantumPrimeSync &copy; 2023 - A Mathematical Visualization</p>
83
+ </div>
84
+ </footer>
85
+
86
+ <script>
87
+ feather.replace();
88
+ </script>
89
+ </body>
90
+ </html>
index.html CHANGED
@@ -4,58 +4,107 @@
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>QuantumPrimeSync: Particle Harmony Nexus</title>
7
- <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
  <script src="https://unpkg.com/feather-icons"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  </head>
12
  <body class="bg-gray-900 text-white overflow-hidden">
13
- <div class="absolute top-0 left-0 w-full z-10">
 
14
  <div class="container mx-auto px-4 py-6">
15
  <div class="flex flex-col md:flex-row justify-between items-center">
16
- <h1 class="text-3xl font-bold text-purple-400 mb-4 md:mb-0">QuantumPrimeSync <span class="text-2xl">🌌</span></h1>
17
- <div class="flex items-center space-x-4">
 
 
 
18
  <div class="flex items-center space-x-2">
19
  <span class="text-sm">Particles: <span id="particleCount" class="font-mono">0</span></span>
20
  <button id="addParticle" class="bg-purple-600 hover:bg-purple-700 px-3 py-1 rounded-lg text-sm transition-colors">
21
  <i data-feather="plus"></i>
22
  </button>
23
  </div>
24
- <button id="reset" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded-lg text-sm transition-colors">
25
- <i data-feather="refresh-cw" class="w-4 h-4"></i> Reset
26
  </button>
27
  </div>
28
  </div>
29
  </div>
30
  </div>
31
 
 
32
  <canvas id="particleCanvas" class="w-full h-screen"></canvas>
33
 
34
- <div class="absolute bottom-0 left-0 w-full z-10">
 
35
  <div class="container mx-auto px-4 py-6">
36
- <div class="bg-gray-800 bg-opacity-80 backdrop-blur-sm rounded-xl p-6 max-w-md">
37
- <h2 class="text-xl font-semibold mb-4 text-purple-300">Controls</h2
 
 
38
  <div class="space-y-4">
39
  <div>
40
  <label class="block text-sm font-medium mb-2">Minimum Distance</label>
41
  <input type="range" id="minDist" min="10" max="200" value="50" class="w-full accent-purple-500">
42
- <span id="minDistValue" class="text-xs text-gray-400">50</span>
 
 
 
 
43
  </div>
44
  <div>
45
  <label class="block text-sm font-medium mb-2">Maximum Distance</label>
46
  <input type="range" id="maxDist" min="100" max="500" value="300" class="w-full accent-purple-500">
47
- <span id="maxDistValue" class="text-xs text-gray-400">300</span>
 
 
 
 
48
  </div>
49
  <div>
50
  <label class="block text-sm font-medium mb-2">Attraction Force</label>
51
  <input type="range" id="force" min="0.1" max="2" step="0.1" value="0.5" class="w-full accent-purple-500">
52
- <span id="forceValue" class="text-xs text-gray-400">0.5</span>
 
 
 
 
53
  </div>
54
  </div>
55
  <div class="mt-4 p-3 bg-gray-700 rounded-lg">
56
  <p class="text-sm text-gray-300">Particles have values (2-100) and attract based on shared prime factors!</p>
57
  </div>
58
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  </div>
60
  </div>
61
 
@@ -71,6 +120,21 @@
71
  resizeCanvas();
72
  window.addEventListener('resize', resizeCanvas);
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  // Particle system
75
  class Particle {
76
  constructor(x, y) {
@@ -78,10 +142,15 @@
78
  this.y = y || Math.random() * canvas.height;
79
  this.vx = (Math.random() - 0.5) * 2;
80
  this.vy = (Math.random() - 0.5) * 2;
81
- this.radius = 4;
82
- this.phase = Math.PI + (Math.random() - 0.5) * Math.PI * 0.1; // PI ± 5%
83
  this.hue = (this.phase / (2 * Math.PI)) * 360;
 
 
 
 
84
  }
 
85
  update(particles, minDist, maxDist, force) {
86
  // Apply phase influence from nearby particles
87
  let totalPhase = 0;
@@ -120,11 +189,7 @@
120
  if (distance > 0 && distance < maxDist) {
121
  // Phase-based force
122
  let phaseForce = 0;
123
- if (this.phase === 0) {
124
- phaseForce = 1; // Maximum attraction
125
- } else if (this.phase === 2 * Math.PI) {
126
- phaseForce = -1; // Maximum repulsion
127
- } else if (this.phase < Math.PI) {
128
  phaseForce = 1 - (this.phase / Math.PI); // Decreasing attraction
129
  } else {
130
  phaseForce = -((this.phase - Math.PI) / Math.PI); // Increasing repulsion
@@ -141,7 +206,7 @@
141
  other.primeFactors.includes(factor)
142
  );
143
  if (sharedFactors.length > 0) {
144
- const primeAttraction = sharedFactors.length * 0.1;
145
  const primeFx = (dx / distance) * primeAttraction;
146
  const primeFy = (dy / distance) * primeAttraction;
147
  this.vx += primeFx;
@@ -150,40 +215,78 @@
150
  }
151
  }
152
  });
153
- // Update position with velocity damping
154
- this.vx *= 0.99;
155
- this.vy *= 0.99;
 
156
  this.x += this.vx;
157
  this.y += this.vy;
158
 
159
- // Boundary collision
160
- if (this.x < 0 || this.x > canvas.width) this.vx *= -0.8;
161
- if (this.y < 0 || this.y > canvas.height) this.vy *= -0.8;
 
 
 
 
 
 
162
 
163
- this.x = Math.max(0, Math.min(canvas.width, this.x));
164
- this.y = Math.max(0, Math.min(canvas.height, this.y));
 
 
 
165
  }
 
166
  draw() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  ctx.beginPath();
168
  ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
169
  ctx.fillStyle = `hsl(${this.hue}, 70%, 60%)`;
170
  ctx.fill();
171
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  // Draw phase indicator
173
  ctx.beginPath();
174
- ctx.arc(this.x, this.y, this.radius + 2, 0, this.phase, false);
175
- ctx.strokeStyle = 'white';
176
- ctx.lineWidth = 1;
177
  ctx.stroke();
178
 
179
  // Draw value indicator
180
  ctx.fillStyle = 'white';
181
- ctx.font = '10px Arial';
182
  ctx.textAlign = 'center';
183
  ctx.textBaseline = 'middle';
184
  ctx.fillText(this.value, this.x, this.y);
185
  }
186
- }
187
 
188
  // Initialize particles
189
  let particles = [];
@@ -200,6 +303,7 @@
200
 
201
  // Animation loop
202
  function animate() {
 
203
  ctx.fillStyle = 'rgba(17, 24, 39, 0.1)';
204
  ctx.fillRect(0, 0, canvas.width, canvas.height);
205
 
@@ -238,7 +342,7 @@
238
 
239
  document.getElementById('force').addEventListener('input', (e) => {
240
  force = parseFloat(e.target.value);
241
- document.getElementById('forceValue').textContent = force;
242
  });
243
 
244
  function updateParticleCount() {
@@ -260,4 +364,3 @@
260
  </script>
261
  </body>
262
  </html>
263
-
 
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>QuantumPrimeSync: Particle Harmony Nexus</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
  <script src="https://unpkg.com/feather-icons"></script>
11
+ <style>
12
+ @keyframes pulse {
13
+ 0% { opacity: 0.6; }
14
+ 50% { opacity: 1; }
15
+ 100% { opacity: 0.6; }
16
+ }
17
+ .pulse {
18
+ animation: pulse 2s infinite;
19
+ }
20
+ .particle-trail {
21
+ position: absolute;
22
+ border-radius: 50%;
23
+ pointer-events: none;
24
+ opacity: 0.7;
25
+ }
26
+ </style>
27
  </head>
28
  <body class="bg-gray-900 text-white overflow-hidden">
29
+ <!-- Header -->
30
+ <div class="absolute top-0 left-0 w-full z-20">
31
  <div class="container mx-auto px-4 py-6">
32
  <div class="flex flex-col md:flex-row justify-between items-center">
33
+ <div class="flex items-center mb-4 md:mb-0">
34
+ <h1 class="text-3xl font-bold text-purple-400">QuantumPrimeSync</h1>
35
+ <span class="text-2xl ml-2">🌌</span>
36
+ </div>
37
+ <div class="flex items-center space-x-4">
38
  <div class="flex items-center space-x-2">
39
  <span class="text-sm">Particles: <span id="particleCount" class="font-mono">0</span></span>
40
  <button id="addParticle" class="bg-purple-600 hover:bg-purple-700 px-3 py-1 rounded-lg text-sm transition-colors">
41
  <i data-feather="plus"></i>
42
  </button>
43
  </div>
44
+ <button id="reset" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded-lg text-sm transition-colors flex items-center">
45
+ <i data-feather="refresh-cw" class="w-4 h-4 mr-1"></i> Reset
46
  </button>
47
  </div>
48
  </div>
49
  </div>
50
  </div>
51
 
52
+ <!-- Main Canvas -->
53
  <canvas id="particleCanvas" class="w-full h-screen"></canvas>
54
 
55
+ <!-- Controls Panel -->
56
+ <div class="absolute bottom-0 left-0 w-full z-20">
57
  <div class="container mx-auto px-4 py-6">
58
+ <div class="bg-gray-800 bg-opacity-80 backdrop-blur-sm rounded-xl p-6 max-w-md mx-auto">
59
+ <h2 class="text-xl font-semibold mb-4 text-purple-300 flex items-center">
60
+ <i data-feather="settings" class="mr-2"></i> Controls
61
+ </h2>
62
  <div class="space-y-4">
63
  <div>
64
  <label class="block text-sm font-medium mb-2">Minimum Distance</label>
65
  <input type="range" id="minDist" min="10" max="200" value="50" class="w-full accent-purple-500">
66
+ <div class="flex justify-between text-xs text-gray-400">
67
+ <span>10</span>
68
+ <span id="minDistValue">50</span>
69
+ <span>200</span>
70
+ </div>
71
  </div>
72
  <div>
73
  <label class="block text-sm font-medium mb-2">Maximum Distance</label>
74
  <input type="range" id="maxDist" min="100" max="500" value="300" class="w-full accent-purple-500">
75
+ <div class="flex justify-between text-xs text-gray-400">
76
+ <span>100</span>
77
+ <span id="maxDistValue">300</span>
78
+ <span>500</span>
79
+ </div>
80
  </div>
81
  <div>
82
  <label class="block text-sm font-medium mb-2">Attraction Force</label>
83
  <input type="range" id="force" min="0.1" max="2" step="0.1" value="0.5" class="w-full accent-purple-500">
84
+ <div class="flex justify-between text-xs text-gray-400">
85
+ <span>0.1</span>
86
+ <span id="forceValue">0.5</span>
87
+ <span>2.0</span>
88
+ </div>
89
  </div>
90
  </div>
91
  <div class="mt-4 p-3 bg-gray-700 rounded-lg">
92
  <p class="text-sm text-gray-300">Particles have values (2-100) and attract based on shared prime factors!</p>
93
  </div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
98
+ <!-- Info Panel -->
99
+ <div class="absolute top-20 right-4 z-20">
100
+ <div class="bg-gray-800 bg-opacity-80 backdrop-blur-sm rounded-xl p-4 max-w-xs">
101
+ <h3 class="text-lg font-semibold mb-2 text-purple-300">How it works</h3>
102
+ <ul class="text-sm text-gray-300 space-y-1">
103
+ <li>• Particles have unique values (2-100)</li>
104
+ <li>• They attract when sharing prime factors</li>
105
+ <li>• Phase affects attraction/repulsion</li>
106
+ <li>• Click anywhere to add particles</li>
107
+ </ul>
108
  </div>
109
  </div>
110
 
 
120
  resizeCanvas();
121
  window.addEventListener('resize', resizeCanvas);
122
 
123
+ // Prime factor calculation
124
+ function getPrimeFactors(num) {
125
+ const factors = [];
126
+ let divisor = 2;
127
+ while (num > 1) {
128
+ if (num % divisor === 0) {
129
+ factors.push(divisor);
130
+ num /= divisor;
131
+ } else {
132
+ divisor++;
133
+ }
134
+ }
135
+ return [...new Set(factors)]; // Unique factors only
136
+ }
137
+
138
  // Particle system
139
  class Particle {
140
  constructor(x, y) {
 
142
  this.y = y || Math.random() * canvas.height;
143
  this.vx = (Math.random() - 0.5) * 2;
144
  this.vy = (Math.random() - 0.5) * 2;
145
+ this.radius = 4 + Math.random() * 4;
146
+ this.phase = Math.random() * 2 * Math.PI;
147
  this.hue = (this.phase / (2 * Math.PI)) * 360;
148
+ this.value = Math.floor(Math.random() * 99) + 2; // Values 2-100
149
+ this.primeFactors = getPrimeFactors(this.value);
150
+ this.trail = [];
151
+ this.maxTrailLength = 10;
152
  }
153
+
154
  update(particles, minDist, maxDist, force) {
155
  // Apply phase influence from nearby particles
156
  let totalPhase = 0;
 
189
  if (distance > 0 && distance < maxDist) {
190
  // Phase-based force
191
  let phaseForce = 0;
192
+ if (this.phase < Math.PI) {
 
 
 
 
193
  phaseForce = 1 - (this.phase / Math.PI); // Decreasing attraction
194
  } else {
195
  phaseForce = -((this.phase - Math.PI) / Math.PI); // Increasing repulsion
 
206
  other.primeFactors.includes(factor)
207
  );
208
  if (sharedFactors.length > 0) {
209
+ const primeAttraction = sharedFactors.length * 0.05;
210
  const primeFx = (dx / distance) * primeAttraction;
211
  const primeFy = (dy / distance) * primeAttraction;
212
  this.vx += primeFx;
 
215
  }
216
  }
217
  });
218
+
219
+ // Update position with velocity damping
220
+ this.vx *= 0.98;
221
+ this.vy *= 0.98;
222
  this.x += this.vx;
223
  this.y += this.vy;
224
 
225
+ // Boundary collision with energy loss
226
+ if (this.x < 0 || this.x > canvas.width) {
227
+ this.vx *= -0.8;
228
+ this.x = Math.max(0, Math.min(canvas.width, this.x));
229
+ }
230
+ if (this.y < 0 || this.y > canvas.height) {
231
+ this.vy *= -0.8;
232
+ this.y = Math.max(0, Math.min(canvas.height, this.y));
233
+ }
234
 
235
+ // Update trail
236
+ this.trail.push({x: this.x, y: this.y});
237
+ if (this.trail.length > this.maxTrailLength) {
238
+ this.trail.shift();
239
+ }
240
  }
241
+
242
  draw() {
243
+ // Draw trail
244
+ for (let i = 0; i < this.trail.length - 1; i++) {
245
+ const point = this.trail[i];
246
+ const nextPoint = this.trail[i + 1];
247
+ const alpha = i / this.trail.length;
248
+
249
+ ctx.beginPath();
250
+ ctx.moveTo(point.x, point.y);
251
+ ctx.lineTo(nextPoint.x, nextPoint.y);
252
+ ctx.strokeStyle = `hsla(${this.hue}, 70%, 60%, ${alpha * 0.5})`;
253
+ ctx.lineWidth = 1;
254
+ ctx.stroke();
255
+ }
256
+
257
+ // Draw particle
258
  ctx.beginPath();
259
  ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
260
  ctx.fillStyle = `hsl(${this.hue}, 70%, 60%)`;
261
  ctx.fill();
262
 
263
+ // Draw glow effect
264
+ ctx.beginPath();
265
+ ctx.arc(this.x, this.y, this.radius * 2, 0, 2 * Math.PI);
266
+ const gradient = ctx.createRadialGradient(
267
+ this.x, this.y, this.radius,
268
+ this.x, this.y, this.radius * 2
269
+ );
270
+ gradient.addColorStop(0, `hsla(${this.hue}, 70%, 60%, 0.3)`);
271
+ gradient.addColorStop(1, `hsla(${this.hue}, 70%, 60%, 0)`);
272
+ ctx.fillStyle = gradient;
273
+ ctx.fill();
274
+
275
  // Draw phase indicator
276
  ctx.beginPath();
277
+ ctx.arc(this.x, this.y, this.radius + 3, 0, this.phase, false);
278
+ ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';
279
+ ctx.lineWidth = 1.5;
280
  ctx.stroke();
281
 
282
  // Draw value indicator
283
  ctx.fillStyle = 'white';
284
+ ctx.font = 'bold 12px Arial';
285
  ctx.textAlign = 'center';
286
  ctx.textBaseline = 'middle';
287
  ctx.fillText(this.value, this.x, this.y);
288
  }
289
+ }
290
 
291
  // Initialize particles
292
  let particles = [];
 
303
 
304
  // Animation loop
305
  function animate() {
306
+ // Fade effect for trail
307
  ctx.fillStyle = 'rgba(17, 24, 39, 0.1)';
308
  ctx.fillRect(0, 0, canvas.width, canvas.height);
309
 
 
342
 
343
  document.getElementById('force').addEventListener('input', (e) => {
344
  force = parseFloat(e.target.value);
345
+ document.getElementById('forceValue').textContent = force.toFixed(1);
346
  });
347
 
348
  function updateParticleCount() {
 
364
  </script>
365
  </body>
366
  </html>