--- name: artyfact-deck description: Use when making an HTML slide deck, presentation, animated data story or interactive report that someone will open or receive as a file, or when asked to share, send or package an HTML deck or page as a single file. Also use to edit an existing packed Artyfact .html file. Triggers on "slides", "deck", "presentation", "make it shareable", "one file", "artyfact". --- # Artyfact decks Artyfact turns a folder of HTML, CSS, JS, images and data into ONE `.html` file that opens by double-click in any browser, works offline, and unpacks back to the editable folder. Every packed deck carries a player: keyboard/swipe navigation, scale-to-fit, builds, overview grid, presenter view with notes, and Save as PDF. CLI: `artyfact` (if not on PATH: `node ~/Projects/Artyfact/bin/artyfact.js`). Format details: `~/Projects/Artyfact/docs/spec.md`. ## Workflow 1. `artyfact init --title "Q3 Review"` to start from the template, or write the folder yourself following the contract below. 2. Author `index.html`, `styles.css`, and any `app.js` / `data/*.json` / `img/*`. 3. `artyfact pack ` writes `.artyfact` (opens in the Artyfact app). Add `-o .html` for a copy that opens in any browser; the bytes are identical. Read the warnings and fix any you can. 4. `artyfact check .html --shots /shots`. It opens the file in headless Chrome **with the network blocked**, walks every slide, and reports script errors, anything that still needs the internet, and text that overflows or is clipped. 5. Look at `/shots/overview.png` (all slides on one image), then individual `slide-NN.png` files where something looks off. Fix, repack, recheck until `OK`. 6. Deliver the `.artyfact` (and the `.html` copy when recipients may not have the app). Mention the size; under 15 MB survives email. To change a deck you only have as a packed file: `artyfact unpack deck.html -o deck-src`, edit, then pack again. Never hand-edit large base64 blobs in a packed file. ## Deck contract ```html

Title

Appears on the first click

Appears on the second click

``` - Every slide is a direct child `.slide` of `.deck`. Design for the fixed canvas (default 1920×1080) in px; the player scales it. Do **not** set width, height or position on `.slide` or `.deck`; style their content and backgrounds only. - Other children of `.deck` (a logo footer, say) render on top of every slide while presenting and are hidden in overview and print. - Builds: `data-step` reveals in document order; `data-step="2"` groups elements into the same click. `data-step-effect="fade|zoom|none"` changes the reveal (default fade-up). - Enter animations: style the final state under `.slide.is-active …`. The player adds `.is-active` to the showing slide, and to every slide in overview and print, so final states also print. `.is-current` marks only the slide being presented. - JS hooks (the player defines `window.Artyfact` before your scripts run): - `Artyfact.onEnter('#slide-id', ({ slide, index }) => …)`: runs each time that slide appears (and immediately if it is already showing). Use it to replay chart animations or count-ups. - `Artyfact.on('slidechange' | 'enter' | 'leave' | 'step', fn)`, `Artyfact.go(i)`, `.next()`, `.prev()`, `.index`, `.step`. - Guard with `window.Artyfact?.` so the source folder still runs without the player. - `data-transition="slide|none"` on `.deck` or a slide; default is a crossfade. ## Portability rules (what makes the single file work) - Local files referenced from HTML, CSS or JS string literals (`fetch('data/x.json')`, `img.src = 'img/a.png'`) are inlined automatically. Keep paths as plain string literals relative to `index.html`; computed paths (`'img/' + name`) cannot be found. - CDN scripts, Google Fonts and remote images are downloaded and inlined. `