Commit Graph
44 Commits
Author SHA1 Message Date
hypercross 0d35ad56f2 feat(web): rework deck carousel navigation
Replace the counter with a sliding-dot pagination: dots slide and fade
as the active card changes, a counter above the bar shows the current
index, and round first/last and prev/next buttons flank the strip.
Scrolling over the dots steps through the deck. Also fix the camera fit
so it frames the active card front-on instead of the carousel center.
2026-08-14 12:05:37 +08:00
hypercross f01bb5f99b feat(web): rework mod inspector layout
Fill the viewport with a fixed sidebar of highlightable type-filter
icons over an independently scrolling tree, and let the viewer expand
into a full-height scene.
2026-08-14 11:27:46 +08:00
hypercross 8ebb9211c5 fix(web): frame deck carousel on active card
Fit the camera in a frame callback so the active card has settled into
its arc slot first, and aim it straight at the card's front face instead
of keeping the initial side angle. Measure the card's width and widen the
arc radius so wide cards no longer clip their neighbors.
2026-08-14 11:15:59 +08:00
hypercross a3095ead38 feat(web): move mod header into site header
Replace the global TTS Workshop header on mod routes with a ModHeader showing the thumbnail, game name, and download/setup links styled like the Search/BGM nav.
2026-08-14 10:59:20 +08:00
hypercross 30ef76632f feat: return workshop metadata with mod details
Include the Workshop title and preview image in the items response so the mod header survives a page refresh, not just navigation from search. Resolve both from the same Steam API call.
2026-08-14 10:59:14 +08:00
hypercross 7163451d1f fix(web): declare card shader UV uniforms
three.js does not auto-declare uniforms added via onBeforeCompile, so the
injected uMapRepeat/uMapOffset were undeclared and the card shader failed
to compile, rendering cards transparent. Prepend the declarations to the
vertex shader.
2026-08-14 10:52:54 +08:00
hypercross 2430be9661 feat(web): rework mod page header layout
Show the game name and thumbnail in the header, float the action buttons and object GUID to the right, and keep the viewer icon, label, and GUID on one line.
2026-08-14 10:46:27 +08:00
hypercross 002bcb324b perf(web): share card texture via shader UV transform
Move the card sprite repeat/offset out of per-card texture clones and
into a uniform injected into the material shader. Cards now share the
deck sheet (one GPU upload), the shader, and the geometry, with only
per-card material uniforms differing, so navigating a deck no longer
re-uploads the sheet on every step.
2026-08-14 10:46:09 +08:00
hypercross c665212209 feat(web): add deck viewer
Add a DeckViewer that frames the active card in a deck carousel. Scene gains a fit prop so the shared bounds behavior can be disabled and refit manually.
2026-08-14 10:29:04 +08:00
hypercross 2403abc07b feat(web): add type filter bar to object tree
Chips highlight object types to show only those in the tree; with none highlighted, everything is shown. Filtered nodes keep their original index path so selection stays stable.
2026-08-14 10:29:01 +08:00
hypercross ee7e73c798 style(web): use 3:4 aspect ratio for viewers 2026-08-14 09:54:52 +08:00
hypercross dd08f901ae feat: add inline PDF viewer for Custom_PDF objects
Add a /pdf proxy route that forces Content-Disposition inline so PDFs render instead of downloading, and a web viewer that embeds the document in an iframe with a standalone open-in-new-tab link.
2026-08-14 09:51:11 +08:00
hypercross 812b4640e2 feat(web): clamp tabletop camera to the horizon
Add a maxPolarAngle prop to Scene and use it in the tabletop view so the
camera can't dip below the table and peek under face-down cards.
2026-08-10 12:24:43 +08:00
hypercross 6502fdae4f refactor(web): code-split the three.js stack out of the main bundle 2026-08-10 09:12:38 +08:00
hypercross 5a3a9c1fcc feat(web): lighten tabletop scene and tune contact shadows
Replace the dark surface plane with a grey background and a spotlight,
size the contact shadow to the table, and scale its blur and fade with
the shadow plane. Disable depth test on the stacking curve overlay.
2026-08-10 00:57:32 +08:00
hypercross abf901418b feat(web): add tabletop scene controls
Disable auto-rotate and enable panning on the setup view, add a
fullscreen toggle, and convert the controls to iconify icon buttons.
2026-08-09 23:04:47 +08:00
hypercross f494a6f9be feat(web): render bgm setups as a 3D table
Wire the tabletop library into the setup detail route: seed the store
from the setup, resolve the surface mount tree, and render world and HUD
surfaces. Add serializedToPackage to convert the vite-emitted package.
2026-08-09 22:46:03 +08:00
hypercross 15c45e7106 refactor: share trace, error boundary, and proxy http helpers
Lift the trace-to-shape geometry into @tts/mesh (traceToShape/
traceToUvBounds), parameterized by scale so the web token viewer and
@tts/tabletop share one implementation. Move the CORS proxy HTTP helpers
(assetUrl, resolveAssetUrl, traceImage) into a new @tts/http package, and
make @tts/tabletop's ErrorBoundary the single source used by the web app.

This removes the duplicated ErrorBoundary, assetUrl, tabletopHttp, and
trace-to-shape code from apps/web and packages/tabletop.
2026-08-09 22:17:24 +08:00
hypercross 521519ce3d feat(tabletop): inject proxy handlers from web app 2026-08-09 21:46:36 +08:00
hypercross 4e18ab5bc8 feat(web): add bgm viewer navigation 2026-08-09 20:02:03 +08:00
hypercross 64c8bb60b3 feat(web): add bgm package browser 2026-08-09 19:44:27 +08:00
hypercross 82a81c9c1a feat(web): tint objects by their ColorDiffuse
Model ColorDiffuse in shared types and multiply each viewer's material color by the per-object tint, including textured faces and loaded custom models.
2026-08-08 22:38:12 +08:00
hypercross a6e9d2dd07 fix(web): correct transform rotation and lay-flat sign
Conjugate the rotation by the Z-reflection (negate rotX/rotY, keep rotZ) and use -90 degrees about X to lay extruded meshes flat so faces point up.
2026-08-08 20:19:13 +08:00
hypercross dcba0ac4bd feat(web): place full setup objects at their real transforms
Model TTSObjectTransform in shared types and convert each object's position, rotation, and scale into three.js placement, with per-class base-size corrections and a lay-flat rotation for extruded meshes.
2026-08-08 18:41:42 +08:00
hypercross c3c7fe2445 feat(web): show asset loading progress in the 3D scene 2026-08-08 18:41:41 +08:00
hypercross e88dd03fac feat(web): add full setup view rendering the whole save
Add a /mod/:id/setup page that lays out every renderable object in a single shared scene. Export object-facing mesh wrappers from the viewers and share geometry and materials across objects via module-level caches.
2026-08-08 18:28:03 +08:00
hypercross ead2ba8c57 fix(web): improve scene camera and bounds behavior
Update Bounds props to enable fitting and clipping, adjust OrbitControls
minDistance, and set makeDefault to ensure proper interaction.
2026-08-08 18:16:03 +08:00
hypercross b6bd4612e0 feat: implement suspense-based alpha tracing for token meshes
Refactor `TokenMesh` to use a custom `useTrace` hook that suspends
during the alpha channel tracing process. This allows the `Bounds`
component in `Scene` to correctly fit the camera to the token's
geometry once it has been fully loaded and traced.
2026-08-08 17:54:43 +08:00
hypercross 55e0351c1d fix(web): select tree nodes by index path instead of GUID
Cards in a deck share the deck's GUID, so GUID-based selection highlighted
every card with that GUID and rendered the first match. Key selection by the
node's unique index path instead.
2026-08-08 17:42:16 +08:00
hypercross 835250abdd feat(mesh): render cards, tiles, and tokens with separated front/back/walls
Split extrudeShapeParts into front, back, and walls so each face can carry
its own material. Flip back textures left/right on the material so they are
not mirrored, and slice card faces from the deck sprite sheet via CardID.
Resolve deck config from the parent deck, which is authoritative over a
card's own CustomDeck. Add unit tests for card resolution, sprite UVs, and
the flip helper.
2026-08-08 17:41:59 +08:00
hypercross a2f7c998fc feat(web): inset token silhouette by 2px
Pass a negative offset through traceImage so the traced token shape
sits slightly inside the artwork, hiding the anti-aliased fringe.
2026-08-08 15:37:32 +08:00
hypercross a4759be5ac feat(web): trace token shape and texture the whole mesh
TokenViewer now traces the image's alpha channel via /trace and extrudes the silhouette with @tts/mesh, aligning the texture using the full image as the UV framing. The texture is applied to the whole mesh (top, back, and walls) instead of separate solid-white walls.
2026-08-08 15:12:11 +08:00
hypercross d554d6bde1 feat(tile): render tiles with the mesh generator
Replace the per-shape tile geometries with @tts/mesh extrusion, honoring
the tile type and stretch aspect ratio. Add extrudeShapeParts so the
caps carry the texture while the walls are solid white, matching TTS
tinting. Fix bottom-face UVs to mirror horizontally and make wall UVs
inherit the front mapping independent of z.
2026-08-08 14:21:53 +08:00
hypercross 3b86a641aa Fix custom model loading and hook order
Detect the model format from file contents instead of the URL extension,
since TTS model URLs are often extension-less. Move the diffuse texture
hook into a child component so the hook count stays consistent across
renders.
2026-08-08 13:06:01 +08:00
hypercross 179efae99f Fix R3F hooks used outside the Canvas
Move useTexture calls in the tile, token, and card viewers into child
components rendered inside the Canvas. R3F hooks must run within the
Canvas store, so calling them at the viewer's top level threw a runtime
error.
2026-08-08 12:59:32 +08:00
hypercross 7d1f05902d Add error boundary around object viewers
Wrap the resolved viewer in an error boundary so a render failure (e.g.
WebGL context loss or a model/texture load error) is contained to the
inspector pane instead of crashing the page. The fallback shows the
error message and stack trace.
2026-08-08 12:58:28 +08:00
hypercross 001d5eeb54 Add 3D object viewers with r3f stack
Add per-class 3D viewers for tiles, tokens, cards, and custom models
using React Three Fiber, drei, and postprocessing. Viewers are
lazy-loaded and registered through the existing viewer registry, with a
shared scene wrapper for lighting, orbit controls, and subtle effects.

Add a CORS-safe /asset proxy route so three.js loaders can fetch
Workshop-hosted textures and models, and extend TTSObject with the
CustomMesh and CustomTile/CustomToken fields the viewers read.
2026-08-08 12:56:46 +08:00
hypercross 9619cc3863 feat(web): expand object class icon mapping
Map more TTS classes to icons, including multi-set icons for models and
bags, and add a wrap-break-word class fix in the default viewer.
2026-08-08 12:45:40 +08:00
hypercross 4f37dabbe7 feat(web): add iconify tag icons for object classes
Replace the text class tag in the tree and inspector with one or more
MDI icons (hover shows the class name). Bundle only the used icons via
a generator script instead of the full set.
2026-08-08 12:32:11 +08:00
hypercross 3b66e82b67 feat(web): make object tree collapsible and collapsed by default 2026-08-08 12:27:23 +08:00
hypercross f126bf7993 fix(web): dedupe tree keys and guard against circular JSON
Key tree nodes by their index path instead of GUID, since TTS saves can
contain duplicate GUIDs. Skip the Parent back-reference in the default
viewer and stringify with a circular-reference guard.
2026-08-08 12:23:48 +08:00
hypercross a8e84c8b9d feat(web): replace flat lists with tree sidebar and object inspector
Add a containment-tree sidebar with class tags and display labels, plus
an inspector pane backed by a viewer registry with a default viewer.
Custom per-class viewers can be registered later.
2026-08-08 12:19:43 +08:00
hypercross f7a6eb6ee1 feat: allow loading mods without a Steam API key
Add fetchModFromUrl/fetchModFileFromUrl and accept a fileUrl query param on /items routes so the frontend can download saves directly from a search result's file_url, with no key required.
2026-08-08 11:32:57 +08:00
hypercross 7c812a109c feat: add React frontend with search and mod pages
Add apps/web (Vite + React Router + Tailwind v4 + Zustand) with a search page and a mod page that analyzes saves via @tts/extract. Document the frontend in the README and docs.
2026-08-08 11:22:09 +08:00