@johnmorrisdotca/fuda-cards 0.9.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE.md +14 -0
- package/README.md +466 -60
- package/dist/binder.d.ts +4 -6
- package/dist/binder.js +32 -23
- package/dist/card-markup.d.ts +2 -0
- package/dist/card-markup.js +59 -0
- package/dist/card-options.d.ts +131 -0
- package/dist/card-options.js +48 -0
- package/dist/card-styles.d.ts +2 -0
- package/dist/card-styles.js +314 -0
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +27 -23
- package/dist/collection-address.d.ts +8 -0
- package/dist/collection-address.js +52 -0
- package/dist/collection-binder-view.d.ts +9 -0
- package/dist/collection-binder-view.js +123 -0
- package/dist/collection-controls.d.ts +2 -0
- package/dist/collection-controls.js +143 -0
- package/dist/collection-deck.d.ts +11 -0
- package/dist/collection-deck.js +165 -0
- package/dist/collection-dialog.d.ts +2 -0
- package/dist/collection-dialog.js +28 -0
- package/dist/collection-element.d.ts +41 -63
- package/dist/collection-element.js +288 -472
- package/dist/collection-host.d.ts +5 -0
- package/dist/collection-host.js +1 -0
- package/dist/collection-icons.d.ts +3 -0
- package/dist/collection-icons.js +19 -0
- package/dist/collection-motion.d.ts +11 -0
- package/dist/collection-motion.js +72 -0
- package/dist/collection-styles.d.ts +4 -0
- package/dist/collection-styles.js +336 -0
- package/dist/collection-views.d.ts +8 -0
- package/dist/collection-views.js +8 -0
- package/dist/collection.d.ts +140 -11
- package/dist/collection.js +139 -33
- package/dist/element-define.d.ts +2 -0
- package/dist/element-define.js +3 -0
- package/dist/element.d.ts +20 -1
- package/dist/element.js +289 -98
- package/dist/index.d.ts +9 -52
- package/dist/index.js +5 -5
- package/dist/live-3d.d.ts +126 -0
- package/dist/live-3d.js +229 -0
- package/dist/materials.d.ts +117 -6
- package/dist/materials.js +191 -28
- package/dist/motion.d.ts +2 -0
- package/dist/motion.js +4 -0
- package/dist/pile-card.js +138 -91
- package/dist/pile.d.ts +61 -8
- package/dist/pile.js +89 -29
- package/dist/stack.d.ts +42 -6
- package/dist/stack.js +28 -3
- package/dist/version.d.ts +11 -0
- package/dist/version.js +11 -0
- package/dist/wear.d.ts +147 -9
- package/dist/wear.js +273 -89
- package/dist/zoom.d.ts +1 -1
- package/dist/zoom.js +73 -42
- package/docs/API.md +783 -0
- package/docs/collection-displays.md +1 -1
- package/docs/guides/accessibility-and-theming.md +62 -0
- package/docs/guides/architecture.md +53 -0
- package/docs/guides/binder-and-piles.md +83 -0
- package/docs/guides/bundlers.md +60 -0
- package/docs/guides/card-element.md +65 -0
- package/docs/guides/collections.md +86 -0
- package/docs/guides/embed-in-an-iframe.md +39 -0
- package/docs/guides/frameworks.md +132 -0
- package/docs/guides/getting-started.md +96 -0
- package/docs/guides/html-and-cdn.md +69 -0
- package/docs/guides/ja/accessibility-and-theming.md +62 -0
- package/docs/guides/ja/architecture.md +53 -0
- package/docs/guides/ja/binder-and-piles.md +83 -0
- package/docs/guides/ja/bundlers.md +60 -0
- package/docs/guides/ja/card-element.md +65 -0
- package/docs/guides/ja/collections.md +86 -0
- package/docs/guides/ja/embed-in-an-iframe.md +39 -0
- package/docs/guides/ja/frameworks.md +132 -0
- package/docs/guides/ja/getting-started.md +96 -0
- package/docs/guides/ja/html-and-cdn.md +69 -0
- package/docs/guides/ja/live-3d.md +75 -0
- package/docs/guides/ja/materials-and-stacks.md +73 -0
- package/docs/guides/ja/motion-and-spin.md +73 -0
- package/docs/guides/ja/troubleshooting.md +60 -0
- package/docs/guides/ja/typescript-and-node.md +45 -0
- package/docs/guides/ja/upgrading.md +56 -0
- package/docs/guides/ja/wear.md +63 -0
- package/docs/guides/live-3d.md +75 -0
- package/docs/guides/materials-and-stacks.md +73 -0
- package/docs/guides/motion-and-spin.md +73 -0
- package/docs/guides/troubleshooting.md +60 -0
- package/docs/guides/typescript-and-node.md +45 -0
- package/docs/guides/upgrading.md +56 -0
- package/docs/guides/wear.md +63 -0
- package/docs/live-3d.md +59 -0
- package/package.json +81 -11
|
@@ -22,7 +22,7 @@ An item says what it is with `kind` (`"card"`, the default, or `"object"`; see `
|
|
|
22
22
|
|
|
23
23
|
## Zoom, Fit and move (every view)
|
|
24
24
|
|
|
25
|
-
Every view has the shared view controls (`@johnmorrisdotca/kazoku-ui`) on the view: zoom out,
|
|
25
|
+
Every view has the shared view controls (`@johnmorrisdotca/kazoku-ui`) on the view: zoom out, the zoom as a number, zoom in, **Fit**, and, under **More**, an arrow pad. A double press on the view goes to 2 times. Ctrl or Command with the wheel, a trackpad pinch and a two-finger pinch zoom about the pointer; zoomed in, a drag or the wheel moves the view. The views are flat, so none turns in 3D and the angle, tilt and auto-turn controls are hidden.
|
|
26
26
|
|
|
27
27
|
- The controls take every press on the view, including one that starts on a card, so a drag or a pinch works over the cards. A tap that did not move is passed to the card as a click, and the keyboard still opens a focused card with Enter.
|
|
28
28
|
- **Fit** shows every card the view draws, at most at natural size. The wall, story and atlas open at half size or larger and start at their first card; the other views open at Fit. Zoom out goes to 0.4 of Fit.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Accessibility and theming
|
|
3
|
+
section: explanation
|
|
4
|
+
order: 10
|
|
5
|
+
description: What a Fuda card and collection do for keyboards, touch, screen readers and reduced motion, what they leave to you, and every colour and size you can set.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What is built in
|
|
9
|
+
|
|
10
|
+
- **Keyboard.** The display buttons of a collection are a radio group: one tab stop, the arrow keys move the choice. A card in a display is a button with the accessible name "Inspect" and its name, and Enter or Space opens it. The view takes `+`, `-` and `0` for zoom and Fit while it is focused. The Animate button of a card is a real button with `aria-pressed`.
|
|
11
|
+
- **Touch.** Every control is at least 48 px square. A drag or a pinch on the view works even when it starts on a card; a tap that did not move is passed on to the card as a click.
|
|
12
|
+
- **Reduced motion.** With `prefers-reduced-motion: reduce`: the card's rotation, its flip transition, the art's pan, autoplay and a live 3D card are all off; flights and fans move without animating; every move still ends in the same place as with motion. This is not something you opt into.
|
|
13
|
+
- **No hidden surprises.** A card never autoplays by itself, and Auto-turn does not start when the reader asks for reduced motion.
|
|
14
|
+
- **A picture's description is yours.** The art in a card is whatever you slot into it. Give each `<img>` an `alt`; for items in a collection, `name` is what a screen reader hears.
|
|
15
|
+
|
|
16
|
+
## What is left to you
|
|
17
|
+
|
|
18
|
+
Contrast of the art you supply, descriptions for your images, and the page around the element. Browser, assistive technology and device coverage is limited (see the [limits](../../README.md#limits)): everything here has been tested in headless Chromium at a desk and a phone size, and not on a real phone, in Safari or in Firefox.
|
|
19
|
+
|
|
20
|
+
## Light and dark
|
|
21
|
+
|
|
22
|
+
A collection follows the reader's light or dark setting by default. `theme="light"` or `theme="dark"` on the element chooses for them. The Card Studio and the demos read `?theme=` from the address for the same reason.
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<fuda-collection view="deck" theme="dark"></fuda-collection>
|
|
26
|
+
<script type="module">
|
|
27
|
+
import '@johnmorrisdotca/fuda-cards/collection-element';
|
|
28
|
+
document.querySelector('fuda-collection').cards = [{ name: 'Alpha', image: '/a.jpg' }];
|
|
29
|
+
</script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Size and spacing
|
|
33
|
+
|
|
34
|
+
| Setting | What it changes |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `width` of `fuda-card` | The card's size; everything inside scales (container units). Default 300 px. |
|
|
37
|
+
| `--fuda-stage-height` on `fuda-collection` | The height of the view. Default: the window less 440 px, between 300 and 620 px. |
|
|
38
|
+
| `--fuda-perspective` on `fuda-card` | The depth of 3D turns. Default `1000px`. |
|
|
39
|
+
| `--fuda-edge` on `fuda-card` | The colour of the edge, any CSS background. |
|
|
40
|
+
| `--fuda-pan-duration` | Seconds for one pass of the art's pan. |
|
|
41
|
+
| `--fuda-card-spin-duration` | Seconds for one turn of `card-spin`. Default `180s`. |
|
|
42
|
+
| `--fuda-yaw`, `--fuda-tilt` | The angles with `card-view`. |
|
|
43
|
+
| `--fuda-focus-x`, `--fuda-focus-y` | The focal point of the art. |
|
|
44
|
+
|
|
45
|
+
The shadow root is closed to your stylesheet, so these custom properties are the interface. The frame's colours come from `variant` and `finish`.
|
|
46
|
+
|
|
47
|
+
## Keep the stage on screen
|
|
48
|
+
|
|
49
|
+
The zoom bar sits under the view. Keep what is above the viewer short so the controls are on the first screen; shrink `--fuda-stage-height` on a short window.
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<style>fuda-collection { --fuda-stage-height: clamp(260px, calc(100svh - 620px), 620px); }</style>
|
|
53
|
+
<fuda-collection view="case"></fuda-collection>
|
|
54
|
+
<script type="module">
|
|
55
|
+
import '@johnmorrisdotca/fuda-cards/collection-element';
|
|
56
|
+
document.querySelector('fuda-collection').cards = [{ name: 'Alpha', image: '/a.jpg' }];
|
|
57
|
+
</script>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
[Troubleshooting](troubleshooting.md) for a card that is blank or flashes, and [Motion and rotation](motion-and-spin.md) for everything that moves.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Architecture
|
|
3
|
+
section: explanation
|
|
4
|
+
order: 11
|
|
5
|
+
description: How the package is split into small modules, why a plain card loads almost nothing, and what each file in src does.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Fuda is plain TypeScript compiled to ES modules, with no framework and no 3D engine. Its design rule is that **a page pays only for what it uses**: a card with no wear never loads the wear code, a card with no stack never loads the pile code, and a page of pictures never loads three.js.
|
|
9
|
+
|
|
10
|
+
## The entry points
|
|
11
|
+
|
|
12
|
+
| Entry | File | What it is | Size (raw, gzip -9) |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| `@johnmorrisdotca/fuda-cards` | `dist/index.js` | Types and tables: variants, finishes, materials, stack presets, the stack and wear maths. No DOM. | 0.4 KB, plus its modules |
|
|
15
|
+
| `.../element` | `dist/element.js` | Registers `<fuda-card>`. | 21.4 KB, 6.5 KB |
|
|
16
|
+
| `.../collection` | `dist/collection.js` | The collection's data rules: `parseCollection`, views, kinds, the fan's layout. No DOM. | 4.7 KB, 1.6 KB |
|
|
17
|
+
| `.../collection-element` | `dist/collection-element.js` | Registers `<fuda-collection>`. | 45.1 KB, 13.4 KB |
|
|
18
|
+
| `.../live-3d` | `dist/live-3d.js` | The focus policy for live 3D cards. | 7.5 KB, 2.3 KB |
|
|
19
|
+
|
|
20
|
+
## The modules behind them
|
|
21
|
+
|
|
22
|
+
- **`element.ts`** draws the card: two faces, an edge made of thin planes, the art slot, the Animate button and the pan, the spin. It imports `materials.ts` and `stack.ts`, and loads the rest on demand. The class it registers, `FudaCard`, is exported too, for a subclass or a type.
|
|
23
|
+
- **`wear.ts`** (17 KB) is a module of its own, loaded with `import()` only when a card has a `wear` attribute. A perfect card is drawn exactly as before.
|
|
24
|
+
- **`pile-card.ts`** (13.7 KB) holds the fan, the take-off and the side pile for `<fuda-card stack>`, loaded only when a card asks for `fan`, `taken-off` or `pile-controls`.
|
|
25
|
+
- **`pile.ts`** is what every pile shares: the landing, the fan layout and the timing (`animate`, `speed`, reduced motion). Both the card and the collection use it, so a pile behaves the same everywhere.
|
|
26
|
+
- **`stack.ts`** lays the cards under the top one from a seed (a small seeded generator, mulberry32), the same way each time.
|
|
27
|
+
- **`materials.ts`** is the table of sourced thicknesses and the stack presets.
|
|
28
|
+
- **`binder.ts`** builds the sheets, the pockets and the turning leaf.
|
|
29
|
+
- **`zoom.ts`** and **`choice.ts`** wire the collection to the view controls of kazoku-ui and draw its rows of choice buttons.
|
|
30
|
+
- **`collection-element.ts`** draws the ten displays, in the class `FudaCollection`.
|
|
31
|
+
- **`live-3d.ts`** decides which card is live; the context itself, the shared assets, the stills and the pixel budget belong to kazoku-ui's shared renderer.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { cardMaterials, stackLayout, wearLayout, wearLevels } from '@johnmorrisdotca/fuda-cards';
|
|
35
|
+
|
|
36
|
+
const levels = wearLevels({ wear: 'damaged' });
|
|
37
|
+
console.log(cardMaterials.length, stackLayout(11).length, Boolean(levels && wearLayout(levels, 1)));
|
|
38
|
+
// 13 10 true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Drawing
|
|
42
|
+
|
|
43
|
+
A card is a stack of CSS 3D planes, not WebGL. Thickness is `calc(var(--mm) * 100cqw / 63)`, so it follows the element's width, and the edge is a set of thin planes between the faces. A stack is one 3D scene whatever its count and draws nothing while at rest. Moves are CSS transforms and one-shot animations that end by themselves; nothing runs on a timer. The one place that uses WebGL is live 3D, and there only one context ever exists.
|
|
44
|
+
|
|
45
|
+
The art is kept hidden until the card has a size on screen and every slotted image has loaded, so the raw picture never shows outside the frame (see [Troubleshooting](troubleshooting.md#the-picture-flashes-before-the-card-appears)).
|
|
46
|
+
|
|
47
|
+
## Dependencies
|
|
48
|
+
|
|
49
|
+
`@johnmorrisdotca/kazoku-ui` is a runtime dependency (zoom bar, shared renderer). `three` is an optional peer, yours. A single `<fuda-card>` imports neither.
|
|
50
|
+
|
|
51
|
+
## Tests
|
|
52
|
+
|
|
53
|
+
`pnpm test` runs unit tests on the tables and the rules. `pnpm test:e2e` drives headless Chromium, in software, at a desk and a phone size, one file at a time. Both are part of `pnpm check` and the release. See [Development](../../README.md#development).
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Binders and piles
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 7
|
|
5
|
+
description: Turn the pages of a ring or zip binder, fan a pile of cards open, take a card off it and tune every move with animate and speed.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Two kinds of display show most of what a collector does: a **binder** open on two facing sheets of pockets, and a **pile** of cards that fans open and gives up one card at a time. The same code draws a pile in `<fuda-collection>` (the Overlapping Deck, Random Draw and the Fan of Cards) and in `<fuda-card stack>`.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## The binder
|
|
13
|
+
|
|
14
|
+
`view="binder"` is a binder open on two facing sheets. Each sheet is a page of clear plastic pockets with a slight sheen, one card to a pocket, on a clear or black sheet, with a strip of punched holes against the rings. Next and Previous turn the page: a leaf swings about the spine, bends as it goes and shows the pockets on its back.
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<fuda-collection view="binder" binder="zip" cover="navy" sheet="black" pockets="12"></fuda-collection>
|
|
18
|
+
<script type="module">
|
|
19
|
+
import '@johnmorrisdotca/fuda-cards/collection-element';
|
|
20
|
+
document.querySelector('fuda-collection').cards = Array.from({ length: 30 }, (_, i) => ({ name: `Card ${i + 1}`, image: `/cards/${i + 1}.jpg` }));
|
|
21
|
+
</script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Attribute | Values | Default |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `binder` | `ring`, `zip` (a zipper and its pull) | `ring` |
|
|
27
|
+
| `cover` | `green`, `black`, `teal`, `navy`, `red` | `green` |
|
|
28
|
+
| `sheet` | `clear`, `black` | `clear` |
|
|
29
|
+
| `pockets` | `4` (2 by 2), `9` (3 by 3), `12` (4 across by 3 down) | `9` |
|
|
30
|
+
|
|
31
|
+
The older `page-size` and `columns` still work and set the pockets of a sheet. Each option is also a row of buttons under the view and a value in the address. Clicking a card opens it. With `animate="off"` or reduced motion the page changes at once and ends in exactly the same place.
|
|
32
|
+
|
|
33
|
+
## The deck, and every other pile
|
|
34
|
+
|
|
35
|
+
The Overlapping Deck (`view="deck"`) draws up to ten cards with a seeded, slightly messy lie (`deck-messiness` 0 to 1, default 0.3, and `deck-seed`) and, beside it, a pile. **Next** flips the top card off the deck: it lifts, flies across and lands on the pile at the deck's other side; **Previous** brings it back. Random Draw is a pile too, and the Fan of Cards is the same pile with only its fan. Rolodex and Spotlight spread their cards out; they are carousels, not piles.
|
|
36
|
+
|
|
37
|
+
Where a card lands is `deck-land`: `face-up` (the default) keeps it facing up, `face-down` turns it over sideways about its vertical axis, like turning a page, so the pile shows the card's `backImage` or the package's own back. A card never lands with its picture on its head. The 0.6.0 value `upside-down` is still accepted and means `face-down`.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { deckLandings, fanLayout, normalizeLanding } from '@johnmorrisdotca/fuda-cards/collection';
|
|
41
|
+
|
|
42
|
+
console.log(deckLandings.map((landing) => landing.id).join(' '));
|
|
43
|
+
console.log(normalizeLanding('upside-down'), normalizeLanding('anything else'));
|
|
44
|
+
const fan = fanLayout(3);
|
|
45
|
+
console.log(fan.map((place) => place.angle).join(' '));
|
|
46
|
+
// face-up face-down
|
|
47
|
+
// face-down face-up
|
|
48
|
+
// -11 0 11
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
## Fan a pile, take a card off it
|
|
54
|
+
|
|
55
|
+
`fan="open"` spreads up to ten cards in an arc, like a hand of playing cards, with most of each card showing, and closes back exactly where they began. A card can be taken off an open fan and off a pile that was fanned and closed. In a collection the buttons are right under the view and the fan is in the address (`?fan=open`); `view="fan"` is the same pile with only its fan, `fan-size` (2 to 10) cards from the current one, and Next moves the window on.
|
|
56
|
+
|
|
57
|
+
On a card, a stack is a pile:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<script type="module">import '@johnmorrisdotca/fuda-cards/element';</script>
|
|
61
|
+
<fuda-card id="pile" title="Deck" stack="52" pile-controls></fuda-card>
|
|
62
|
+
<script type="module">
|
|
63
|
+
const pile = document.querySelector('#pile');
|
|
64
|
+
pile.addEventListener('fuda-pile', (event) => console.log('reach', event.detail));
|
|
65
|
+
pile.takeOff(3);
|
|
66
|
+
pile.putBack();
|
|
67
|
+
</script>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- `taken-off="3"` puts the top three cards on a pile at the side, as thick as the cards in it. `card.takeOff(count)` and `card.putBack(count)` change it.
|
|
71
|
+
- `pile-controls` draws three buttons (Fan, Take a card off, Put it back), each at least 48 px; leave about 70 px of room below the card.
|
|
72
|
+
- `card.pileBounds` says how far an open fan or a side pile reaches beyond the card, in card widths; the event `fuda-pile` is sent when that changes, so your page can fit its view.
|
|
73
|
+
- The pile code is a separate module (`dist/pile-card.js`) that a card loads only when it asks for `fan`, `taken-off` or `pile-controls`. A plain card never requests it.
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
## Animate and speed
|
|
78
|
+
|
|
79
|
+
`animate="off"` turns every move off (each ends at once in exactly the same place) and `speed="slow"` or `"quick"` makes every move longer or shorter. `animate` is **on** when the attribute is missing. The moves are CSS transforms and one-shot animations that end by themselves, so nothing runs while the view is idle, and the reader's reduced-motion setting always wins. Both are under the view and in the address (`?animate=off&speed=quick`).
|
|
80
|
+
|
|
81
|
+
## Rotate a pile
|
|
82
|
+
|
|
83
|
+
A pile's view controls have the angle, tilt and Auto-turn (the flat displays do not), and the whole table, both piles, turns in 3D: from behind you see the backs of the deck and the faces of a face-down pile. Objects in a collection stay square to the reader. See [Collections](collections.md) for kinds.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Bundlers
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 10
|
|
5
|
+
description: Use the card with Vite or webpack: import the element once, in code that runs in the browser, and build with nothing more to configure.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
A bundler resolves everything from `node_modules`. Import `@johnmorrisdotca/fuda-cards/element` (and `/collection-element` for the collection) once, anywhere that runs in the browser. The package marks its element files as having side effects, so a bundler keeps the import even though nothing is used from it. Both examples are built by `pnpm test:usage` from the package as npm packs it, and the page they make is opened.
|
|
9
|
+
|
|
10
|
+
## Vite
|
|
11
|
+
|
|
12
|
+
```ts no-run
|
|
13
|
+
import "@johnmorrisdotca/fuda-cards/element";
|
|
14
|
+
import { type CardOptions, cardAttributes } from "@johnmorrisdotca/fuda-cards";
|
|
15
|
+
|
|
16
|
+
const options: CardOptions = { title: "Explorer One", category: "ROCKET", stack: 10, wear: "near-mint" };
|
|
17
|
+
const card = document.createElement("fuda-card");
|
|
18
|
+
for (const [name, value] of Object.entries(cardAttributes(options))) card.setAttribute(name, value);
|
|
19
|
+
document.getElementById("app")?.append(card);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<!doctype html>
|
|
24
|
+
<html lang="en">
|
|
25
|
+
<head>
|
|
26
|
+
<meta charset="utf-8" />
|
|
27
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
28
|
+
<title>Fuda Cards with Vite</title>
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="app"></div>
|
|
32
|
+
<script type="module" src="./main.ts"></script>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## webpack
|
|
38
|
+
|
|
39
|
+
```js no-run
|
|
40
|
+
import "@johnmorrisdotca/fuda-cards/element";
|
|
41
|
+
|
|
42
|
+
const card = document.createElement("fuda-card");
|
|
43
|
+
card.setAttribute("title", "Explorer One");
|
|
44
|
+
card.setAttribute("variant", "cosmic");
|
|
45
|
+
document.body.append(card);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { fileURLToPath } from "node:url";
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
mode: "production",
|
|
53
|
+
entry: "./src/index.js",
|
|
54
|
+
output: { path: fileURLToPath(new URL("./dist", import.meta.url)), filename: "main.js" },
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## What you get
|
|
59
|
+
|
|
60
|
+
The element's modules for stacks, wear and piles are loaded only when a card asks for one, so a plain card costs little. The sizes of every entry point are in [Architecture](architecture.md).
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The card element
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 2
|
|
5
|
+
description: Every attribute, property and CSS variable of the fuda-card element, with the default of each and how to size and style a card.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`<fuda-card>` is a frame for a picture, or for anything else you slot into it. It registers itself when you import `@johnmorrisdotca/fuda-cards/element`, and that import is the only thing it needs. The main entry (`@johnmorrisdotca/fuda-cards`) exports the same options as TypeScript types and tables without touching the DOM, so it is safe to import on a server.
|
|
9
|
+
|
|
10
|
+
## The frame
|
|
11
|
+
|
|
12
|
+
| Attribute | Values | What it does |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `title` | text | The card's name at the top. |
|
|
15
|
+
| `category` | text | A word in the corner, such as `ROCKET`. |
|
|
16
|
+
| `subtitle` | text | A line under the picture. |
|
|
17
|
+
| `description` | text | The text block under the subtitle. |
|
|
18
|
+
| `number` | text | The card number at the foot. |
|
|
19
|
+
| `rarity` | text | The rarity mark at the foot. |
|
|
20
|
+
| `variant` | `classic`, `sport`, `cosmic` | The frame's look: gold, silver or violet. |
|
|
21
|
+
| `finish` | `foil`, `matte` | Whether the frame shines. |
|
|
22
|
+
| `flipped` | boolean | Shows the back, the navy Fuda face. |
|
|
23
|
+
|
|
24
|
+
The default slot holds the art: an `<img>`, or any HTML, including an existing interactive viewer. The card has no drag handler, so that viewer owns its own pointer.
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { cardFinishes, cardVariants, type CardOptions } from '@johnmorrisdotca/fuda-cards';
|
|
28
|
+
|
|
29
|
+
const options: CardOptions = { title: 'Explorer One', variant: cardVariants[2], finish: cardFinishes[0], thickness: 0.325 };
|
|
30
|
+
console.log(options.variant, options.finish);
|
|
31
|
+
// cosmic foil
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Size
|
|
35
|
+
|
|
36
|
+
The element is 300 px wide by default, `aspect-ratio: 2.5 / 3.5`, and every measurement inside it is in container units, so one CSS rule sizes the whole card:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script type="module">import '@johnmorrisdotca/fuda-cards/element';</script>
|
|
40
|
+
<style>fuda-card.small { width: 180px; }</style>
|
|
41
|
+
<fuda-card class="small" title="Small"></fuda-card>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The perspective for 3D turns is `--fuda-perspective` (default `1000px`). The edge colour is `--fuda-edge`, any CSS background; the default is gold for the classic frame and card-stock cream for the others. The drop shadow is on the element itself, so do not put a `filter` on anything between the card and its faces.
|
|
45
|
+
|
|
46
|
+
## Properties and methods
|
|
47
|
+
|
|
48
|
+
| Member | What it gives |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `card.wear` | The wear preset, as the attribute. Setting an empty string removes it. |
|
|
51
|
+
| `card.cardThicknessMm` | The thickness in use: `thickness`, else the material's, else 0.325. |
|
|
52
|
+
| `card.stackCount` | How many cards the stack holds, 1 to 1000. |
|
|
53
|
+
| `card.stackHeight` | The stack's height in millimetres. |
|
|
54
|
+
| `card.heldCount` | How many cards are still in the stack, after any taken off. |
|
|
55
|
+
| `card.fanOpen` | True while the stack is fanned open. |
|
|
56
|
+
| `card.isMoving` | True while the art pans. |
|
|
57
|
+
| `card.takeOff(count?)`, `card.putBack(count?)` | Move cards to the pile at the side and back. |
|
|
58
|
+
| `card.pileBounds` | How far an open fan or a side pile reaches beyond the card, in card widths. |
|
|
59
|
+
| `card.setFocused(on)` | Put this card in or out of focus for `autoplay="focus"`. |
|
|
60
|
+
|
|
61
|
+
The `fuda-pile` event is sent when `pileBounds` changes. The pile, wear and motion code are separate modules; see [Architecture](architecture.md).
|
|
62
|
+
|
|
63
|
+
## Related guides
|
|
64
|
+
|
|
65
|
+
Thickness and stacks: [Materials and stacks](materials-and-stacks.md). Used cards: [Wear](wear.md). Turning and panning: [Motion and rotation](motion-and-spin.md). Fanning and taking off: [Binders and piles](binder-and-piles.md).
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Collections
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 6
|
|
5
|
+
description: Show a whole collection with fuda-collection, in ten displays, from a list of items you supply, with the input rules, kinds, metadata and the address.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`<fuda-collection>` shows a list of items in one of ten displays and gives the reader a zoom bar, a choice of display and, where it makes sense, the options of that display. You supply the list; Fuda stores nothing, asks for no account and fetches nothing except the image addresses you give it.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## Give it cards
|
|
13
|
+
|
|
14
|
+
Import `@johnmorrisdotca/fuda-cards/collection-element` once, then set the `cards` **property** (an array cannot be an attribute):
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<fuda-collection view="wall" theme="light"></fuda-collection>
|
|
18
|
+
<script type="module">
|
|
19
|
+
import '@johnmorrisdotca/fuda-cards/collection-element';
|
|
20
|
+
document.querySelector('fuda-collection').cards = [
|
|
21
|
+
{ id: 'a', name: 'Alpha', image: '/cards/alpha.jpg', backImage: '/cards/alpha-back.jpg' },
|
|
22
|
+
{ id: 'b', name: 'Bravo', image: '/cards/bravo.jpg', metadata: { set: 'Base', year: 1999, number: '2' } },
|
|
23
|
+
{ id: 'c', name: 'Console', image: '/cards/console.jpg', kind: 'object' },
|
|
24
|
+
];
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The input may be an array or an object with a `cards` array. Each item needs a `name` and an `image` URL. `id` is optional (the position is used), and must be unique. `backImage` is optional; without one the package draws its own navy back.
|
|
29
|
+
|
|
30
|
+
## Check a list first
|
|
31
|
+
|
|
32
|
+
`parseCollection` is the check the element runs, exported so you can run it on a file before you hand it over. It returns the normalised list or throws an `Error` that names the item.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { collectionKinds, collectionViews, isCard, parseCollection, randomDrawIndex } from '@johnmorrisdotca/fuda-cards/collection';
|
|
36
|
+
|
|
37
|
+
const cards = parseCollection({ cards: [
|
|
38
|
+
{ name: 'Alpha', image: '/a.jpg' },
|
|
39
|
+
{ id: 'console', name: 'Console', image: '/c.jpg', kind: 'object' },
|
|
40
|
+
] });
|
|
41
|
+
console.log(cards.map((card) => `${card.id}:${isCard(card)}`).join(' '));
|
|
42
|
+
console.log(collectionKinds.join(' '), collectionViews.length);
|
|
43
|
+
console.log(randomDrawIndex(cards, 0, 'cons', () => 0));
|
|
44
|
+
try { parseCollection([{ name: 'No picture' }]); } catch (error) { console.log((error as Error).message); }
|
|
45
|
+
// 0:true console:false
|
|
46
|
+
// card object 10
|
|
47
|
+
// 1
|
|
48
|
+
// Card 1 needs a name and image URL.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`randomDrawIndex(cards, current, filter, random?)` picks a card whose name contains the filter, avoiding the current one when another matches, and gives `null` when none matches. `movePage(index, length, pageSize, delta)` returns the first index of the page `delta` pages away, wrapping round.
|
|
52
|
+
|
|
53
|
+
## Kinds
|
|
54
|
+
|
|
55
|
+
`kind` says what an item is: `"card"` (the default, so every collection written before the field existed is still cards) or `"object"`. A card is flat and thin with a back, so it turns in 3D, can be seen from behind and lands turned over when taken off a pile. An object is a picture of a thing that is not a card, such as a games console: it has no back and no thickness, so it never turns over and always lands facing up. A collection with no card in it offers no Angle, Tilt or Auto-turn, and drops an angle from the address. In a mixed collection the controls are there for the cards and each object stays square to the reader. Objects can still be fanned open and taken off a pile.
|
|
56
|
+
|
|
57
|
+
## Metadata
|
|
58
|
+
|
|
59
|
+
`metadata` is optional and has `set`, `number`, `edition`, `condition`, `grade` and `notes` (strings), and `year` and `quantity` (whole numbers, `quantity` at least 1). Nothing assumes a price or a grade.
|
|
60
|
+
|
|
61
|
+
## The ten displays
|
|
62
|
+
|
|
63
|
+
| `view` | Display | Kind of display |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `deck` | Overlapping Deck | a pile, with a pile beside it |
|
|
66
|
+
| `rolodex` | Rolodex | a carousel |
|
|
67
|
+
| `binder` | Binder Pages | sheets of pockets |
|
|
68
|
+
| `case` | Convention Display Case | cards on a ledge |
|
|
69
|
+
| `random` | Random Draw | a pile; the draw button takes a name filter |
|
|
70
|
+
| `story` | Vertical Story Scroll | a column |
|
|
71
|
+
| `wall` | Sliding Gallery Wall | a row on a wall |
|
|
72
|
+
| `spotlight` | Spotlight Carousel | one card lit, its neighbours around it |
|
|
73
|
+
| `atlas` | Card Table | all the cards on a plane |
|
|
74
|
+
| `fan` | Fan of Cards | a hand |
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
`jukebox` and `tower` were dropped in 0.8.0; they still open the deck (`collectionViewAliases`). The binder and case take `page-size` (1 to 100 cards) and `columns` (1 to 10; at most two on a small screen). The reader chooses the display with a row of buttons across the top: a radio group with one tab stop and the arrow keys.
|
|
79
|
+
|
|
80
|
+
## The address and theme
|
|
81
|
+
|
|
82
|
+
Add the boolean `address` attribute and the zoom, the display, the fan, the landing, Animate and Speed are kept in the page address (`?view=fan&fan=open&land=face-down&zoom=2`), so a link opens the same view. `theme="light"` or `theme="dark"` fixes the colours; without it they follow the reader. `--fuda-stage-height` sets the height of the view (default: the window less 440 px, between 300 and 620 px) so the controls stay on the first screen.
|
|
83
|
+
|
|
84
|
+
## Live 3D in a collection
|
|
85
|
+
|
|
86
|
+
`collection.live = { cards: live, item: (card) => itemFor(card) }` makes the card in focus turn in 3D on every display: see [Live 3D in a card](live-3d.md). For the piles and the binder in detail, see [Binders and piles](binder-and-piles.md).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Embed in an iframe
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 12
|
|
5
|
+
description: Show a card on a page you do not build, with an iframe of the embed page and the settings in its address.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`demo/embed.html` is a page made for an `<iframe>`: a card and nothing else, drawn from what its address says. It tracks nothing, keeps nothing on the visitor's device and loads nothing but the picture it was told to.
|
|
9
|
+
|
|
10
|
+
```html no-check
|
|
11
|
+
<!doctype html>
|
|
12
|
+
<html lang="en">
|
|
13
|
+
<head>
|
|
14
|
+
<meta charset="utf-8" />
|
|
15
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
16
|
+
<title>A Fuda card in an iframe</title>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<iframe
|
|
20
|
+
src="https://johnmorrisdotca.github.io/fuda-cards/demo/embed.html?title=Explorer+One&variant=sport&finish=foil&stack=10&card-spin=center"
|
|
21
|
+
title="Explorer One, a silver card on a stack of ten"
|
|
22
|
+
width="340"
|
|
23
|
+
height="480"
|
|
24
|
+
loading="lazy"
|
|
25
|
+
style="border: 0"
|
|
26
|
+
></iframe>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## The address
|
|
32
|
+
|
|
33
|
+
Every setting of `<fuda-card>` is a parameter, by its attribute name: `title`, `variant`, `finish`, `stack`, `wear`, `material`, `card-spin` and the rest of [the card element](card-element.md). A switch is `1`. `image` is the address of the picture (the Starship picture otherwise). The [Builder](https://johnmorrisdotca.github.io/fuda-cards/builder.html) writes the iframe for you, with its width and height, from the settings you choose.
|
|
34
|
+
|
|
35
|
+
A collection has its own page, `demo/embed-collection.html`, with the collection's attributes (`view`, `cover`, `pockets`) as parameters and eighteen sample cards, or the JSON file that `cards` names.
|
|
36
|
+
|
|
37
|
+
## Sizing
|
|
38
|
+
|
|
39
|
+
The page fits the iframe: the card is as wide as the iframe allows, up to 300 pixels, and keeps its proportions. Give the iframe a width and a height of 1.4 times the width plus a little room for the shadow, as the example does.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Frameworks
|
|
3
|
+
section: how-to
|
|
4
|
+
order: 11
|
|
5
|
+
description: Use the card in React, Vue, Svelte and Angular, with the element imported only in the browser, and the whole page in plain HTML, a bundler or an iframe elsewhere.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Both elements are standard custom elements, so any framework that can render a custom tag can show them. Two rules hold everywhere: **import the registration module once, in the browser only** (the elements extend `HTMLElement`, which a server does not have), and **set a collection's `cards` as a property, not an attribute**. A card's settings are attributes, and `cardAttributes(options)` writes them from an object, so the same options work in every framework. Each example below is a file in `examples/` that `pnpm test:usage` builds and opens against the package as npm packs it.
|
|
9
|
+
|
|
10
|
+
## React
|
|
11
|
+
|
|
12
|
+
The component imports the element in an effect, so a server render never reaches it, and spreads the attributes of the options. Declare the tag for TypeScript once.
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { type CardOptions, cardAttributes } from "@johnmorrisdotca/fuda-cards";
|
|
16
|
+
import { useEffect } from "react";
|
|
17
|
+
|
|
18
|
+
export function FudaCard({ picture, ...options }: CardOptions & { picture: string }) {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// The element needs a browser, so it is imported here, never at the top of the file: a server render never reaches an effect.
|
|
21
|
+
void import("@johnmorrisdotca/fuda-cards/element");
|
|
22
|
+
}, []);
|
|
23
|
+
return (
|
|
24
|
+
<fuda-card {...cardAttributes(options)}>
|
|
25
|
+
<img src={picture} alt={options.title ?? ""} />
|
|
26
|
+
</fuda-card>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
33
|
+
|
|
34
|
+
declare module "react" {
|
|
35
|
+
namespace JSX {
|
|
36
|
+
interface IntrinsicElements {
|
|
37
|
+
"fuda-card": DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> & Record<string, string | undefined>;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Vue 3
|
|
44
|
+
|
|
45
|
+
Tell the compiler that the tag is a custom element (`isCustomElement`, in the Vue plugin's `template.compilerOptions` for Vite), and import the element once the component is on the page.
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import { onMounted } from "vue";
|
|
50
|
+
|
|
51
|
+
defineProps<{ title: string; picture: string; stack?: number; wear?: string }>();
|
|
52
|
+
|
|
53
|
+
// The element needs a browser: import it once the component is on the page, never while a server renders it.
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
void import("@johnmorrisdotca/fuda-cards/element");
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<fuda-card :title="title" :stack="stack" :wear="wear"><img :src="picture" :alt="title" /></fuda-card>
|
|
61
|
+
</template>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```ts no-check
|
|
65
|
+
import { createApp, h } from "vue";
|
|
66
|
+
import FudaCard from "./FudaCard.vue";
|
|
67
|
+
|
|
68
|
+
const picture =
|
|
69
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Crect width='10' height='10' fill='%23335'/%3E%3C/svg%3E";
|
|
70
|
+
const app = createApp({ render: () => h(FudaCard, { title: "Explorer One", picture, stack: 10, wear: "near-mint" }) });
|
|
71
|
+
app.config.compilerOptions.isCustomElement = (tag) => tag === "fuda-card";
|
|
72
|
+
app.mount("#app");
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Svelte
|
|
76
|
+
|
|
77
|
+
`onMount` never runs on the server, so the import goes there.
|
|
78
|
+
|
|
79
|
+
```svelte
|
|
80
|
+
<script lang="ts">
|
|
81
|
+
import { onMount } from "svelte";
|
|
82
|
+
|
|
83
|
+
let {
|
|
84
|
+
title,
|
|
85
|
+
picture,
|
|
86
|
+
stack = 1,
|
|
87
|
+
wear = "",
|
|
88
|
+
}: { title: string; picture: string; stack?: number; wear?: string } = $props();
|
|
89
|
+
|
|
90
|
+
// The element needs a browser: onMount never runs on the server.
|
|
91
|
+
onMount(() => {
|
|
92
|
+
void import("@johnmorrisdotca/fuda-cards/element");
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<fuda-card {title} {stack} {wear}><img src={picture} alt={title} /></fuda-card>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Angular
|
|
100
|
+
|
|
101
|
+
Add `CUSTOM_ELEMENTS_SCHEMA` to the component's schemas and load the element in browser code. A property binding on `[attr.name]` writes the attribute.
|
|
102
|
+
|
|
103
|
+
```ts no-check
|
|
104
|
+
import { Component, CUSTOM_ELEMENTS_SCHEMA, Input, type OnInit } from "@angular/core";
|
|
105
|
+
|
|
106
|
+
@Component({
|
|
107
|
+
selector: "app-fuda-card",
|
|
108
|
+
standalone: true,
|
|
109
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
110
|
+
template: `<fuda-card [attr.title]="title" [attr.stack]="stack" [attr.wear]="wear"><img [src]="picture" [alt]="title" /></fuda-card>`,
|
|
111
|
+
})
|
|
112
|
+
export class FudaCardComponent implements OnInit {
|
|
113
|
+
@Input() title = "Explorer One";
|
|
114
|
+
@Input() picture =
|
|
115
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Crect width='10' height='10' fill='%23335'/%3E%3C/svg%3E";
|
|
116
|
+
@Input() stack = 10;
|
|
117
|
+
@Input() wear = "near-mint";
|
|
118
|
+
|
|
119
|
+
ngOnInit(): void {
|
|
120
|
+
// The element needs a browser: ngOnInit also runs when a server renders, so the import waits for one.
|
|
121
|
+
if (typeof window !== "undefined") void import("@johnmorrisdotca/fuda-cards/element");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## A collection in a framework
|
|
127
|
+
|
|
128
|
+
The collection takes an array, so set it as a DOM property: in React with a ref and an effect (`ref.current.cards = cards`), in Vue with `:cards.prop="cards"`, in Svelte with `bind:this` and a statement that runs when the array changes, and in Angular with the property binding `[cards]="cards"`. [Collections](collections.md) lists what an item holds.
|
|
129
|
+
|
|
130
|
+
## Where to go next
|
|
131
|
+
|
|
132
|
+
The page itself can be plain HTML from a CDN ([HTML and CDN](html-and-cdn.md)), a bundler's ([Bundlers](bundlers.md)) or an iframe of the embed page ([Embed in an iframe](embed-in-an-iframe.md)). TypeScript's types and the server side are in [TypeScript and Node](typescript-and-node.md).
|