Doc Reader
A strip of the document's pages printed in stipple (a heading, paragraphs of lines, the odd figure; stand-ins, not the real pages). On the page being read a line of dots sweeps down, the lines above it inking in as it passes, while the pages not reached yet stay faint; the strip slides along as the reading gets past the pages in view. It ends on what was read: "Read 12 pages · 4,300 words". Drive it with real progress from your parser or model, or let it read itself while you wait.
Needs: None. Canvas 2D.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | required | The file's name. |
| pages | number | required | How many pages it has. |
| words | number | – | How many words, for the line it ends on. |
| progress | number | – | How far the reading has got, 0 to 1. Leave unset and it reads itself. |
| duration | number | – | Seconds it takes when it reads itself. About half a second a page by default. |
| shown | number | 6 | Pages shown at once. |
| onDone | () => void | – | Called once the last page is read. |
| tone | string | – | The scan line. The page's accent by default. |
| pitch | number | 2 | Size of one dither cell in px. |
| className | string | – | Class on the reader. |
| style | CSSProperties | – | Style on the reader. |