Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ and the letter in the `#` part of the link never reaches the host's logs.

| Signal (SmartSpectra) | While writing | In the letter |
| --- | --- | --- |
| Pulse rate (`cardio.pulseRate`, stable values only) | Live number and a trace drawn in the ink colour | Ink colour per character: calm navy near the writer's own median, warming toward red as the heart quickens, cooling as it settles. A beating heart in the margin keeps time. The closing card finds the quickest and steadiest sentences. |
| Pulse rate (`cardio.pulseRate`, stable values only) | Live number, and each word takes its ink as you type it | Ink colour per character: iron-gall blue-black near the writer's own median, warming through claret to vermilion as the heart quickens, cooling to a clear blue-black as it settles. A pulse in the margin keeps time, and a heartline under the signature draws the whole letter's heart rate. The postscript finds the quickest and steadiest sentences. |
| Pulse wave (`cardio.arterialPressureTrace`) | Live trace | The wax seal: six seconds of the wave, wrapped into a ring and pressed into wax. Every seal is different. |
| Breathing (`breathing.upperTrace`, `breathing.rate`) | Breaths a minute | The paper rises and falls with the writer's breathing as it replays. |
| Smiles (`face.expression`, happy) | A small mark lights up | Words written while smiling glow softly. Optional. |
Expand Down Expand Up @@ -103,6 +103,7 @@ src/shared/
playback.js Replays the edits and maps the heart to ink
summary.js Quickest and steadiest sentences, smiles, words taken back
seal.js Draws the wax seal from the pulse wave
heartline.js Draws the letter's heart rate as one line of ink
sim-source.js Simulated SDK output for development and tests
test/ node --test: the core, plus the built pages in jsdom
```
Expand Down
7 changes: 4 additions & 3 deletions docs/dev-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ A handwritten letter used to tell you things the words didn't: where the pen pre

**Heartwritten** brings it back with the one signal that never lies about how a sentence felt to write: your heartbeat.

You write a letter on your laptop. While you type, SmartSpectra reads your pulse, breathing and smiles through the webcam. When you're done you seal it with a wax seal pressed from six seconds of your own pulse wave, so no two seals are alike.
You write a letter on your laptop. While you type, SmartSpectra reads your pulse, breathing and smiles through the webcam, and each word takes the ink of the heartbeat that wrote it. When you're done you seal it with a wax seal pressed from six seconds of your own pulse wave, so no two seals are alike.

The person you send it to taps the seal, it cracks, and they watch your letter being written again at your real pace:

- the **ink warms** toward red where your heart sped up, and settles back to navy as you calmed down
- the **ink warms** from blue-black through claret to vermilion where your heart sped up, and cools again as you calmed down
- a small **heart in the margin beats** at your rate, sentence by sentence
- the **paper rises and falls** with your breathing
- words you wrote **while smiling glow**
- **pauses** stay in, and the long ones are noted in the margin ("paused 14 seconds")
- **pauses** stay in, and the long ones are noted in the margin beside the line ("paused 14 seconds")
- under your signature, a **heartline** draws your whole heart rate across the letter
- if you allow it, they see the words you **typed and took back**

At the end, a card shows where your heart was quickest and where it was steadiest, with the sentences.
Expand Down
Binary file added docs/screens/after-envelope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screens/after-letter-phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screens/after-letter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screens/after-writer-write.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screens/before-envelope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 30 additions & 21 deletions src/reader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="no-referrer">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'none'; base-uri 'none'; form-action 'none'">
<meta name="color-scheme" content="light dark">
<title>Heartwritten</title>
<meta name="description" content="A letter that carries the heartbeat it was written with.">
<style>/*__READER_CSS__*/</style>
Expand All @@ -17,35 +18,53 @@ <h1 id="empty-title" class="wordmark">Heartwritten</h1>
</section>

<section class="view view-envelope" aria-labelledby="envelope-to">
<div class="envelope">
<p class="eyebrow" id="envelope-day"></p>
<header class="address">
<p class="smallcaps" id="envelope-day"></p>
<h1 id="envelope-to" class="to"></h1>
<p id="envelope-from" class="from"></p>
</header>
<div class="envelope">
<svg class="flap" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true">
<path class="flap-side" d="M0 100 L50 52 L100 100"/>
<path class="flap-top" d="M0 0 H100 L50 58 Z"/>
</svg>
<button id="seal-button" class="seal-button" aria-label="Break the seal and read">
<span id="seal" class="seal"></span>
</button>
<p class="hint">Tap the seal to open it.</p>
<p id="sim-badge" class="badge" hidden>Sample letter: the signals in it were simulated</p>
</div>
<p class="hint smallcaps">Break the seal to read</p>
<p id="sim-badge" class="sample-note" hidden>A sample letter. The heartbeat in it was simulated.</p>
<p class="fine">This letter lives only in its link. Opening it sends nothing anywhere.</p>
</section>

<section class="view view-letter" aria-label="The letter">
<div class="desk">
<div class="sheet">
<aside class="margin" aria-label="Their heartbeat">
<div id="heart" class="heart" aria-hidden="true">
<svg viewBox="0 0 32 29" width="30" height="27"><path fill="currentColor" d="M16 28.6 13.7 26.5C5.5 19.1 0 14.2 0 8.2 0 3.6 3.6 0 8.2 0c2.6 0 5.1 1.2 6.8 3.1h2C18.7 1.2 21.2 0 23.8 0 28.4 0 32 3.6 32 8.2c0 6-5.5 10.9-13.7 18.4z"/></svg>
<div class="pulse">
<span id="heart" class="heart" aria-hidden="true"></span>
<p class="bpm"><span id="heart-bpm">·</span><small>a minute</small></p>
</div>
<p class="bpm"><span id="heart-bpm">·</span><small>bpm</small></p>
<ul id="pauses" class="pauses"></ul>
<p id="took-back" class="took-back"></p>
</aside>
<article id="paper" class="paper">
<p class="eyebrow" id="letter-day"></p>
<p id="salutation" class="salutation"></p>
<header class="letterhead">
<p id="replay-sim" class="sample-note" hidden>Sample · simulated heartbeat</p>
<p class="smallcaps" id="letter-day"></p>
</header>
<div id="body-text" class="body-text"></div>
<p id="signature" class="signature"></p>
<p id="replay-sim" class="badge" hidden>Sample letter: simulated signals</p>
<figure class="heartline-wrap">
<div id="heartline" class="heartline-slot"></div>
<figcaption><span id="heartline-who" class="smallcaps"></span><span id="heartline-range" class="range"></span></figcaption>
</figure>
<section id="summary" class="postscript" hidden aria-labelledby="summary-title">
<h2 id="summary-title" class="smallcaps">While this was written</h2>
<div id="summary-body"></div>
<div class="scale" aria-hidden="true"><span>steadier</span><i></i><span>quicker</span></div>
<p class="links"><button id="replay">Watch it again</button><button id="copy-text">Copy the words</button></p>
<p class="fine">Heart rate and breathing are camera estimates, for feeling, not medicine. Written with Heartwritten on the Presage SmartSpectra SDK.</p>
</section>
</article>
</div>
<nav class="controls" aria-label="Replay controls">
Expand All @@ -54,16 +73,6 @@ <h1 id="envelope-to" class="to"></h1>
<button id="skip">Show all</button>
<button id="sound" aria-pressed="false">Hear the heartbeat</button>
</nav>
<section id="summary" class="summary" hidden aria-labelledby="summary-title">
<h2 id="summary-title">While this was written</h2>
<div id="summary-body"></div>
<p class="legend"><span class="ink calm">calm ink</span> <span class="ink warm">a quicker heart</span> <span class="ink glow">a smile</span></p>
<div class="summary-actions">
<button id="replay">Watch it again</button>
<button id="copy-text">Copy the words</button>
</div>
<p class="fine">Heart rate and breathing are camera estimates, for feeling, not medicine. Written with Heartwritten on the Presage SmartSpectra SDK.</p>
</section>
</section>
</main>
<!--__LETTER_DATA__-->
Expand Down
Loading
Loading