Guide 1 of 2

Design an HTML page from scratch

Build an HTML page that tells your story the way you want to tell it: as slides, a document, a poster, a timeline or an interactive page. An AI chat can do the building. This page gives it the rules and gives you the prompts. When the page is ready, Add Deck Remote to an HTML page takes you through the phone controls.

Step 1Give the AI the brief

Claude, ChatGPT and Gemini can all build the page for you, as long as you give them the rules. In each prompt below, replace the words in [square brackets] with your own. Would you rather write the HTML yourself? Go to Structure that works best.

The AI doesn't know about Deck Remote. The brief is one page of rules covering how to structure the page, which keys to leave free, and every control the phone can draw. Without it you'll get a page the remote can only half drive.

  • Paste it at the top of your first message, then paste a prompt below it.
  • Or save it once where the AI keeps standing instructions, such as a Project in Claude or ChatGPT, or a Gem in Gemini. Every chat there then knows the rules, and you only paste the prompts.

Download it (.md)

Show the brief
# Deck Remote brief

I'm making an HTML page that I'll present from a laptop and control from my phone with Deck Remote (https://uxd.zennia.sg). Follow these rules whenever you write or change the HTML, so the remote can drive it.

## The file
- One self-contained .html file: HTML, CSS and JavaScript all inline. No build step, no frameworks, no npm. Google Fonts are fine; images are inline SVG or data URIs.
- It must work when opened straight from disk (file://) in Chrome: no fetch() of local files.
- A meaningful <title>. The phone shows it.
- A solid background colour on <body>, and on each slide if slides differ. The phone tints itself to match.
- Always return the complete file, never "rest unchanged".

## Structure
- Every slide, section, poster block, timeline event or step is a <section class="slide"> directly inside <div id="deck">. Nothing else goes directly in #deck.
- Each .slide starts with a heading (h1 to h3), or has an aria-label. That is its title in the phone's "Jump to slide" list.
- Exactly one .slide has the class is-live: the one showing, or, in a scrolling layout, the one in view.
- A global function show(n), 0-based, moves to slide n: it puts is-live on slide n only. In a one-at-a-time layout it shows that slide. In a scrolling layout it scrolls that slide into view. In a scrolling layout, keep is-live in step as the reader scrolls (IntersectionObserver).
- Never put the classes reading or posters on <body>. They pause the remote.

## Keys
- Listen for keydown on document, not on an element. Read e.key. Never check e.isTrusted: the remote's key presses are simulated.
- ArrowRight, PageDown and Space go to the next slide. ArrowLeft and PageUp go back. Home and End go to the first and last.
- P toggles the class presenting on <body>. In presenting mode, hide on-screen chrome (nav buttons, counters, view switchers).
- Ignore keys while focus is in an input, textarea, select or contenteditable, and when Ctrl, Cmd or Alt is held.
- Leave Q and ? free. The remote uses them.

## Several views (only if I ask for them)
- Keep the content once, as the #deck .slide sections, and restyle it per view with CSS keyed on <html data-view="slides|doc|poster|timeline">.
- A global function setView(name) switches views. show(n) must work in every view.

## The remote
The last thing before </body>:

<script async src="https://uxd.zennia.sg/v1/deck-remote.js" data-adapter="auto"></script>

Add data-scroll="on" to that tag if the page scrolls (a document, poster or scrolling story), so the phone gets Scroll up / down.

When I ask for phone controls, replace that tag with this form:

<script async src="https://uxd.zennia.sg/v1/deck-remote.js"></script>
<script>
  function startRemote() {
    DeckRemote.init({
      adapter: 'auto',
      scroll: true,            // only if the page scrolls
      actions: {
        notes: { kind: 'readout', label: 'Notes', value: () => document.querySelector('#deck .slide.is-live')?.dataset.notes || '' },
        answer: { kind: 'toggle', label: 'Show answer', key: 'v', icon: 'eye', onChange: (on) => showAnswer(on) },
      },
    });
  }
  window.DeckRemote ? startRemote() : addEventListener('deckremote:ready', startRemote, { once: true });
</script>

Each entry in actions is one control on the phone. The key is its id: short, stable, never renamed.

| kind | the page supplies | good for |
|---|---|---|
| button | run() | one-off actions: reveal, jump, reset |
| momentary | onPress(), onRelease() | acts only while held: spotlight, peek |
| toggle | onChange(on), optional value | on/off: answer, theme, overlay |
| choice | options (strings, or {value, label, color}), value, onChange(value) | a mode, a scenario, a view, a section |
| number | min, max, step, unit, value, onChange(n) | text size, zoom, speed |
| text | placeholder, maxLength (200 at most), onChange(text) | a message or question on screen |
| timer | seconds, display: 'large', resetKey | one countdown per page |
| readout | value: () => string | shown on the phone only, e.g. speaker notes |

Every control also takes: label (about 20 characters, 40 at most; name the thing, not its state), key ('d' or 'shift+d'), group (a folding section on the phone), confirm: true (asks first), icon (x, one, eye, star, shuffle, note, moon, blank, timer, play, reset, jump, present). A choice can take compact: true.

Rules for controls:
- At most 30 controls, 20 options per choice, one timer.
- Every control calls a named function in the page. Write the function if it doesn't exist.
- A readout refreshes when the slide or a control changes, not on a clock.
- Nothing private in a text or readout.

The remote already provides these, so never build them: Next/Previous, Jump to slide, Blank screen, Scroll up/down, a count-up clock, Present / Full screen, and timer +/- 30 s with preset lengths.

## Speaker notes
Put notes for a slide in a data-notes attribute on its section (200 characters at most), never on screen. The readout above shows them on the phone.

Getting the file out of the chat

  • Ask for one self-contained HTML file. The prompts below already do.
  • Preview in the chat, present from Chrome. Claude's artifacts and the Canvas in ChatGPT and Gemini are good for checking the look. They run in a sandbox, though, so the remote won't connect there. Copy or download the code, save it as something like my-talk.html, and open it in Chrome.
  • Watch for shortened files. Long files sometimes come back with "rest unchanged" in place of code. Reply "Send the complete file, nothing left out."
  • Change one thing at a time, and keep a copy of the last version that worked.

Step 2Shape the story

Don't start with the slides. Start with what you want people to take away, and let that decide the form. These two prompts don't need the brief.

2aFind the story

When you have a topic and material, but not yet a shape.

I'm preparing [a talk / a workshop / a briefing / something to send round] about [topic] for [audience]. I'll be [presenting it live in a room / talking it through on a call / sharing it for people to read on their own].

Before we make anything, interview me to find the story. Ask one question at a time and wait for my answer. Cover:
- who the audience is, and what they already know and believe
- what they should think, feel or do afterwards
- the one sentence I'd want them to repeat to a colleague
- what material I have, and what's missing
- how long I have, and what could go wrong

Then give me:
1. the story in one sentence
2. two or three possible shapes for it (for example problem → insight → proposal, then → now → next, or question → evidence → answer), each with a short outline
3. the one you recommend, and why

2bChoose the form

When you know the story and want to decide how people will see it.

Here is my story and outline: [paste]

Recommend the best form for telling it. Choose from: slides (one idea per screen), a document that reads top to bottom, a poster or one-pager, a timeline, a scrolling story that changes as you scroll, an interactive page (tabs, scenarios, a clickable prototype), or one file that can be read in several of these views.

For your top two choices, tell me:
- why it suits this story and this audience
- how it would feel to present live, and how it would read to someone on their own afterwards
- a section-by-section plan, with a heading and one line for each section

Don't write any HTML yet.

Step 3Build the page

Each prompt assumes the brief is already in the chat. Pick the form from step 2, paste your outline, and describe the look you want in plain words, e.g. "calm, lots of white space, one blue accent" or "our brand: navy #1b2a4a, Inter font".

3aSlides

A talk or workshop, one idea per screen.

Using the Deck Remote brief, make a slide deck as one self-contained HTML file.

Outline: [paste your outline, or your notes]
Audience: [who] · About [n] slides for [n] minutes
Look: [describe it]

- One idea per slide. Each headline states the point, not just the topic.
- Type big enough to read from the back of a room. No more than about 30 words on a slide, unless it's a quote or a table.
- Write speaker notes for each slide in a data-notes attribute on its section, not shown on screen.
- A small slide counter and previous/next buttons, hidden when body has the class presenting.

Return the complete file.

3bA document

A report, a proposal or an explainer that reads top to bottom, and that you can also walk a room through.

Using the Deck Remote brief, turn this into a document that reads top to bottom, as one self-contained HTML file.

Content: [paste]
Readers: [who], reading it [on a laptop / projected while I talk / on their phones]

- Each major section is a slide section in #deck, starting with its heading, so the remote can jump between sections.
- A comfortable reading column, clear headings, and a contents list at the top that links to each section.
- Keep is-live on the section in view as the reader scrolls, and make show(n) scroll to section n.
- Add data-scroll="on" to the remote's script tag.

Return the complete file.

3cOne file, several views

When the same content should work as slides in the room, a document to read afterwards, and a poster or timeline. You can switch views from your phone.

Using the Deck Remote brief, make one self-contained HTML file that can be read in these views: [slides, document, poster, timeline: keep the ones you want].

Content: [paste]
Look: [describe it]

- Write the content once, as the #deck slide sections, and restyle it for each view with CSS keyed on html data-view:
  · slides: one section at a time, filling the screen
  · document: every section in a reading column
  · poster: every section on one page in a grid, printing on one A3 page
  · timeline: sections along a line in date order (give each section a data-date)
- A global setView(name), a small view switcher in a corner (hidden in presenting mode), and keys 1 to 4 to switch views.
- show(n) works in every view: it shows section n in slides view, and scrolls to it in the others.
- Remember the last view in localStorage.

Return the complete file.

3dA poster or one-pager

Everything visible at once. You move the room's attention block by block.

Using the Deck Remote brief, make a poster about [topic] as one self-contained HTML file.

Content: [paste]
Format: [portrait, printing on A3 / landscape, filling a 16:9 screen]

- Each block of the poster is a slide section in #deck with a heading, so I can move attention from block to block with the remote.
- In presenting mode, the live block is highlighted and the others dim slightly. Outside presenting mode, all blocks look the same, for reading and printing.
- show(n) highlights block n and scrolls it into view if needed.
- A print stylesheet that fits it on one page.

Return the complete file.

3eA timeline

A history, a roadmap, a journey, or anything where the order in time is the point.

Using the Deck Remote brief, make an interactive timeline as one self-contained HTML file.

Events: [paste: date — title — one or two sentences each]

- Each event is a slide section in #deck, in date order, with its date and title as the heading.
- Draw the events along a [horizontal / vertical] line. The live event is enlarged and the line fills up to it, so Next and Previous walk the audience through time.
- show(n) moves to event n with a smooth transition.
- [Optional: group the events into eras, with a coloured band behind each era.]

Return the complete file.

3fA scrolling story

Explaining a change, a system or data, where a picture evolves as the story moves on.

Using the Deck Remote brief, make a scrolling story as one self-contained HTML file.

Story: [paste the outline]
The visual: [e.g. a diagram of the process / a chart of the numbers / a map], built in HTML and SVG

- The visual stays fixed on one side and the text steps scroll past on the other. Each step is a slide section in #deck.
- When a step becomes live, the visual changes to match it: a highlight, a zoom, or a new layer.
- show(n) scrolls step n to the middle of the screen. Add data-scroll="on" to the remote's script tag.
- On narrow screens, put the visual above the text.

Return the complete file.

3gAn interactive page or prototype

Demoing a design, comparing scenarios, or letting the room explore options with you.

Using the Deck Remote brief, make an interactive page as one self-contained HTML file: [a clickable prototype of … / a comparison of three scenarios for … / an explorer for …].

What people should be able to do: [e.g. switch between three user journeys, toggle before and after, open each step in turn]

- Put every change of state behind a named global function, e.g. setScenario('b'), openStep(3) or toggleBefore(), so each one can be triggered from my phone later.
- If there's a sequence, make each step a slide section in #deck so show(n) can go to it.
- At the end, list the functions you created, with one line each on what they do.

Return the complete file.

3hStart from what you already have

You have a PowerPoint, a Word document, a PDF or notes. To keep a PowerPoint looking exactly as it does, use the PowerPoint converter instead.

Using the Deck Remote brief, turn this into [slides / a document / a poster / a timeline / one file with several views] as one self-contained HTML file.

Keep my wording where it works and tighten it where it doesn't. Tell me what you changed.

[Paste the text, or attach the file]

Step 4Structure that works best

This is what the brief asks the AI to do. Use it if you write the HTML yourself, or to understand and check what the AI gave you.

The remote works on any HTML, but how much it can do depends on what it can see. Pick the pattern that matches your page.

Slides: use this structure

Put each slide in a <section class="slide"> inside <div id="deck">, mark the showing slide with is-live, and move between slides with a global function called show(n). The remote recognises this pattern and gets full control: slide numbers and titles on the phone, Jump to slide, and a Present button.

The template below is a complete deck in plain HTML, CSS and JavaScript. Start from it, or copy its structure into your own file. The parts marked needed are what the remote looks for. Style everything else however you like.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My talk</title>   <!-- the phone shows this -->
  <style>
    html, body { margin: 0; height: 100%; }
    body { background: #ffffff; color: #111111; font: 24px/1.4 system-ui, sans-serif; }

    /* needed: only the live slide shows */
    .slide { display: none; box-sizing: border-box; height: 100vh; padding: 8vh 8vw; }
    .slide.is-live { display: block; }

    /* your own on-screen extras; hidden in present mode */
    .chrome { position: fixed; right: 16px; bottom: 12px; font-size: 14px; opacity: .6; }
    body.presenting .chrome { display: none; }
  </style>
</head>
<body>

  <!-- needed: #deck containing .slide sections -->
  <div id="deck">
    <section class="slide is-live">
      <h1>My talk</h1>             <!-- the first heading is the slide's title on the phone -->
      <p>A subtitle</p>
    </section>

    <section class="slide">
      <h2>Agenda</h2>
      <ul><li>One</li><li>Two</li><li>Three</li></ul>
    </section>

    <section class="slide">
      <h2>Questions?</h2>
    </section>
  </div>

  <div class="chrome" id="counter"></div>

  <script>
    const slides = Array.from(document.querySelectorAll('#deck .slide'));
    let current = 0;

    // needed: a global show(n), 0-based, that moves the is-live class
    function show(n) {
      current = Math.max(0, Math.min(slides.length - 1, n));
      slides.forEach((s, i) => s.classList.toggle('is-live', i === current));
      document.getElementById('counter').textContent = (current + 1) + ' / ' + slides.length;
      history.replaceState(null, '', '#' + (current + 1));
    }

    // keys for the laptop; listen on document so no element needs focus
    document.addEventListener('keydown', (e) => {
      if (e.target.closest && e.target.closest('input, textarea, select, [contenteditable]')) return;
      if (e.ctrlKey || e.metaKey || e.altKey) return;
      if (['ArrowRight', 'PageDown', ' '].includes(e.key)) { e.preventDefault(); show(current + 1); }
      else if (['ArrowLeft', 'PageUp'].includes(e.key)) { e.preventDefault(); show(current - 1); }
      else if (e.key === 'Home') show(0);
      else if (e.key === 'End') show(slides.length - 1);
      else if (e.key.toLowerCase() === 'p') document.body.classList.toggle('presenting');  // the phone's Present button
    });

    show((parseInt(location.hash.slice(1), 10) || 1) - 1);   // reopen on the slide in the URL
  </script>

  <!-- needed: the remote, last -->
  <script async src="https://uxd.zennia.sg/v1/deck-remote.js" data-adapter="auto"></script>
</body>
</html>
  • Make every slide a direct part of #deck with the class slide. Anything outside #deck, like a logo, a progress bar or the counter, isn't counted as a slide.
  • Start each slide with a heading (h1–h3), or give it aria-label="…". That's the title in the phone's Jump to slide list.
  • Give the page or each slide a solid background colour. The phone tints itself to match, and the on-screen timer picks a contrasting panel.
  • Transitions are fine. Animate however you like, as long as is-live ends up on the showing slide.
  • Keep the P handler if your deck has on-screen extras to hide. It toggles body.presenting, and the phone's Present button presses P and goes full screen.
  • Don't put the classes reading or posters on <body>. In this structure they pause remote navigation, and they're reserved for a reading view.

A scrolling page

The one-line tag is enough. The phone's Scroll up / down move the page by about two-thirds of a screen, and holding a button creeps in small steps.

  • Let one thing scroll. Either the page itself, or, if you have a fixed header or sidebar, a single main content area with overflow-y: auto that fills the middle of the screen. Don't set overflow: hidden on html or body unless a panel inside scrolls instead.
  • Next / Prev do nothing on their own on a plain page, because they press the arrow keys and a browser only scrolls on real key presses. To make them jump between sections, listen for the arrows:
<script>
  // Next / Prev jump between the page's h2 headings
  const sections = Array.from(document.querySelectorAll('h2'));
  function jump(dir) {
    // the section we're in: the last heading at or above the top of the screen
    let here = -1;
    sections.forEach((h, i) => { if (h.getBoundingClientRect().top <= 10) here = i; });
    const target = sections[Math.max(0, Math.min(sections.length - 1, here + dir))];
    if (target) target.scrollIntoView({ behavior: 'smooth' });
  }
  document.addEventListener('keydown', (e) => {
    if (e.key === 'ArrowRight') jump(1);
    if (e.key === 'ArrowLeft') jump(-1);
  });
</script>

An interactive page

For prototypes and demos with tabs, steps, modals or states, the remote can drive anything your page can do through a function.

  • Put each change behind a named function, like openTab('pricing'), nextStep() or setState('error'), then give the phone a control that calls it. A choice suits tabs and states, a button suits one-off actions, and a toggle suits anything on or off.
  • If it has steps, make → and ← move between them, with a listener on document as in the slide template. Next / Prev then work straight away. If you can count the steps, give the remote a deck object to get step numbers and Jump.
  • Forms and text fields are safe. The remote ignores its own shortcuts while someone is typing in a field on your page.

Checklist for any page

  • A meaningful <title>. The phone shows it.
  • A solid background colour on <body> or on each slide.
  • Keyboard listeners on document or window, reading e.key. Don't attach them to an element that needs focus, and don't reject events where e.isTrusted is false: the remote's key presses are simulated.
  • Q and ? left free for the remote.
  • Only one thing scrolls: the page, or one main panel.
  • Anything you want to trigger from the phone lives in a named function.
  • The script tag goes in the page itself, last. If the page is embedded in another site in an <iframe>, the tag goes in the embedded page, and you click into it once so it receives key presses.

Step 5Check it, then add controls

Before you add controls, check that the remote can drive the page. Open it in Chrome, press ? to see the remote's shortcuts, and press → a few times. If something is off, ask the AI:

5aCheck against the brief

Before you present, especially after several rounds of changes.

Check my HTML file against the Deck Remote brief, rule by rule. List each rule it breaks and why that matters. Then fix them all without changing the look or the content, and return the complete file.

[paste or attach the file]

Next

NextAdd the phone controls