AK commited on
Commit
4c218db
·
1 Parent(s): f174ffe

fix: serve scripts from /static (were 404) + bundle three.js locally — 3D now renders

Browse files
Files changed (2) hide show
  1. static/index.html +5 -5
  2. static/three.min.js +0 -0
static/index.html CHANGED
@@ -237,15 +237,15 @@
237
  </div>
238
  <div class="toast" id="toast"></div>
239
 
240
- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
 
241
  <script>
242
- // Robust loader: if the primary CDN is blocked, fall back to unpkg before
243
- // loading app.js — guarantees the 3D scene never silently fails to boot.
244
  (function(){
245
- function loadApp(){ var s=document.createElement('script'); s.src='app.js?v=2'; document.body.appendChild(s); }
246
  if(window.THREE){ loadApp(); return; }
247
  var f=document.createElement('script');
248
- f.src='https://unpkg.com/three@0.128.0/build/three.min.js';
249
  f.onload=loadApp; f.onerror=loadApp;
250
  document.body.appendChild(f);
251
  })();
 
237
  </div>
238
  <div class="toast" id="toast"></div>
239
 
240
+ <!-- Three.js is bundled LOCALLY and served from /static so no CDN/CSP can block it. -->
241
+ <script src="/static/three.min.js"></script>
242
  <script>
243
+ // Load the app only once THREE is guaranteed. Local first; CDN only as a last resort.
 
244
  (function(){
245
+ function loadApp(){ var s=document.createElement('script'); s.src='/static/app.js?v=3'; document.body.appendChild(s); }
246
  if(window.THREE){ loadApp(); return; }
247
  var f=document.createElement('script');
248
+ f.src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js';
249
  f.onload=loadApp; f.onerror=loadApp;
250
  document.body.appendChild(f);
251
  })();
static/three.min.js ADDED
The diff for this file is too large to render. See raw diff