p5-phone 1.4.4

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.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +509 -0
  3. package/dist/p5-phone.js +1062 -0
  4. package/dist/p5-phone.min.js +10 -0
  5. package/examples/Phone Sensor Examples/microphone/01_mic_level/index.html +19 -0
  6. package/examples/Phone Sensor Examples/microphone/01_mic_level/sketch.js +117 -0
  7. package/examples/Phone Sensor Examples/movement/01_orientation_basic/index.html +28 -0
  8. package/examples/Phone Sensor Examples/movement/01_orientation_basic/sketch.js +123 -0
  9. package/examples/Phone Sensor Examples/movement/02_rotational_velocity/index.html +28 -0
  10. package/examples/Phone Sensor Examples/movement/02_rotational_velocity/sketch.js +144 -0
  11. package/examples/Phone Sensor Examples/movement/03_acceleration/index.html +28 -0
  12. package/examples/Phone Sensor Examples/movement/03_acceleration/sketch.js +87 -0
  13. package/examples/Phone Sensor Examples/sound/01_dual_audio/index.html +31 -0
  14. package/examples/Phone Sensor Examples/sound/01_dual_audio/sketch.js +225 -0
  15. package/examples/Phone Sensor Examples/sound/01_dual_audio/tracks/audio1.mp3 +0 -0
  16. package/examples/Phone Sensor Examples/sound/01_dual_audio/tracks/audio2.mp3 +0 -0
  17. package/examples/Phone Sensor Examples/sound/02_volume_touches/index.html +31 -0
  18. package/examples/Phone Sensor Examples/sound/02_volume_touches/sketch.js +269 -0
  19. package/examples/Phone Sensor Examples/sound/02_volume_touches/tracks/audio1.mp3 +0 -0
  20. package/examples/Phone Sensor Examples/touch/01_touch_basic/index.html +28 -0
  21. package/examples/Phone Sensor Examples/touch/01_touch_basic/sketch.js +94 -0
  22. package/examples/Phone Sensor Examples/touch/02_touch_zones/index.html +28 -0
  23. package/examples/Phone Sensor Examples/touch/02_touch_zones/sketch.js +220 -0
  24. package/examples/Phone Sensor Examples/touch/03_touch_count/index.html +28 -0
  25. package/examples/Phone Sensor Examples/touch/03_touch_count/sketch.js +93 -0
  26. package/examples/Phone Sensor Examples/touch/04_touch_distance/index.html +28 -0
  27. package/examples/Phone Sensor Examples/touch/04_touch_distance/sketch.js +120 -0
  28. package/examples/Phone Sensor Examples/touch/05_touch_angle/index.html +28 -0
  29. package/examples/Phone Sensor Examples/touch/05_touch_angle/sketch.js +117 -0
  30. package/examples/Phone Sensor Examples - Minimal/microphone/01_mic_level/index.html +19 -0
  31. package/examples/Phone Sensor Examples - Minimal/microphone/01_mic_level/sketch.js +72 -0
  32. package/examples/Phone Sensor Examples - Minimal/movement/01_orientation_basic/index.html +18 -0
  33. package/examples/Phone Sensor Examples - Minimal/movement/01_orientation_basic/sketch.js +51 -0
  34. package/examples/Phone Sensor Examples - Minimal/movement/02_rotational_velocity/index.html +18 -0
  35. package/examples/Phone Sensor Examples - Minimal/movement/02_rotational_velocity/sketch.js +70 -0
  36. package/examples/Phone Sensor Examples - Minimal/movement/03_acceleration/index.html +18 -0
  37. package/examples/Phone Sensor Examples - Minimal/movement/03_acceleration/sketch.js +83 -0
  38. package/examples/Phone Sensor Examples - Minimal/sound/01_sound_basic/index.html +19 -0
  39. package/examples/Phone Sensor Examples - Minimal/sound/01_sound_basic/sketch.js +96 -0
  40. package/examples/Phone Sensor Examples - Minimal/sound/01_sound_basic/tracks/audio1.mp3 +0 -0
  41. package/examples/Phone Sensor Examples - Minimal/sound/02_sound_amplitude/index.html +19 -0
  42. package/examples/Phone Sensor Examples - Minimal/sound/02_sound_amplitude/sketch.js +118 -0
  43. package/examples/Phone Sensor Examples - Minimal/sound/02_sound_amplitude/tracks/audio1.mp3 +0 -0
  44. package/examples/Phone Sensor Examples - Minimal/touch/01_touch_basic/index.html +18 -0
  45. package/examples/Phone Sensor Examples - Minimal/touch/01_touch_basic/sketch.js +58 -0
  46. package/examples/Phone Sensor Examples - Minimal/touch/02_touch_zones/index.html +18 -0
  47. package/examples/Phone Sensor Examples - Minimal/touch/02_touch_zones/sketch.js +78 -0
  48. package/examples/Phone Sensor Examples - Minimal/touch/03_touch_count/index.html +18 -0
  49. package/examples/Phone Sensor Examples - Minimal/touch/03_touch_count/sketch.js +64 -0
  50. package/examples/Phone Sensor Examples - Minimal/touch/04_touch_distance/index.html +18 -0
  51. package/examples/Phone Sensor Examples - Minimal/touch/04_touch_distance/sketch.js +69 -0
  52. package/examples/Phone Sensor Examples - Minimal/touch/05_touch_angle/index.html +18 -0
  53. package/examples/Phone Sensor Examples - Minimal/touch/05_touch_angle/sketch.js +85 -0
  54. package/examples/Phone and Gif/collision/README.md +31 -0
  55. Gif/collision/gifs/spaceSuit2.png +0 -0
  56. package/examples/Phone and Gif/collision/index.html +19 -0
  57. package/examples/Phone and Gif/collision/sketch.js +226 -0
  58. Gif/fetch/gifs/corgiswimflip.gif +0 -0
  59. package/examples/Phone and Gif/fetch/index.html +18 -0
  60. package/examples/Phone and Gif/fetch/sketch.js +139 -0
  61. Gif/fly/gifs/comparison.gif +0 -0
  62. package/examples/Phone and Gif/fly/index.html +18 -0
  63. package/examples/Phone and Gif/fly/sketch.js +103 -0
  64. Gif/roll/gifs/how-penciles-are-made.gif +0 -0
  65. package/examples/Phone and Gif/roll/index.html +18 -0
  66. package/examples/Phone and Gif/roll/sketch.js +121 -0
  67. package/examples/UXcompare/button-vs-movement/index.html +45 -0
  68. package/examples/UXcompare/button-vs-movement/sketch.js +355 -0
  69. package/examples/UXcompare/button-vs-orientation/index.html +25 -0
  70. package/examples/UXcompare/button-vs-orientation/sketch.js +317 -0
  71. package/examples/UXcompare/button-vs-shake/index.html +45 -0
  72. package/examples/UXcompare/button-vs-shake/sketch.js +320 -0
  73. package/examples/UXcompare/gyroscope-demo/index.html +78 -0
  74. package/examples/UXcompare/gyroscope-demo/sketch.js +166 -0
  75. package/examples/UXcompare/index.html +419 -0
  76. package/examples/UXcompare/microphone-demo/index.html +79 -0
  77. package/examples/UXcompare/microphone-demo/sketch.js +210 -0
  78. package/examples/UXcompare/slider-vs-angle/index.html +25 -0
  79. package/examples/UXcompare/slider-vs-angle/sketch.js +429 -0
  80. package/examples/UXcompare/slider-vs-distance/index.html +25 -0
  81. package/examples/UXcompare/slider-vs-distance/sketch.js +401 -0
  82. package/examples/UXcompare/slider-vs-microphone/index.html +26 -0
  83. package/examples/UXcompare/slider-vs-microphone/sketch.js +336 -0
  84. package/examples/UXcompare/slider-vs-touches/index.html +25 -0
  85. package/examples/UXcompare/slider-vs-touches/sketch.js +376 -0
  86. package/examples/UXcompare/sliders-vs-acceleration/index.html +25 -0
  87. package/examples/UXcompare/sliders-vs-acceleration/sketch.js +361 -0
  88. package/examples/UXcompare/sliders-vs-rotation/index.html +25 -0
  89. package/examples/UXcompare/sliders-vs-rotation/sketch.js +375 -0
  90. package/examples/blankTemplate/index.html +31 -0
  91. package/examples/blankTemplate/sketch.js +55 -0
  92. package/examples/homepage/index.html +506 -0
  93. package/package.json +73 -0
  94. package/src/p5-phone.js +1062 -0
  95. package/src/permissionMic.js +240 -0
  96. package/src/permissionsGesture.js +213 -0
  97. package/src/permissionsGyro.js +246 -0
@@ -0,0 +1,419 @@
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>Mobile p5.js Permission Examples</title>
7
+ <script src="https://cdn.jsdelivr.net/npm/qrious@4.0.2/dist/qrious.min.js"></script>
8
+ <style>
9
+ * {
10
+ margin: 0;
11
+ padding: 0;
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ body {
16
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
17
+ line-height: 1.5;
18
+ color: #1a1a1a;
19
+ background: #ffffff;
20
+ min-height: 100vh;
21
+ }
22
+
23
+ .container {
24
+ max-width: 1000px;
25
+ margin: 0 auto;
26
+ }
27
+
28
+ .header {
29
+ padding: 60px 30px 40px 30px;
30
+ border-bottom: 1px solid #e5e5e5;
31
+ }
32
+
33
+ .header h1 {
34
+ font-size: 2.5rem;
35
+ font-weight: 400;
36
+ margin-bottom: 8px;
37
+ letter-spacing: -0.02em;
38
+ }
39
+
40
+ .header p {
41
+ font-size: 1.1rem;
42
+ color: #6b7280;
43
+ font-weight: 300;
44
+ }
45
+
46
+ .content {
47
+ padding: 50px 30px;
48
+ }
49
+
50
+ .section {
51
+ margin-bottom: 60px;
52
+ }
53
+
54
+ .section h2 {
55
+ font-size: 1.8rem;
56
+ font-weight: 500;
57
+ color: #1a1a1a;
58
+ margin-bottom: 8px;
59
+ letter-spacing: -0.01em;
60
+ }
61
+
62
+ .section > p {
63
+ color: #6b7280;
64
+ margin-bottom: 40px;
65
+ font-size: 1rem;
66
+ }
67
+
68
+ .section h3 {
69
+ font-size: 1.3rem;
70
+ font-weight: 500;
71
+ color: #1a1a1a;
72
+ margin: 40px 0 25px 0;
73
+ letter-spacing: -0.01em;
74
+ }
75
+
76
+ .examples-grid {
77
+ display: grid;
78
+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
79
+ gap: 24px;
80
+ margin-bottom: 40px;
81
+ }
82
+
83
+ .example-card {
84
+ background: #ffffff;
85
+ border: 1px solid #e5e5e5;
86
+ border-radius: 8px;
87
+ padding: 24px;
88
+ transition: border-color 0.2s ease;
89
+ }
90
+
91
+ .example-card:hover {
92
+ border-color: #d1d5db;
93
+ }
94
+
95
+ .example-title {
96
+ font-size: 1.1rem;
97
+ font-weight: 500;
98
+ color: #1a1a1a;
99
+ margin-bottom: 8px;
100
+ }
101
+
102
+ .example-description {
103
+ color: #6b7280;
104
+ margin-bottom: 20px;
105
+ font-size: 0.95rem;
106
+ line-height: 1.4;
107
+ }
108
+
109
+ .example-links {
110
+ display: flex;
111
+ flex-direction: column;
112
+ gap: 12px;
113
+ }
114
+
115
+ .link-row {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 16px;
119
+ }
120
+
121
+ .demo-link {
122
+ display: inline-block;
123
+ padding: 8px 16px;
124
+ background: #1a1a1a;
125
+ color: #ffffff;
126
+ text-decoration: none;
127
+ border-radius: 4px;
128
+ font-weight: 400;
129
+ font-size: 0.9rem;
130
+ transition: background 0.2s ease;
131
+ flex: 1;
132
+ text-align: center;
133
+ touch-action: manipulation;
134
+ }
135
+
136
+ .demo-link:hover {
137
+ background: #374151;
138
+ }
139
+
140
+ .qr-code {
141
+ width: 80px;
142
+ height: 80px;
143
+ border: 1px solid #e5e5e5;
144
+ border-radius: 4px;
145
+ flex-shrink: 0;
146
+ }
147
+
148
+ .footer {
149
+ border-top: 1px solid #e5e5e5;
150
+ padding: 40px 30px;
151
+ text-align: center;
152
+ }
153
+
154
+ .footer p {
155
+ color: #6b7280;
156
+ font-size: 0.9rem;
157
+ }
158
+
159
+ .footer a {
160
+ color: #1a1a1a;
161
+ text-decoration: none;
162
+ }
163
+
164
+ .footer a:hover {
165
+ text-decoration: underline;
166
+ }
167
+
168
+ @media (max-width: 768px) {
169
+ .header {
170
+ padding: 40px 20px 30px 20px;
171
+ }
172
+
173
+ .header h1 {
174
+ font-size: 2rem;
175
+ }
176
+
177
+ .header p {
178
+ font-size: 1rem;
179
+ }
180
+
181
+ .content {
182
+ padding: 40px 20px;
183
+ }
184
+
185
+ .section h2 {
186
+ font-size: 1.5rem;
187
+ }
188
+
189
+ .examples-grid {
190
+ grid-template-columns: 1fr;
191
+ gap: 20px;
192
+ }
193
+
194
+ .link-row {
195
+ flex-direction: row;
196
+ align-items: center;
197
+ gap: 16px;
198
+ }
199
+
200
+ .demo-link {
201
+ padding: 10px 14px;
202
+ font-size: 0.85rem;
203
+ }
204
+
205
+ .qr-code {
206
+ width: 70px;
207
+ height: 70px;
208
+ }
209
+
210
+ .footer {
211
+ padding: 30px 20px;
212
+ }
213
+ }
214
+ </style>
215
+ </head>
216
+ <body>
217
+ <div class="container">
218
+ <div class="header">
219
+ <h1>Mobile p5.js Permission Examples</h1>
220
+ <p>Interactive examples demonstrating mobile device capabilities vs traditional UI patterns</p>
221
+ </div>
222
+
223
+ <div class="content">
224
+ <!-- UX Comparison Section -->
225
+ <div class="section">
226
+ <h2>UX Comparison</h2>
227
+ <p>These examples demonstrate the difference between traditional UI interactions and mobile device capabilities.</p>
228
+
229
+ <!-- Button Examples -->
230
+ <h3>Button Examples</h3>
231
+ <div class="examples-grid">
232
+ <div class="example-card">
233
+ <div class="example-title">Button vs Shake Detection</div>
234
+ <div class="example-description">Compare clicking a button vs shaking your device to trigger actions.</div>
235
+ <div class="example-links">
236
+ <div class="link-row">
237
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-shake/" class="demo-link" target="_blank">Try Demo</a>
238
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-shake/"></canvas>
239
+ </div>
240
+ </div>
241
+ </div>
242
+
243
+ <div class="example-card">
244
+ <div class="example-title">Button vs Movement Detection</div>
245
+ <div class="example-description">Compare button clicks vs device movement for interaction control.</div>
246
+ <div class="example-links">
247
+ <div class="link-row">
248
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-movement/" class="demo-link" target="_blank">Try Demo</a>
249
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-movement/"></canvas>
250
+ </div>
251
+ </div>
252
+ </div>
253
+
254
+ <div class="example-card">
255
+ <div class="example-title">Button vs Orientation</div>
256
+ <div class="example-description">Compare button interface vs device orientation for control.</div>
257
+ <div class="example-links">
258
+ <div class="link-row">
259
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-orientation/" class="demo-link" target="_blank">Try Demo</a>
260
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/button-vs-orientation/"></canvas>
261
+ </div>
262
+ </div>
263
+ </div>
264
+ </div>
265
+
266
+ <!-- Slider Examples -->
267
+ <h3>Slider Examples</h3>
268
+ <div class="examples-grid">
269
+ <div class="example-card">
270
+ <div class="example-title">Sliders vs Device Rotation</div>
271
+ <div class="example-description">RGB color control: traditional sliders vs device rotation.</div>
272
+ <div class="example-links">
273
+ <div class="link-row">
274
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/sliders-vs-rotation/" class="demo-link" target="_blank">Try Demo</a>
275
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/sliders-vs-rotation/"></canvas>
276
+ </div>
277
+ </div>
278
+ </div>
279
+
280
+ <div class="example-card">
281
+ <div class="example-title">Sliders vs Device Acceleration</div>
282
+ <div class="example-description">RGB color control: traditional sliders vs device acceleration.</div>
283
+ <div class="example-links">
284
+ <div class="link-row">
285
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/sliders-vs-acceleration/" class="demo-link" target="_blank">Try Demo</a>
286
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/sliders-vs-acceleration/"></canvas>
287
+ </div>
288
+ </div>
289
+ </div>
290
+
291
+ <div class="example-card">
292
+ <div class="example-title">Slider vs Microphone</div>
293
+ <div class="example-description">Volume control: traditional slider vs microphone input level.</div>
294
+ <div class="example-links">
295
+ <div class="link-row">
296
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-microphone/" class="demo-link" target="_blank">Try Demo</a>
297
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-microphone/"></canvas>
298
+ </div>
299
+ </div>
300
+ </div>
301
+
302
+ <div class="example-card">
303
+ <div class="example-title">Slider vs Multi-Touch</div>
304
+ <div class="example-description">Value control: single slider vs multiple finger touches.</div>
305
+ <div class="example-links">
306
+ <div class="link-row">
307
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-touches/" class="demo-link" target="_blank">Try Demo</a>
308
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-touches/"></canvas>
309
+ </div>
310
+ </div>
311
+ </div>
312
+
313
+ <div class="example-card">
314
+ <div class="example-title">Slider vs Distance</div>
315
+ <div class="example-description">Value control: traditional slider vs finger distance measurement.</div>
316
+ <div class="example-links">
317
+ <div class="link-row">
318
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-distance/" class="demo-link" target="_blank">Try Demo</a>
319
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-distance/"></canvas>
320
+ </div>
321
+ </div>
322
+ </div>
323
+
324
+ <div class="example-card">
325
+ <div class="example-title">Slider vs Angle Control</div>
326
+ <div class="example-description">Value control: linear slider vs multi-touch angle detection.</div>
327
+ <div class="example-links">
328
+ <div class="link-row">
329
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-angle/" class="demo-link" target="_blank">Try Demo</a>
330
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/slider-vs-angle/"></canvas>
331
+ </div>
332
+ </div>
333
+ </div>
334
+ </div>
335
+ </div>
336
+
337
+ <!-- Other Demos Section -->
338
+ <div class="section">
339
+ <h2>Other Demos</h2>
340
+ <p>Additional examples showcasing mobile device capabilities.</p>
341
+
342
+ <div class="examples-grid">
343
+ <div class="example-card">
344
+ <div class="example-title">Multi-Touch Drawing</div>
345
+ <div class="example-description">Draw with multiple fingers simultaneously - each finger gets its own color trail.</div>
346
+ <div class="example-links">
347
+ <div class="link-row">
348
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/basic-touch/" class="demo-link" target="_blank">Try Demo</a>
349
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/basic-touch/"></canvas>
350
+ </div>
351
+ </div>
352
+ </div>
353
+
354
+ <div class="example-card">
355
+ <div class="example-title">Microphone Demo</div>
356
+ <div class="example-description">Interactive audio visualization using device microphone input.</div>
357
+ <div class="example-links">
358
+ <div class="link-row">
359
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/microphone-demo/" class="demo-link" target="_blank">Try Demo</a>
360
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/microphone-demo/"></canvas>
361
+ </div>
362
+ </div>
363
+ </div>
364
+
365
+ <div class="example-card">
366
+ <div class="example-title">Gyroscope Demo</div>
367
+ <div class="example-description">Tilt-based game using device orientation and motion sensors.</div>
368
+ <div class="example-links">
369
+ <div class="link-row">
370
+ <a href="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/gyroscope-demo/" class="demo-link" target="_blank">Try Demo</a>
371
+ <canvas class="qr-code" data-url="https://digitalfuturesocadu.github.io/mobile-p5-permissions/examples/gyroscope-demo/"></canvas>
372
+ </div>
373
+ </div>
374
+ </div>
375
+ </div>
376
+ </div>
377
+ </div>
378
+
379
+ <div class="footer">
380
+ <p>Built with <a href="https://p5js.org/" target="_blank">p5.js</a> •
381
+ <a href="https://github.com/DigitalFuturesOCADU/mobile-p5-permissions" target="_blank">View Source on GitHub</a></p>
382
+ </div>
383
+ </div>
384
+
385
+ <script>
386
+ // Generate QR codes for all demo links
387
+ document.addEventListener('DOMContentLoaded', function() {
388
+ // Check if QRious library is available
389
+ if (typeof QRious === 'undefined') {
390
+ console.error('QRious library failed to load');
391
+ // Hide QR code elements if library didn't load
392
+ const qrElements = document.querySelectorAll('.qr-code');
393
+ qrElements.forEach(canvas => {
394
+ canvas.style.display = 'none';
395
+ });
396
+ return;
397
+ }
398
+
399
+ const qrElements = document.querySelectorAll('.qr-code');
400
+
401
+ qrElements.forEach(canvas => {
402
+ const url = canvas.getAttribute('data-url');
403
+ try {
404
+ new QRious({
405
+ element: canvas,
406
+ value: url,
407
+ size: 80,
408
+ foreground: '#1a1a1a',
409
+ background: '#ffffff'
410
+ });
411
+ } catch(error) {
412
+ console.error('QR Code generation error:', error);
413
+ canvas.style.display = 'none';
414
+ }
415
+ });
416
+ });
417
+ </script>
418
+ </body>
419
+ </html>
@@ -0,0 +1,79 @@
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, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
8
+ <title>Sound Visualizer</title>
9
+
10
+ <style>
11
+ * {
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: border-box;
15
+ -webkit-user-select: none;
16
+ user-select: none;
17
+ -webkit-tap-highlight-color: transparent;
18
+ -webkit-touch-callout: none;
19
+ }
20
+
21
+ html, body {
22
+ width: 100%;
23
+ height: 100%;
24
+ overflow: hidden;
25
+ position: fixed;
26
+ touch-action: none;
27
+ background: #000;
28
+ }
29
+
30
+ canvas {
31
+ display: block;
32
+ position: fixed;
33
+ left: 0;
34
+ top: 0;
35
+ }
36
+
37
+ #startButton {
38
+ position: fixed;
39
+ top: 50%;
40
+ left: 50%;
41
+ transform: translate(-50%, -50%);
42
+ padding: 40px 60px;
43
+ font-size: 24px;
44
+ font-weight: bold;
45
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
46
+ color: white;
47
+ border: none;
48
+ border-radius: 20px;
49
+ cursor: pointer;
50
+ z-index: 10000;
51
+ }
52
+
53
+ #statusText {
54
+ position: fixed;
55
+ top: 60%;
56
+ left: 50%;
57
+ transform: translate(-50%, 0);
58
+ color: white;
59
+ font-family: Arial, sans-serif;
60
+ text-align: center;
61
+ z-index: 9999;
62
+ }
63
+
64
+ .hidden {
65
+ display: none;
66
+ }
67
+ </style>
68
+
69
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
70
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js"></script>
71
+ <script src="https://cdn.jsdelivr.net/npm/mobile-p5-permissions@1.4.4/dist/p5.mobile-permissions.min.js"></script>
72
+ </head>
73
+ <body>
74
+ <button id="startButton">START VISUALIZER</button>
75
+ <div id="statusText" class="hidden">Requesting microphone...</div>
76
+
77
+ <script src="sketch.js"></script>
78
+ </body>
79
+ </html>