Spaces:
Running
Running
Keep the private Space's access token in the page URL
Browse filesFiles changed (11)
- app.js+19-3
- index.html+2-2
- previews/cardboard_shoe_box.glb
- previews/ceramic_serving_bowl.glb
- previews/cleaning_caddy_white.glb
- previews/desk_divider_screen.glb
- previews/divided_crate_yellow.glb
- previews/divided_crate_yellow_blue_01.glb
- previews/divided_crate_yellow_blue_02.glb
- previews/divided_shelf_tray.glb
- previews/doorstop.glb
4 unmodified lines5678910212 unmodified lines223224225226227228229116 unmodified lines34634734834935035135226 unmodified lines3793803813823833843851 unmodified line3873883893903913923933943954 unmodified lines// in this Space (built by tools/make_previews.py) and are shown by viewer.js.const HF = "https://huggingface.co";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=2");viewer = createViewer();viewer.setTheme(theme());} catch (e) {116 unmodified linesel("div", { class: "btn-row" },el("a", { class: "btn primary", href: folder, target: "_blank", rel: "noopener" }, "Open on Hugging Face"),el("a", { class: "btn", href: usd, target: "_blank", rel: "noopener" }, "USD file"),copyButton(location.href, "Copy link"))),el("section", { class: "more" },el("p", {}, el("strong", {}, "Need many variations, or your own objects?")),el("p", {}, `projectsim generates sim-ready objects like this ${a.class || "asset"} at scale, with physics and moving parts set up.`),26 unmodified lines}// ---- state + url --------------------------------------------------------------function syncUrl() {const p = new URLSearchParams();if (state.q) p.set("q", state.q);if (state.group) p.set("g", state.group);1 unmodified linefor (const [k, s] of Object.entries(state.facets)) if (s.size) p.set(k, [...s].join(","));if (state.sort !== "name") p.set("sort", state.sort);if (state.asset) p.set("a", state.asset);const qs = p.toString();history.replaceState(null, "", qs ? `?${qs}` : location.pathname);}function readUrl() {const p = new URLSearchParams(location.search);state.q = p.get("q") || "";4 unmodified lines567891011212 unmodified lines224225226227228229230116 unmodified lines34734834935035135235326 unmodified lines3803813823833843853863873883891 unmodified line3913923933943953963973983994004014024034044054064074084094104114 unmodified lines// in this Space (built by tools/make_previews.py) and are shown by viewer.js.const HF = "https://huggingface.co";const SPACE_URL = "https://huggingface.co/spaces/projectsim/simready-library";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=3");viewer = createViewer();viewer.setTheme(theme());} catch (e) {116 unmodified linesel("div", { class: "btn-row" },el("a", { class: "btn primary", href: folder, target: "_blank", rel: "noopener" }, "Open on Hugging Face"),el("a", { class: "btn", href: usd, target: "_blank", rel: "noopener" }, "USD file"),copyButton(shareUrl(), "Copy link"))),el("section", { class: "more" },el("p", {}, el("strong", {}, "Need many variations, or your own objects?")),el("p", {}, `projectsim generates sim-ready objects like this ${a.class || "asset"} at scale, with physics and moving parts set up.`),26 unmodified lines}// ---- state + url --------------------------------------------------------------// Only our own keys are rewritten: a private Space's page URL also carries a signed// access token (__sign), and every later request for files of this Space needs it.const OWN_KEYS = ["q", "g", "c", "sort", "a", ...FACETS.map((f) => f.key)];function ownParams() {const p = new URLSearchParams();if (state.q) p.set("q", state.q);if (state.group) p.set("g", state.group);1 unmodified linefor (const [k, s] of Object.entries(state.facets)) if (s.size) p.set(k, [...s].join(","));if (state.sort !== "name") p.set("sort", state.sort);if (state.asset) p.set("a", state.asset);return p;}function syncUrl() {const p = new URLSearchParams(location.search);OWN_KEYS.forEach((k) => p.delete(k));for (const [k, v] of ownParams()) p.set(k, v);const qs = p.toString();history.replaceState(null, "", qs ? `?${qs}` : location.pathname);}// Link to share: the Space page on huggingface.co (never the signed hf.space URL).function shareUrl() {const qs = ownParams().toString();const base = /\.hf\.space$/.test(location.hostname) ? SPACE_URL : location.origin + location.pathname;return qs ? `${base}?${qs}` : base;}function readUrl() {const p = new URLSearchParams(location.search);state.q = p.get("q") || "";
7 unmodified lines89101112131468 unmodified lines8384858687887 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=2"><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=2"></script></body></html>7 unmodified lines89101112131468 unmodified lines8384858687887 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=3"><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=3"></script></body></html>
app.js+19-3
index.html+2-2
previews/cardboard_shoe_box.glb
previews/ceramic_serving_bowl.glb
previews/cleaning_caddy_white.glb
previews/desk_divider_screen.glb
previews/divided_crate_yellow.glb
previews/divided_crate_yellow_blue_01.glb
previews/divided_crate_yellow_blue_02.glb
previews/divided_shelf_tray.glb
previews/doorstop.glb