Documentation

minitel is a design system built on the constraints of the French Minitel: one 8×10 bitmap font, eight colours, 40×25 character cells, 64 mosaic characters and a 1200-baud modem.

It comes in three layers you can use separately:

  1. CSS kit — tokens, five themes, a cell grid and components for regular web pages (src/css/).
  2. Custom elements — <mt-terminal>, <mt-minitel>, <mt-keyboard>, <mt-bigtext>, <mt-mosaic>, <mt-typewriter> (src/js/elements/).
  3. Videotex engine — a stream writer, a STUM1B decoder, the terminal with its WebGL CRT, and a framework to write Télétel services (src/js/).

No dependency, no build step: plain CSS and ES modules.

Install

Link the stylesheet, opt in with class="mt" on any element (usually <body>), pick a theme with data-mt-theme. Load the module only if you use the custom elements.

          <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bob6664569/minitel@master/src/css/minitel.css">
          <script type="module" src="https://cdn.jsdelivr.net/gh/bob6664569/minitel@master/src/js/elements/index.js"></script>

          <body class="mt" data-mt-theme="color">
        

Or copy src/ into your project. For JavaScript, import from src/js/index.js:

          import { Videotex, Page, Teletel, Terminal } from './minitel/src/js/index.js';
        

Every rule lives in the cascade layers mt.*, so your own unlayered CSS always wins. Serve the files over HTTP (ES modules do not load from file://): npm run dev starts a tiny server.

Colours & themes

The eight Videotex colours, in the order of the attribute codes (ESC 4/n foreground, ESC 5/n background). Monochrome Minitels showed them as grey levels; the mono, amber and green themes do the same, so a design that works in colour keeps its hierarchy in grey.

  • --mt-blackESC 4/0 · 5/00 %
  • --mt-redESC 4/1 · 5/150 %
  • --mt-greenESC 4/2 · 5/270 %
  • --mt-yellowESC 4/3 · 5/390 %
  • --mt-blueESC 4/4 · 5/440 %
  • --mt-magentaESC 4/5 · 5/560 %
  • --mt-cyanESC 4/6 · 5/680 %
  • --mt-whiteESC 4/7 · 5/7100 %
ThemeUse
colorMinitel Couleur: softened phosphor primaries. Default.
monoMinitel 1, 1B and 2: STUM1B grey levels of a cool white phosphor (--mt-phosphor).
amber · greenMonochrome with another phosphor tint.
paperInk on cream, like the printed guides: colours become inks, no glow, no scanlines.

Semantic tokens

--mt-bg / --mt-fgpage background and text (black / white)
--mt-accentlabels, links, numbers (cyan)
--mt-highlightemphasis, titles, focus (yellow)
--mt-bandbands, headers, panels (blue)
--mt-success / --mt-danger / --mt-specialgreen / red / magenta
--mt-muted / --mt-dotsecondary text, dotted placeholders
--mt-on-{colour}readable text colour on each background
--mt-glassCRT glass around the picture

Cells & grid

A cell is one glyph: 8×10 font pixels, that is 0.8em × 1em. .mt and .mt-screen publish it as two absolute lengths, --mt-col and --mt-row, so spacing inside double-size text still lands on the page grid. Mosaic strokes are half a cell wide and a third of a row tall.

          <div style="padding: var(--mt-row) calc(var(--mt-col) * 2)">…</div>
        

Keep --mt-font-size (the row height) a multiple of 10px — 10, 20, 30… — and every font pixel falls on device pixels.

Type

Videotex has four character sizes. The font ships a double-width and a double-height face, selected with font-stretch; double size is simply 2em. h1, h2 and h3 default to them.

The font covers ASCII, French and Western European accents, the Videotex G2 symbols (£ § ° ± ÷ ¼ ½ ¾ Œ œ ß ← ↑ → ↓), block elements and the 64 sextants of Unicode's Symbols for Legacy Computing — mosaics are real text.

Attributes

Every Videotex attribute is a utility class.

.mt-fg-{colour} .mt-bg-{colour}ESC 4/n, ESC 5/n
.mt-inverseESC 5/13 — inverse video
.mt-underlineESC 5/10 — one font pixel on the bottom row
.mt-blinkESC 4/8 — lit two thirds of the time (off with reduced motion)
.mt-concealESC 5/8 — revealed on hover, focus or inside .mt-revealed
.mt-sepseparated (disjoint) mosaics
.mt-normal .mt-dh .mt-dw .mt-dsESC 4/12 … 4/15 — sizes
.mt-glowphosphor glow

Screen

A fixed Minitel page: 40×25 cells (.mt-screen--80 for 80 columns) scaled to the container width. Place items like a server positions its cursor: --r row (0 is the status row), --c column, --w width, --h height.

Flow

For regular pages: .mt-flow is a centred column measured in cells (--mt-measure, 40 by default, .mt-flow--wide for 80), .mt-stack spaces children by whole rows, .mt-cluster groups inline items, .mt-grid makes columns at least --mt-span cells wide.

Status row

Row 0 carries service messages; the terminal shows its connection indicator in the last column: F offline, C connected.

Fields

Empty positions show the Minitel's dotted placeholders; --len sets the width in cells.

Keys & buttons

Key names are shown in inverse video, like on the screens of the time. Buttons are key caps with a half-cell mosaic shadow.

Panels & frames

Tables

Data

Progress bars move by half cells, charts by thirds of a row: the resolution of mosaics.

Messages

.mt-dialog styles a native <dialog> as a centred pavé with a mosaic shadow.

Motion

Minitel motion is stepped: a whole cell at a time. Everything stops with prefers-reduced-motion.

CRT

.mt-crt turns any element into a tube: scanlines aligned on the font's pixel rows, phosphor glow, vignette and glass. Toggle .is-on / .is-off for the power animations. The canvas terminal has its own WebGL version.

          <div class="mt-screen mt-crt is-on">…</div>
        

Mosaics & text

<mt-bigtext>

Giant lettering drawn with sextants from the font's own glyphs (3×3 cells per character). It stays text for assistive technologies.

<mt-mosaic>

An image converted to Videotex mosaics as selectable text. Attributes: src, cols, rows, palette (color | mono), dither (ordered | floyd-steinberg | none), fit. Or pixel art with art: rows separated by |, colour letters k r g y b m c w.

<mt-typewriter>

Reveals its content at modem speed (baud, 1200 by default: 120 characters per second), keeping the markup. on-visible waits until it scrolls into view.

<mt-terminal>

A complete Minitel screen: Videotex decoder, modem throttle and WebGL CRT. Write bytes to it; listen to what the keyboard sends.

AttributeValues
thememono | color | amber | green
phosphor#rrggbb tint of the mono phosphor
baud300 | 1200 | 4800 | 9600 | 0 (instant)
effectson | off (crisp pixels)
poweron | off
keyboardon | off — capture the PC keyboard when focused
Method / event
write(data)queue Videotex (writer, bytes, binary string) at modem speed
writeNow(data)decode immediately
key(name) · type(text)simulate the keyboard
connect(line) · disconnect()attach a line end (see Télétel)
powerOn() · powerOff()with the tube animations
drain() · text()wait for the queue · read the page as text
mt-key · mt-data · mt-bell · mt-idleevents (bubbling)

<mt-minitel>

The whole device: case (Minitel 1B or 2), CRT, keyboard, power switch, LED. Give it a Télétel network and it dials, whistles, connects and bills.

          <mt-minitel model="1b" theme="mono" baud="1200"></mt-minitel>
        
          const device = document.querySelector('mt-minitel');
          device.network = new Teletel({ services: [meteo, trains] });
          await device.powerOn();
          await device.dial('3615', { code: 'METEO' }); // types the code at the kiosk
        

<mt-keyboard for="id"> can also be used alone, next to any <mt-terminal>. Events: mt-state, mt-tick (duration and cost), mt-service, mt-hangup.

Videotex writer

Videotex builds the exact byte stream a Minitel server sends. Accents go through G2, other characters are transliterated, runs are compressed with REP.

          import { Videotex } from './src/js/index.js';

          const v = new Videotex()
            .clear()                       // FF
            .cursor(false)                 // COFF
            .moveTo(1, 1).bg('blue').text(' '.repeat(40))
            .moveTo(3, 4).size('double').color('yellow').text('3615 METEO')
            .moveTo(6, 2).color('white').text('Météo à Noël')   // SS2 accents
            .moveTo(8, 2).mosaic(0b111111, 0b010101)            // G1 sextants
            .status('Bulletin de 18 h');                        // row 0

          v.bytes();   // Uint8Array
        

Remember the Videotex rule: background, underline and conceal are zone attributes. They take effect at the next space (or mosaic character) and last to the end of the row; every moveTo resets all attributes.

clear() home() moveTo(r, c)FF, RS, US — row 0 is the status row
color() bg() size() flash() invert() underline() conceal()attributes; colours by name or 0..7
text() fill(ch, n) repeat(n)G0/G2 text, REP
mosaic(...bits)G1 characters from sextant bits (bit 0 top-left … bit 5 bottom-right)
clearEOL() eraseScreen() eraseLine()CAN, CSI J, CSI K
scroll() lowercase() echo()PRO2 rouleau / minuscules, PRO3 local echo
status(text)write in row 0 and come back

Page helpers

Page extends the writer with the furniture of Télétel pages. Every helper positions itself and deals with zone attributes.

          new Page()
            .clear()
            .header({ title: 'Météo', code: 'METEO', bg: 'blue' })
            .menu(["Aujourd'hui", 'Demain', { label: 'Carte', hint: 'Nouveau' }], { row: 7 })
            .panel(15, 4, 18, 36, { bg: 'magenta', shadow: 'blue' })
            .bigText(16, 26, '19°', { color: 'green' })
            .art(20, 3, ['..yy..', '.yyyy.', 'yyyyyy'])
            .table(8, 20, [{ title: 'Ville', width: 8 }, { title: 'T°', width: 4, align: 'right' }], rows)
            .progress(22, 3, 20, 0.6)
            .hints(23, [['SUITE', 'page suivante']])
            .prompt({ label: 'Votre choix', length: 2 });
        

Also: print, center, right, label, key, paragraph, band, hline, vline, box, pager, chart; and the text helpers wrap, pad, francs.

Services

A service is an async function talking to a Session. Like a real server, the session echoes what the user types into fields; the terminal never echoes.

          export default {
            code: 'HELLO',
            name: 'Bonjour',
            description: 'Mon premier service',
            async run(session) {
              session.write(new Page().clear().header({ title: 'Bonjour' }).print(10, 3, 'Nom :'));
              const { key, value } = await session.input({ row: 10, col: 9, length: 20 });
              if (key === 'SOMMAIRE') return;        // back to the kiosk
              const answer = await session.form([    // SUITE / RETOUR between fields
                { name: 'ville', row: 12, col: 9, length: 16 },
                { name: 'dept', row: 13, col: 9, length: 2, accept: /\d/ },
              ]);
            },
          };
        
write(...data)send Videotex
input(field)edit one field → { key, value }; CORRECTION, ANNULATION handled
form(fields)several fields → { key, values }
next({ timeout })next event { type: 'char', char } or { type: 'key', key }
poll() · flush() · waitKey(keys) · sleep(ms)real-time helpers for games
identify()ENQROM: the terminal's identity
sync()resolves once the terminal has displayed everything sent: live pages and animations go at the line's pace
data · elapsed · disconnect()per-session storage, time, hang up

When the user hangs up, pending awaits reject with Disconnected, which runService swallows.

Télétel & device

Teletel is a network of services. Numbers like 3615 answer with a kiosk that asks for the service code (with a GUIDE listing); a service registered with direct: true answers its number itself, like the 3611 directory. Minitel is the device controller behind <mt-minitel>: local screen, dialing, modem handshake, connection indicator, billing.

          const network = new Teletel({ services: [meteo, trains, { ...annuaire, number: '3611', direct: true }] });
          const minitel = new Minitel({ terminal: document.querySelector('mt-terminal'), network });
          await minitel.powerOn();
          await minitel.dial('3615', { code: 'METEO' });
        

WebSocket & serial

Terminals and services talk through lines. The same service can run on a real Minitel plugged in through a USB-TTL adapter on its DIN socket (Web Serial, 1200 bauds 7E1), and the terminal can connect to a remote Videotex server over WebSocket.

          import { createLine, websocketLine, serialLine, runService } from './src/js/index.js';

          // in-page: terminal <-> service
          const [terminalEnd, serverEnd] = createLine();
          document.querySelector('mt-terminal').connect(terminalEnd);
          runService(myService, serverEnd);

          // a remote server
          document.querySelector('mt-terminal').connect(websocketLine('wss://example.org/minitel'));

          // a real Minitel (Chromium, after a click)
          runService(myService, await serialLine({ baudRate: 1200 }));
        

Mosaic imaging

          import { sampleImage, imageToMosaic, encodeCells, cellsToHTML, pixelArt, indicesToCells } from './src/js/index.js';

          const pixels = sampleImage(img, 40, 24, { fit: 'cover' });           // 80 x 72 sub-pixels
          const cells = imageToMosaic(pixels, { palette: 'color', dither: 'ordered' });
          encodeCells(new Videotex().clear(), cells, { row: 1, col: 1 });    // compact Videotex
          cellsToHTML(cells);                                                 // sextant text for the CSS kit
        

Each cell can show two colours only; the converter picks the best pair per cell, and the encoder tracks attributes, inverts patterns and uses REP to keep pages small.

Sound

MinitelAudio synthesises the French dial tone, DTMF, the ringback, the V.25/V.23 modem answer, the BEL buzz and key clicks with Web Audio. Call unlock() from a user gesture.

          const audio = new MinitelAudio();
          audio.unlock();
          await audio.dial('3615');
          await audio.ringback();
          await audio.handshake();
        

Keyboard

With a terminal focused, the PC keyboard maps to the Minitel function keys. Arrows are sent as CSI sequences, like on the Minitel 2.

MinitelPCBytes
EnvoiEntréeSEP 4/1
RetourPage ↑ · Maj+⌫SEP 4/2
RépétitionF2SEP 4/3
GuideF1SEP 4/4
AnnulationÉchap · SupprSEP 4/5
SommaireDébut · Maj+ÉchapSEP 4/6
Correction⌫SEP 4/7
SuitePage ↓ · Maj+EntréeSEP 4/8
Connexion FinFin · F10SEP 4/9

References

The decoder follows the Spécifications Techniques d'Utilisation du Minitel (STUM1B): C0 controls, attribute sequences, serial zone attributes, the G0/G1/G2 sets, REP, US positioning in binary and decimal form, row 0, CSI cursor and erase functions, PRO1/PRO2/PRO3 (ENQROM, rouleau, minuscules, echo). Colour grey levels are those of monochrome Minitels. The font, the components and the emulator are original work; no ROM or archive material is included.