MatteoScript commited on
Commit
3cedbca
·
verified ·
1 Parent(s): f5f9ef2

Update ar.html

Browse files
Files changed (1) hide show
  1. ar.html +198 -67
ar.html CHANGED
@@ -2,15 +2,12 @@
2
  <html lang="it">
3
  <head>
4
  <meta charset="UTF-8" />
5
- <!-- Viewport ottimizzato per mobile: blocco totale dello zoom e gestione notch -->
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
7
  <title>AR Neural Link | Vertical Native</title>
8
 
9
- <!-- Tailwind & Fonts -->
10
  <script src="https://cdn.tailwindcss.com"></script>
11
  <link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap" rel="stylesheet">
12
 
13
- <!-- AR Libraries -->
14
  <script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
15
  <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.2/dist/mindar-image.prod.js"></script>
16
  <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.2/dist/mindar-image-aframe.prod.js"></script>
@@ -22,40 +19,54 @@
22
  --error-red: #ff0055;
23
  }
24
 
25
- /* Reset totale per comportamento "App Nativa" */
26
  html, body {
27
  margin: 0;
28
  padding: 0;
29
  width: 100%;
30
  height: 100%;
31
- background-color: transparent !important; /* Importante per vedere la camera */
32
  font-family: 'Fira Code', monospace;
33
- overflow: hidden; /* Blocca scroll elastico su iOS */
34
- position: fixed; /* Blocca il body in posizione */
35
  }
36
 
37
  /* --- ENGINE GRAFICO (Camera e Canvas) --- */
38
 
39
- /* 1. Video Webcam: Forziamo il riempimento verticale */
40
  video {
41
- position: absolute !important;
42
- top: 0; left: 0; right: 0; bottom: 0;
43
- width: 100% !important;
44
- height: 100% !important;
45
- object-fit: cover !important; /* Questo è il segreto per il full screen 9:16 */
 
 
 
46
  z-index: -2 !important;
 
 
47
  }
48
 
49
- /* 2. Canvas AR: Sovrapposto perfettamente */
50
  .a-canvas {
51
- width: 100% !important;
52
- height: 100% !important;
53
- position: absolute !important;
54
- top: 0; left: 0;
 
55
  z-index: -1 !important;
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
- /* FX: Scanlines (Ottimizzate per mobile) */
59
  .scanlines {
60
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
61
  background-size: 100% 4px;
@@ -64,7 +75,6 @@
64
  opacity: 0.4;
65
  }
66
 
67
- /* UI Elements */
68
  .tech-border {
69
  border: 1px solid var(--neon-green);
70
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
@@ -74,7 +84,6 @@
74
 
75
  .a-enter-vr-button { display: none !important; }
76
 
77
- /* --- LOADER STYLE --- */
78
  #custom-loader {
79
  position: fixed; inset: 0; z-index: 9999;
80
  background: #000;
@@ -104,11 +113,37 @@
104
  box-shadow: 0 0 10px var(--neon-green);
105
  }
106
 
107
- /* Safe area per iPhone nuovi */
108
  .safe-area-y {
109
  padding-top: env(safe-area-inset-top, 20px);
110
  padding-bottom: env(safe-area-inset-bottom, 20px);
111
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  </style>
113
  </head>
114
  <body>
@@ -118,7 +153,7 @@
118
  <div class="text-[#00ff41] text-5xl font-black tracking-tighter glitch-text mb-4">
119
  LINK<br>START
120
  </div>
121
- <div class="text-white/50 text-xs font-mono uppercase tracking-[0.2em] mb-2">Initializing AR Core...</div>
122
  <div class="loader-track"><div class="loader-fill" id="progress-bar"></div></div>
123
  <div id="loading-percent" class="text-[#00ff41] font-mono text-xl mt-2 font-bold">0%</div>
124
  </div>
@@ -126,31 +161,29 @@
126
  <!-- 2. FX -->
127
  <div class="scanlines"></div>
128
 
129
- <!-- 3. UI LAYER (Vertical Native) -->
130
  <div id="ui-layer" class="fixed inset-0 z-[50] flex flex-col justify-between safe-area-y pointer-events-none">
131
 
132
  <!-- TOP HEADER -->
133
  <div class="w-full px-6 py-4 flex justify-between items-center bg-gradient-to-b from-black/80 to-transparent pointer-events-auto">
134
  <div class="flex flex-col">
135
- <span class="text-[10px] text-white/60 font-mono tracking-widest">SYSTEM</span>
136
- <span id="sys-status" class="text-[#00ff41] font-bold text-lg tracking-wider animate-pulse">SCANNING</span>
 
137
  </div>
138
  <a href="./index.html" class="w-10 h-10 flex items-center justify-center border border-[#00ff41]/50 rounded-full bg-black/40 backdrop-blur-md active:scale-95 transition-transform">
139
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#00ff41" stroke-width="2"><path d="M18 6L6 18M6 6l12 12"/></svg>
140
  </a>
141
  </div>
142
 
143
- <!-- MIRINO (Adattato per Verticale) -->
144
  <div id="aim-overlay" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center transition-opacity duration-300">
145
- <!-- Frame Rettangolare Verticale (9:16 approx) -->
146
  <div class="relative w-[65vw] h-[100vw] max-w-[300px] max-h-[500px] border border-white/20 rounded-xl">
147
- <!-- Angoli Tech -->
148
  <div class="absolute -top-1 -left-1 w-6 h-6 border-t-4 border-l-4 border-[#00ff41]"></div>
149
  <div class="absolute -top-1 -right-1 w-6 h-6 border-t-4 border-r-4 border-[#00ff41]"></div>
150
  <div class="absolute -bottom-1 -left-1 w-6 h-6 border-b-4 border-l-4 border-[#00ff41]"></div>
151
  <div class="absolute -bottom-1 -right-1 w-6 h-6 border-b-4 border-r-4 border-[#00ff41]"></div>
152
 
153
- <!-- Mirino centrale -->
154
  <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full flex items-center justify-center">
155
  <div class="w-12 h-[1px] bg-[#00ff41]/50"></div>
156
  <div class="h-12 w-[1px] bg-[#00ff41]/50 absolute"></div>
@@ -163,19 +196,41 @@
163
 
164
  <!-- BOTTOM CONTROLS -->
165
  <div class="w-full px-6 pb-8 pointer-events-auto flex flex-col items-center bg-gradient-to-t from-black/90 to-transparent">
166
- <!-- Pulsante Audio Enorme (Pollice friendly) -->
167
- <button id="audio-btn" class="w-full max-w-sm py-5 bg-[#00ff41]/10 border border-[#00ff41] text-[#00ff41] font-bold text-lg uppercase tracking-[0.2em] rounded active:bg-[#00ff41] active:text-black transition-all mb-4 flex items-center justify-center gap-3 backdrop-blur-md">
168
  <span>🔊</span>
169
  <span id="audio-text">Attiva Audio</span>
170
  </button>
171
- <div class="text-[10px] text-white/40 font-mono">NEURAL_LINK v2.4.0 // VERTICAL_MODE</div>
 
 
 
 
 
 
 
 
 
 
 
172
  </div>
173
  </div>
174
 
175
- <!-- 4. AR SCENE (VERTICAL SETUP) -->
176
- <!-- Nota: missTolerance aumentato per mantenere il tracking più stabile mentre ci si muove -->
 
 
 
 
 
 
 
 
 
 
 
177
  <a-scene
178
- mindar-image="imageTargetSrc: img/targets.mind; filterMinCF:0.0001; filterBeta: 0.001; uiLoading: no; uiScanning: no; missTolerance: 10; warmupTolerance: 5"
179
  color-space="sRGB"
180
  renderer="colorManagement: true, physicallyCorrectLights, highRefreshRate: true"
181
  vr-mode-ui="enabled: false"
@@ -188,36 +243,34 @@
188
  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
189
 
190
  <a-entity id="example-target" mindar-image-target="targetIndex: 0">
191
- <!--
192
- GEOMETRIA VERTICALE (9:16)
193
- Width: 1 (Largo quanto il target fisico)
194
- Height: 1.777 (Proporzione 16:9 in verticale, cioè 1 * 16 / 9)
195
- Questo forza il video ad apparire come uno schermo smartphone verticale fluttuante.
196
- -->
197
  <a-entity id="myVid"
198
- geometry="primitive: plane; width: 1; height: 1.777"
199
  material="src: #vid; shader: flat; transparent: true; opacity: 1"
200
  position="0 0 0">
201
  </a-entity>
202
 
203
- <!-- Cornice Cyberpunk Verticale -->
204
- <!-- Top Bar -->
205
- <a-plane position="0 0.9 0" width="1.05" height="0.02" color="#00ff41" material="shader: flat"></a-plane>
206
- <!-- Bottom Bar -->
207
- <a-plane position="0 -0.9 0" width="1.05" height="0.02" color="#00ff41" material="shader: flat"></a-plane>
208
- <!-- Left Bar -->
209
- <a-plane position="-0.52 0 0" width="0.02" height="1.8" color="#00ff41" material="shader: flat"></a-plane>
210
- <!-- Right Bar -->
211
- <a-plane position="0.52 0 0" width="0.02" height="1.8" color="#00ff41" material="shader: flat"></a-plane>
212
 
213
- <!-- Elementi decorativi agli angoli -->
214
- <a-plane position="-0.52 0.9 0" width="0.1" height="0.02" color="white" material="shader: flat"></a-plane>
215
- <a-plane position="0.52 -0.9 0" width="0.1" height="0.02" color="white" material="shader: flat"></a-plane>
216
-
 
 
 
217
  </a-entity>
218
  </a-scene>
219
 
220
- <!-- 5. LOGIC -->
221
  <script>
222
  const video = document.querySelector("#vid");
223
  const target = document.querySelector("#example-target");
@@ -229,24 +282,73 @@
229
  const loadingPercent = document.querySelector("#loading-percent");
230
  const progressBar = document.querySelector("#progress-bar");
231
  const scene = document.querySelector("a-scene");
 
 
 
 
 
232
 
233
  let isAudioEnabled = false;
234
  let loadProgress = 0;
235
 
236
- // Simulazione caricamento rapido
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  const loadInterval = setInterval(() => {
238
  loadProgress += 2;
239
  if(loadProgress > 100) loadProgress = 100;
240
  loadingPercent.innerText = loadProgress + "%";
241
  progressBar.style.width = loadProgress + "%";
242
 
243
- if(loadProgress >= 100) clearInterval(loadInterval);
 
 
 
 
 
 
 
 
244
  }, 30);
245
 
246
  // AR PRONTA
247
  scene.addEventListener("arReady", () => {
248
- console.log("AR System Ready");
249
- // Chiudi loader
250
  setTimeout(() => {
251
  loader.style.opacity = "0";
252
  setTimeout(() => loader.style.display = "none", 500);
@@ -255,24 +357,27 @@
255
 
256
  // ERROR HANDLING
257
  scene.addEventListener("arError", (ev) => {
258
- alert("Errore fotocamera: controlla i permessi!");
 
259
  });
260
 
261
  // TARGET FOUND
262
  target.addEventListener("targetFound", () => {
263
- console.log("Found");
264
  video.play();
265
- statusText.innerText = "LOCKED";
266
  statusText.style.color = "#fff";
267
  statusText.classList.remove("animate-pulse");
268
  aimOverlay.style.opacity = "0";
 
 
269
  });
270
 
271
  // TARGET LOST
272
  target.addEventListener("targetLost", () => {
273
- console.log("Lost");
274
  video.pause();
275
- statusText.innerText = "SEARCHING";
276
  statusText.style.color = "#00ff41";
277
  statusText.classList.add("animate-pulse");
278
  aimOverlay.style.opacity = "1";
@@ -282,12 +387,14 @@
282
  audioBtn.addEventListener('click', () => {
283
  if (!isAudioEnabled) {
284
  video.muted = false;
 
285
  isAudioEnabled = true;
286
  audioText.innerText = "AUDIO ON";
287
  audioBtn.classList.add("bg-[#00ff41]", "text-black");
288
  audioBtn.classList.remove("bg-[#00ff41]/10", "text-[#00ff41]");
289
 
290
- // Feedback aptico (vibrazione) se supportato
 
291
  if(navigator.vibrate) navigator.vibrate(50);
292
 
293
  setTimeout(() => {
@@ -296,6 +403,30 @@
296
  }, 1500);
297
  }
298
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  </script>
300
  </body>
301
  </html>
 
2
  <html lang="it">
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
  <title>AR Neural Link | Vertical Native</title>
7
 
 
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap" rel="stylesheet">
10
 
 
11
  <script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
12
  <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.2/dist/mindar-image.prod.js"></script>
13
  <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.2/dist/mindar-image-aframe.prod.js"></script>
 
19
  --error-red: #ff0055;
20
  }
21
 
 
22
  html, body {
23
  margin: 0;
24
  padding: 0;
25
  width: 100%;
26
  height: 100%;
27
+ background-color: transparent !important;
28
  font-family: 'Fira Code', monospace;
29
+ overflow: hidden;
30
+ position: fixed;
31
  }
32
 
33
  /* --- ENGINE GRAFICO (Camera e Canvas) --- */
34
 
 
35
  video {
36
+ position: fixed !important;
37
+ top: 0 !important;
38
+ left: 0 !important;
39
+ width: 100vw !important;
40
+ height: 100vh !important;
41
+ min-width: 100vw !important;
42
+ min-height: 100vh !important;
43
+ object-fit: cover !important;
44
  z-index: -2 !important;
45
+ margin: 0 !important;
46
+ padding: 0 !important;
47
  }
48
 
 
49
  .a-canvas {
50
+ position: fixed !important;
51
+ top: 0 !important;
52
+ left: 0 !important;
53
+ width: 100vw !important;
54
+ height: 100vh !important;
55
  z-index: -1 !important;
56
+ margin: 0 !important;
57
+ padding: 0 !important;
58
+ }
59
+
60
+ .a-scene {
61
+ position: fixed !important;
62
+ top: 0 !important;
63
+ left: 0 !important;
64
+ width: 100vw !important;
65
+ height: 100vh !important;
66
+ margin: 0 !important;
67
+ padding: 0 !important;
68
  }
69
 
 
70
  .scanlines {
71
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
72
  background-size: 100% 4px;
 
75
  opacity: 0.4;
76
  }
77
 
 
78
  .tech-border {
79
  border: 1px solid var(--neon-green);
80
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
 
84
 
85
  .a-enter-vr-button { display: none !important; }
86
 
 
87
  #custom-loader {
88
  position: fixed; inset: 0; z-index: 9999;
89
  background: #000;
 
113
  box-shadow: 0 0 10px var(--neon-green);
114
  }
115
 
 
116
  .safe-area-y {
117
  padding-top: env(safe-area-inset-top, 20px);
118
  padding-bottom: env(safe-area-inset-bottom, 20px);
119
  }
120
+
121
+ /* FALLBACK VIDEO PLAYER */
122
+ #fallback-player {
123
+ position: fixed;
124
+ top: 50%;
125
+ left: 50%;
126
+ transform: translate(-50%, -50%);
127
+ width: 90%;
128
+ max-width: 500px;
129
+ z-index: 1000;
130
+ background: rgba(0,0,0,0.95);
131
+ border: 2px solid var(--neon-green);
132
+ border-radius: 12px;
133
+ padding: 20px;
134
+ display: none;
135
+ box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
136
+ }
137
+
138
+ #fallback-player video {
139
+ position: relative !important;
140
+ width: 100% !important;
141
+ height: auto !important;
142
+ min-width: auto !important;
143
+ min-height: auto !important;
144
+ border-radius: 8px;
145
+ margin-bottom: 15px;
146
+ }
147
  </style>
148
  </head>
149
  <body>
 
153
  <div class="text-[#00ff41] text-5xl font-black tracking-tighter glitch-text mb-4">
154
  LINK<br>START
155
  </div>
156
+ <div class="text-white/50 text-xs font-mono uppercase tracking-[0.2em] mb-2" id="load-msg">Initializing AR Core...</div>
157
  <div class="loader-track"><div class="loader-fill" id="progress-bar"></div></div>
158
  <div id="loading-percent" class="text-[#00ff41] font-mono text-xl mt-2 font-bold">0%</div>
159
  </div>
 
161
  <!-- 2. FX -->
162
  <div class="scanlines"></div>
163
 
164
+ <!-- 3. UI LAYER -->
165
  <div id="ui-layer" class="fixed inset-0 z-[50] flex flex-col justify-between safe-area-y pointer-events-none">
166
 
167
  <!-- TOP HEADER -->
168
  <div class="w-full px-6 py-4 flex justify-between items-center bg-gradient-to-b from-black/80 to-transparent pointer-events-auto">
169
  <div class="flex flex-col">
170
+ <span class="text-[10px] text-white/60 font-mono tracking-widest">SYSTEM_STATUS</span>
171
+ <span id="sys-status" class="text-[#00ff41] font-bold text-lg tracking-wider animate-pulse">SCANNING...</span>
172
+ <span class="text-[8px] text-white/40 font-mono mt-1">FPS: <span id="fps-counter">60</span> | LAT: 12ms</span>
173
  </div>
174
  <a href="./index.html" class="w-10 h-10 flex items-center justify-center border border-[#00ff41]/50 rounded-full bg-black/40 backdrop-blur-md active:scale-95 transition-transform">
175
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#00ff41" stroke-width="2"><path d="M18 6L6 18M6 6l12 12"/></svg>
176
  </a>
177
  </div>
178
 
179
+ <!-- MIRINO -->
180
  <div id="aim-overlay" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center transition-opacity duration-300">
 
181
  <div class="relative w-[65vw] h-[100vw] max-w-[300px] max-h-[500px] border border-white/20 rounded-xl">
 
182
  <div class="absolute -top-1 -left-1 w-6 h-6 border-t-4 border-l-4 border-[#00ff41]"></div>
183
  <div class="absolute -top-1 -right-1 w-6 h-6 border-t-4 border-r-4 border-[#00ff41]"></div>
184
  <div class="absolute -bottom-1 -left-1 w-6 h-6 border-b-4 border-l-4 border-[#00ff41]"></div>
185
  <div class="absolute -bottom-1 -right-1 w-6 h-6 border-b-4 border-r-4 border-[#00ff41]"></div>
186
 
 
187
  <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full flex items-center justify-center">
188
  <div class="w-12 h-[1px] bg-[#00ff41]/50"></div>
189
  <div class="h-12 w-[1px] bg-[#00ff41]/50 absolute"></div>
 
196
 
197
  <!-- BOTTOM CONTROLS -->
198
  <div class="w-full px-6 pb-8 pointer-events-auto flex flex-col items-center bg-gradient-to-t from-black/90 to-transparent">
199
+ <!-- Pulsante Audio -->
200
+ <button id="audio-btn" class="w-full max-w-sm py-5 bg-[#00ff41]/10 border border-[#00ff41] text-[#00ff41] font-bold text-lg uppercase tracking-[0.2em] rounded active:bg-[#00ff41] active:text-black transition-all mb-3 flex items-center justify-center gap-3 backdrop-blur-md">
201
  <span>🔊</span>
202
  <span id="audio-text">Attiva Audio</span>
203
  </button>
204
+
205
+ <!-- NUOVO: Pulsante Fallback -->
206
+ <button id="fallback-btn" class="w-full max-w-sm py-4 bg-[#ff0055]/10 border border-[#ff0055] text-[#ff0055] font-bold text-sm uppercase tracking-[0.2em] rounded active:bg-[#ff0055] active:text-white transition-all mb-4 flex items-center justify-center gap-2 backdrop-blur-md">
207
+ <span>⚠️</span>
208
+ <span>Mostra Video (Fallback)</span>
209
+ </button>
210
+
211
+ <div class="text-[10px] text-white/40 font-mono text-center">
212
+ <div>NEURAL_LINK v2.4.0 // VERTICAL_MODE</div>
213
+ <div class="mt-1">Built with 🧠 & ☕ by a sleep-deprived dev</div>
214
+ <div class="text-[#00ff41]/60 mt-1" id="konami-hint">// Try: ↑↑↓↓←→←→BA</div>
215
+ </div>
216
  </div>
217
  </div>
218
 
219
+ <!-- 4. FALLBACK VIDEO PLAYER -->
220
+ <div id="fallback-player">
221
+ <div class="text-[#00ff41] font-bold text-xl mb-3 text-center">📹 FALLBACK MODE</div>
222
+ <video id="fallback-video" controls playsinline webkit-playsinline>
223
+ <source src="./img/video.mp4" type="video/mp4">
224
+ </video>
225
+ <button id="close-fallback" class="w-full py-3 bg-[#ff0055] text-white font-bold uppercase rounded active:scale-95 transition-transform">
226
+ Chiudi
227
+ </button>
228
+ <p class="text-white/60 text-xs mt-3 text-center">Il marker non è stato trovato. Usa questo player manuale.</p>
229
+ </div>
230
+
231
+ <!-- 5. AR SCENE -->
232
  <a-scene
233
+ mindar-image="imageTargetSrc: img/targets.mind; filterMinCF:0.00001; filterBeta: 10; uiLoading: no; uiScanning: no; missTolerance: 25; warmupTolerance: 2"
234
  color-space="sRGB"
235
  renderer="colorManagement: true, physicallyCorrectLights, highRefreshRate: true"
236
  vr-mode-ui="enabled: false"
 
243
  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
244
 
245
  <a-entity id="example-target" mindar-image-target="targetIndex: 0">
246
+ <!-- VIDEO 16:9 -->
 
 
 
 
 
247
  <a-entity id="myVid"
248
+ geometry="primitive: plane; width: 1.6; height: 0.9"
249
  material="src: #vid; shader: flat; transparent: true; opacity: 1"
250
  position="0 0 0">
251
  </a-entity>
252
 
253
+ <!-- Cornice Cyberpunk 16:9 -->
254
+ <a-plane position="0 0.47 0" width="1.68" height="0.03" color="#00ff41" material="shader: flat">
255
+ <a-animation attribute="opacity" from="1" to="0.7" dur="100" direction="alternate" repeat="indefinite"></a-animation>
256
+ </a-plane>
257
+ <a-plane position="0 -0.47 0" width="1.68" height="0.03" color="#00ff41" material="shader: flat"></a-plane>
258
+ <a-plane position="-0.83 0 0" width="0.03" height="0.96" color="#00ff41" material="shader: flat"></a-plane>
259
+ <a-plane position="0.83 0 0" width="0.03" height="0.96" color="#00ff41" material="shader: flat">
260
+ <a-animation attribute="opacity" from="1" to="0.7" dur="150" direction="alternate" repeat="indefinite"></a-animation>
261
+ </a-plane>
262
 
263
+ <a-plane position="-0.77 0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
264
+ <a-plane position="0.77 -0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
265
+
266
+ <a-text value="HACK_THE_PLANET.exe" color="#00ff41" align="center" width="1.5" position="0 -0.6 0.01"
267
+ font="https://cdn.aframe.io/fonts/Roboto-msdf.json">
268
+ <a-animation attribute="opacity" from="0.3" to="1" dur="800" direction="alternate" repeat="indefinite"></a-animation>
269
+ </a-text>
270
  </a-entity>
271
  </a-scene>
272
 
273
+ <!-- 6. LOGIC + NERD EASTER EGGS -->
274
  <script>
275
  const video = document.querySelector("#vid");
276
  const target = document.querySelector("#example-target");
 
282
  const loadingPercent = document.querySelector("#loading-percent");
283
  const progressBar = document.querySelector("#progress-bar");
284
  const scene = document.querySelector("a-scene");
285
+ const fpsCounter = document.querySelector("#fps-counter");
286
+ const fallbackBtn = document.querySelector("#fallback-btn");
287
+ const fallbackPlayer = document.querySelector("#fallback-player");
288
+ const fallbackVideo = document.querySelector("#fallback-video");
289
+ const closeFallback = document.querySelector("#close-fallback");
290
 
291
  let isAudioEnabled = false;
292
  let loadProgress = 0;
293
 
294
+ // Easter Egg 1: Fake FPS Counter
295
+ setInterval(() => {
296
+ const fakeFps = Math.floor(Math.random() * 3) + 58;
297
+ fpsCounter.innerText = fakeFps;
298
+ }, 500);
299
+
300
+ // Easter Egg 2: Konami Code
301
+ const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'];
302
+ let konamiIndex = 0;
303
+
304
+ document.addEventListener('keydown', (e) => {
305
+ if (e.key === konamiCode[konamiIndex]) {
306
+ konamiIndex++;
307
+ if (konamiIndex === konamiCode.length) {
308
+ alert('🎮 CHEAT CODE ACTIVATED!\n\n"In the Matrix, no one can hear you printf()"\n- Anonymous Hacker, 1999');
309
+ konamiIndex = 0;
310
+ }
311
+ } else {
312
+ konamiIndex = 0;
313
+ }
314
+ });
315
+
316
+ // Console Easter Egg
317
+ console.log("%c⚡ NEURAL LINK SYSTEM INITIALIZED", "color: #00ff41; font-size: 20px; font-weight: bold;");
318
+ console.log("%cIf you're reading this, you're a true nerd 🤓", "color: #fff; font-size: 12px;");
319
+ console.log("%c// TODO: Add more bugs for job security", "color: #666; font-style: italic;");
320
+
321
+ // Loading con messaggi nerd
322
+ const nerdMessages = [
323
+ "Compiling shaders...",
324
+ "Downloading RAM...",
325
+ "Adjusting flux capacitor...",
326
+ "Hacking the mainframe...",
327
+ "Dividing by zero...",
328
+ "Reticulating splines..."
329
+ ];
330
+ let msgIndex = 0;
331
+
332
  const loadInterval = setInterval(() => {
333
  loadProgress += 2;
334
  if(loadProgress > 100) loadProgress = 100;
335
  loadingPercent.innerText = loadProgress + "%";
336
  progressBar.style.width = loadProgress + "%";
337
 
338
+ if(loadProgress % 15 === 0 && msgIndex < nerdMessages.length) {
339
+ document.querySelector('#load-msg').innerText = nerdMessages[msgIndex];
340
+ msgIndex++;
341
+ }
342
+
343
+ if(loadProgress >= 100) {
344
+ clearInterval(loadInterval);
345
+ document.querySelector('#load-msg').innerText = "System ready. Let's hack reality.";
346
+ }
347
  }, 30);
348
 
349
  // AR PRONTA
350
  scene.addEventListener("arReady", () => {
351
+ console.log("%c✅ AR SYSTEM ONLINE", "color: #00ff41; font-weight: bold;");
 
352
  setTimeout(() => {
353
  loader.style.opacity = "0";
354
  setTimeout(() => loader.style.display = "none", 500);
 
357
 
358
  // ERROR HANDLING
359
  scene.addEventListener("arError", (ev) => {
360
+ console.error("💀 FATAL ERROR:", ev);
361
+ alert("⚠️ Camera Access Denied!\n\nPlease grant camera permissions or check if another app is using it.\n\n(Yes, we need it. No, we won't spy on you. Probably.)");
362
  });
363
 
364
  // TARGET FOUND
365
  target.addEventListener("targetFound", () => {
366
+ console.log("🎯 TARGET ACQUIRED");
367
  video.play();
368
+ statusText.innerText = "LOCKED_ON";
369
  statusText.style.color = "#fff";
370
  statusText.classList.remove("animate-pulse");
371
  aimOverlay.style.opacity = "0";
372
+
373
+ if(navigator.vibrate) navigator.vibrate([30, 10, 30]);
374
  });
375
 
376
  // TARGET LOST
377
  target.addEventListener("targetLost", () => {
378
+ console.log("❌ TARGET LOST");
379
  video.pause();
380
+ statusText.innerText = "SEARCHING...";
381
  statusText.style.color = "#00ff41";
382
  statusText.classList.add("animate-pulse");
383
  aimOverlay.style.opacity = "1";
 
387
  audioBtn.addEventListener('click', () => {
388
  if (!isAudioEnabled) {
389
  video.muted = false;
390
+ fallbackVideo.muted = false;
391
  isAudioEnabled = true;
392
  audioText.innerText = "AUDIO ON";
393
  audioBtn.classList.add("bg-[#00ff41]", "text-black");
394
  audioBtn.classList.remove("bg-[#00ff41]/10", "text-[#00ff41]");
395
 
396
+ console.log("🔊 Audio stream activated");
397
+
398
  if(navigator.vibrate) navigator.vibrate(50);
399
 
400
  setTimeout(() => {
 
403
  }, 1500);
404
  }
405
  });
406
+
407
+ // FALLBACK MODE
408
+ fallbackBtn.addEventListener('click', () => {
409
+ fallbackPlayer.style.display = 'block';
410
+ fallbackVideo.play();
411
+ console.log("🆘 FALLBACK MODE ACTIVATED");
412
+ if(navigator.vibrate) navigator.vibrate(100);
413
+ });
414
+
415
+ closeFallback.addEventListener('click', () => {
416
+ fallbackPlayer.style.display = 'none';
417
+ fallbackVideo.pause();
418
+ });
419
+
420
+ // Easter Egg 3: Double tap
421
+ let lastTap = 0;
422
+ document.addEventListener('touchend', (e) => {
423
+ const currentTime = new Date().getTime();
424
+ const tapLength = currentTime - lastTap;
425
+ if (tapLength < 300 && tapLength > 0) {
426
+ console.log("🤫 Secret message: There is no spoon.");
427
+ }
428
+ lastTap = currentTime;
429
+ });
430
  </script>
431
  </body>
432
  </html>