How jelosus2/bd2-l2d-viewer works
Purpose and Entry Points
A static Brown Dust 2 character-animation viewer. It presents bundled character Spine/L2D-style animation assets and battle-ready voice clips in a browser. The application boots from index.html through src/main.ts, mounting the root UI in src/App.vue.
Application Shell and UI Composition
src/App.vue coordinates the viewer experience. Navigation, character selection, animation selection, settings, tutorials, changelog, and asset-upload flows are separated into Vue components:
• src/components/Navbar.vue
• src/components/CharacterSideBar.vue
• src/components/AnimationSideBar.vue
• src/components/SettingsModal.vue
• src/components/FeatureTutorial.vue
Viewer Runtime Boundary
src/components/SpineViewer.vue is the rendering boundary between Vue state/UI and the Spine player/runtime. Its internal player typing is isolated in src/types/spine-player-internal.d.ts. Character selections and animation choices should flow into this component; rendering, camera/layer controls, and runtime-specific concerns should remain behind it.
State, Selection, and URL Flow
Two centralized stores represent the main client state domains:
• src/stores/characterStore.ts for selected character/animation-oriented state.
• src/stores/settingsStore.ts for viewer preferences.
Catalog and mapping utilities provide static lookup data rather than a backend: src/utils/character_list.ts, src/utils/cutscene_mappings.ts, and src/utils/charIcons.ts. src/utils/urlSync.ts indicates selection/settings can be reflected in or restored from browser URLs, making URLs a public state boundary.
Bundled Asset Catalog
The repository carries its own media corpus. Character and NPC skeletal assets are organized by numeric ID under src/assets/spines, with .atlas and .skel pairs, optional cutscene variants, and occasional dating/illustration variants; e.g. src/assets/spines/000101/, src/assets/spines/003803/cutscene/glow/, and src/assets/spines/066403/dating/. Character battle-ready audio is local WebM media grouped by character and JP/KR locale under src/assets/audios/.
This static-file layout is a key contract: catalog IDs and special mappings must resolve to exact asset directories/files, including exceptional naming cases.
User-Provided Asset Paths
The app supports local customization/import workflows through src/components/UploadSpineModal.vue and src/components/UploadBackgroundModal.vue. These are distinct from the curated bundled catalog and should be treated as browser-session/client-side inputs unless implementation establishes persistence elsewhere.
Build and Deployment
This is a TypeScript/Vue frontend built with Vite (vite.config.ts) and styled from src/assets/main.css with Tailwind configuration in tailwind.config.ts. scripts/copy-assets.js is architecturally relevant because the large binary media set likely needs explicit copying into build output. Deployment is static hosting via GitHub Pages automation: .github/workflows/gh-pages.yml. No server, database, authentication system, or external runtime service is evident from the supplied tree.
Main entry points: SpineViewer.vue Spine viewer · App.vue Application shell · characterStore.ts Character selection state · copy-assets.js Asset copy step
Components 20
Browser application
- HTML entry
index.html - Vue bootstrap
src/main.ts - Application shell
src/App.vue - Navigation
src/components/Navbar.vue - Character and animation selectors
src/components/CharacterSideBar.vue - Animation selector
src/components/AnimationSideBar.vue - Settings and tutorial UI
src/components/SettingsModal.vue - Spine viewer · Encapsulates player, camera, layer, and runtime concerns.
src/components/SpineViewer.vue - Player internal types
src/types/spine-player-internal.d.ts - Character selection state
src/stores/characterStore.ts - Viewer preferences
src/stores/settingsStore.ts - URL state sync · Restores and reflects selection and settings in URLs.
src/utils/urlSync.ts - Local asset uploads · Session-scoped user-provided Spine and background inputs.
src/components/UploadSpineModal.vue
Static catalog
- Catalog mappings
src/utils/character_list.ts - Skeletal asset corpus · ID-based atlas and skeleton directories, including special variants.
src/assets/spines - Voice clip corpus · Character audio grouped by JP and KR locale.
Build and deployment
- Application styles
src/assets/main.css - Vite build
vite.config.ts - Asset copy step · Copies large binary media into build output.
scripts/copy-assets.js - GitHub Pages deploy
.github/workflows/gh-pages.yml
Connections 24
- HTML entry → Vue bootstrap: loads
- Vue bootstrap → Application shell: mounts
- Application shell → Navigation: composes
- Application shell → Character and animation selectors: composes
- Application shell → Animation selector: composes
- Application shell → Settings and tutorial UI: composes
- Application shell → Spine viewer: drives
- Character and animation selectors → Character selection state: updates
- Animation selector → Character selection state: updates
- Settings and tutorial UI → Viewer preferences: updates
- Character selection state → Spine viewer: selected asset and animation
- Viewer preferences → Spine viewer: viewer preferences
- URL state sync → Character selection state: restores and reflects
- URL state sync → Viewer preferences: restores and reflects
- Catalog mappings → Character selection state: catalog lookup
- Character selection state → Skeletal asset corpus: resolves asset IDs
- Spine viewer → Skeletal asset corpus: loads skeletons
- Spine viewer → Voice clip corpus: plays voice clips
- Player internal types → Spine viewer: types player internals
- Local asset uploads → Spine viewer: provides local inputs
- Vite build → Asset copy step: build includes
- Asset copy step → Skeletal asset corpus: copies
- Asset copy step → Voice clip corpus: copies
- GitHub Pages deploy → Vite build: builds and deploys