UI framework
See original GitHub issueJust recording the current state and future work planned.
Weβre going to ship both 2D and 3D (using threejs) components! The two sets of components will be created using the same API so you can seamlessly switch between the two.
Iβve started a new branch 3d
to track development of this. Iβve split the UI framework into 2d and 3d directories:
src/ui/
βββ 2d
βΒ Β βββ card.css
βΒ Β βββ card.js
βΒ Β βββ card.test.js
βΒ Β βββ deck.css
βΒ Β βββ deck.js
βΒ Β βββ deck.test.js
βΒ Β βββ grid.js
βΒ Β βββ grid.test.js
βΒ Β βββ hex.js
βΒ Β βββ hex.test.js
βΒ Β βββ logo.js
βΒ Β βββ logo.test.js
βΒ Β βββ token.js
βΒ Β βββ token.test.js
βΒ Β βββ ui.js
βΒ Β βββ ui.ssr.test.js
βΒ Β βββ ui.test.js
βββ 3d
βΒ Β βββ card.css
βΒ Β βββ card.js
βΒ Β βββ deck.css
βΒ Β βββ deck.js
βΒ Β βββ grid.js
βΒ Β βββ hex.js
βΒ Β βββ token.js
βΒ Β βββ ui.js
βββ card.js
βββ deck.js
βββ grid.js
βββ hex.js
βββ hex-utils.js
βββ hex-utils.test.js
βββ token.js
βββ ui-context.js
βββ ui.js
Each component has a file in the root directory (which is exposed as the public API) and one in each of the 2d and 3d directories. The root component just delegates to the appropriate rendering component based on a prop that you pass to the <UI>
element.
For example:
<UI>
<Deck><Card/></Deck>
</UI>
renders DOM elements as cards and decks, whereas:
<UI three={true}>
<Deck><Card/></Deck>
</UI>
renders to a threejs canvas.
Things missing in the 3D component set:
- hex grids
- grids
- tokens
Things missing in the 2D component set:
- ability to drag / drop tokens (currently only implemented for cards / decks)
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (15 by maintainers)
FYI: Might be worth checking out https://github.com/drcmda/react-three-fiber for the 3D stuff.
Alright, Iβll start working on it on that branch on my fork, and will make PR(s) to your branch as necessary.