Why Care?
Every Lossless site that shows a deck had grown its own viewer: nine copies of the scroll-deck wrapper and four of the slide canvas, each carrying whichever fix its site needed last. The DidiDecks shell had the best play and print pieces, but they were bundled with authoring tools that write to disk, so no site outside a dididecks client-site could use them.
0.1.0 is the one copy. Install it, wrap your slides, and a deck plays, scrolls and prints the same way everywhere.
Install
pnpm add @lossless-group/dididecks-playerPeer dependency: astro 6 or later. No other runtime dependencies.
Play a deck
---
import DeckPlayer from "@lossless-group/dididecks-player/components/DeckPlayer.astro";
import PlayerSlide from "@lossless-group/dididecks-player/components/PlayerSlide.astro";
import Cover from "../slides/Cover.astro";
---
<DeckPlayer title="Firm deck" pdfHref="/firm-deck.pdf" backHref="/decks/">
<PlayerSlide title="Cover"><Cover /></PlayerSlide>
<PlayerSlide title="Portfolio" image="/slides/11.jpg" />
</DeckPlayer>A slide is either an Astro component authored at 1920×1080 or a rendered image of one. Both scale the same way.
| Key | Does |
| ← → · PageUp PageDown · Space / Shift+Space | Previous / next |
| Home · End | First / last |
| T or J | Contents: skip to any slide |
| F | Fullscreen |
| Esc | Close the contents |
Swipe works on touch screens, #N in the URL opens slide N and follows you as
you move, and ⌘P prints every slide on its own landscape page.
What's in the package
| Component | What it does |
DeckPlayer + PlayerSlide | The single-page player above |
SlideCanvas | Scales a 1920×1080 stage to any box with container queries: no JS, works in print. Centred and letterboxed. Optional wash layer via --slide-backdrop-* |
ContentFit | Opt-in island that scales overflowing content down to fit |
PageAsDeckWrapper + SlidePaginator | Scroll deck: scroll-snap sections, keyboard and double-click navigation, an NN / total indicator with type-to-jump |
DeckChrome | Floating navigation capsule for multi-page play routes |
PrintDeck | Print layout: each child becomes one landscape page |
ModeToggle + runtime/mode-switcher.ts | light / dark / vibrant on html[data-mode] |
Everything is plain Astro with scoped CSS, themed by --ddd-chrome-* tokens
that fall back to your site's --color-* and --font-*. No Tailwind, no
framework, no Reveal.js.
Fixed, compared with the copies in the shell
The chrome now knows where you are.
DeckChromelistened forddd:section-changed; the scroll deck sendsdeck:section-changed, so the first- and last-slide states never updated. It listens for both.Browser shortcuts work again. Cmd, Ctrl and Alt chords pass through: Cmd+C copies instead of hiding the chrome.
Letterboxing is even.
SlideCanvascentres its stage, so a box that isn't 16:9 gets equal bars on both sides instead of all the space on the right and bottom.
What isn't in it
The authoring half of DidiDecks stays in @dididecks/shell: the slide rater and
triage tools (dev-only, they write to the filesystem), the deck registry, and
the /play and /toc routes. The shell now depends on this package.
Where it's published
npm, as @lossless-group/dididecks-player. Not JSR: JSR only exports modules it
can parse as JavaScript or TypeScript, and .astro components aren't. The
Lossless TypeScript packages, like @lossless-group/lfm, stay on JSR.
Next
0.2 brings a better scroll deck (lossless-slides-site's PageDeck: tall slides
scroll before advancing, the URL follows the slide, reduced motion, clean
teardown across view transitions), a jump panel for scroll decks, one
html[data-chrome="off"] attribute for hiding chrome, and a mode switcher with
no flash on first paint.