Back to Silas S. Brown's home page
Typescript player for HTML5
I wrote this to make an in-browser demonstration of Primer Pooler
It uses code from DOStoy to display a typescript in an HTML5 canvas.
- Reduces data transfer without blurring the text (although HTML5 Canvas can be blurred under some circumstances)
- New text stays entirely within the canvas and is not added to the web page, thus avoiding bad interactions with screenreaders and accessibility CSS
- Canvas appears only on wide screens, won't clutter mobile devices (I'm assuming the demonstration is non-essential)
- Animation does not start until clicked on (to avoid annoying anyone who's not looking at it), and can be paused/resumed at any time by clicking again
- No rewind control
- Won't stop the screensaver
- Can't copy/paste or change the font without looking at the source
- The terminal program must be simple: think line-mode interaction with some colours.
Full-screen editors etc will not work properly (at least not without further work on the converter)
- No screen-reader accessibility. But as mentioned above I'm assuming the demonstration is entirely optional; people who don't think visually shouldn't need it (I know I don't; I'm just doing this because apparently some sighted people want it).
Download: script2canvas.py (License: MIT)
- On a GNU/Linux terminal, do script -t log2 2>log1 and record as appropriate
- Do python script2canvas.py >demo.js
- Optionally edit the resulting demo.js file if you want to 'airbrush' your mistakes
- In your HTML, put:
<span id="DOStoyPlace"></span><script src="demo.js"></script>
All material © Silas S. Brown unless otherwise stated.