Logos DX
    Preparing search index...

    Coordinates the single <slides> deck in a document. One deck owns the viewport, the keys, and the URL hash, so only one Deck may be live at a time. Importing this module never creates one.

    const deck = new Deck();

    deck.on('deck:ready', ({ slide }) => console.log('starting at', slide));

    // later, before building a new deck
    deck.destroy();
    Index

    Constructors

    Methods

    • Removes listeners, key bindings, overlays, active, and data-ready, closes the notes popup, and releases the singleton. Repairs and implicit panels stay in place.

      Returns void

    • Moves to a panel with all its fragments shown, or fragment of them. An id resolves to the panel containing that element, so a link can target a heading or figure inside a slide.

      Parameters

      Returns void

      when the id matches nothing in the deck or the position or fragment count is out of range

      deck.goTo('pricing-table');
      deck.goTo({ column: 2, panel: 0, fragment: 1 });
    • Advances one step: the panel's next fragment, else the next panel in reading order, crossing into the next column after a column's last panel. No-op at the end.

      Returns void

      clicker.addEventListener('click', () => deck.next());
      
    • Moves to the first panel of the next column, skipping the rest of the current one. No-op on the last column.

      Returns void

      skipSection.addEventListener('click', () => deck.nextColumn());
      
    • Subscribes to a deck event. Subscribe right after construction to receive deck:ready, which fires asynchronously.

      Type Parameters

      Parameters

      Returns () => void

      cleanup that stops delivery

      const stop = deck.on('slide:enter', ({ column, panel }) => {
      progress.textContent = `${column + 1}.${panel + 1}`;
      });

      stop();
    • Retreats one step; the mirror of next(), re-hiding the last revealed fragment before leaving the panel. No-op at the start.

      Returns void

      backButton.addEventListener('click', () => deck.prev());
      
    • Moves to the first panel of the previous column. No-op on the first.

      Returns void

      backSection.addEventListener('click', () => deck.prevColumn());