Spaces:
Running
Running
Pass the private Space's access token to lazily loaded files
Browse filesFiles changed (2)
- app.js+7-2
- index.html+2-2
5 unmodified lines678910111213141516212 unmodified lines229230231227232233234235139 unmodified lines3753763773733783793803815 unmodified lines
const HF = "https://huggingface.co";const SPACE_URL = "https://huggingface.co/spaces/projectsim/simready-library";// A private Space authorises each file request by the __sign token in the page URL, but// files loaded later by a script (import(), the 3D model) send the script's address as the// referrer, so they carry the token themselves.const SIGN = new URLSearchParams(location.search).get("__sign");const signed = (path) => SIGN ? `${path}${path.includes("?") ? "&" : "?"}__sign=${encodeURIComponent(SIGN)}` : path;const API_DOCS = "https://docs.projectsim.ai/getting-started/quickstart?utm_source=hf_space&utm_medium=detail&utm_content=simready-library";
const FACETS = [212 unmodified linesasync function getViewer() { if (viewer || viewerFailed) return viewer; try { const { createViewer } = await import("./viewer.js?v=4"); const { createViewer } = await import(signed("./viewer.js?v=5")); viewer = createViewer(); viewer.setTheme(theme()); } catch (e) {139 unmodified lines rig = rigState.map((r) => ({ ...r })); } else { loadedId = a.id; rig = await v.load(`previews/${a.id}.glb`, `previews/${a.id}.json`); rig = await v.load(signed(`previews/${a.id}.glb`), signed(`previews/${a.id}.json`)); if (state.asset !== a.id) return; } if (rig.length) {7 unmodified lines8910111112131468 unmodified lines838485868687887 unmodified lines <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap"> <link rel="stylesheet" href="style.css?v=4"> <link rel="stylesheet" href="style.css?v=5"> <script type="importmap"> { "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js",68 unmodified lines </aside> </div>
<script src="app.js?v=4"></script> <script src="app.js?v=5"></script></body></html>app.js+7-2
index.html+2-2