Night Shift

Eighty Columns

In the machine room, the screen is the only light. An IBM 3270 display station shows 24 rows of 80 characters, and on the green models every character glows in the same phosphor. This page turns that terminal into a site. The window is the case, the text scrolls behind the glass, and the letters come from the 3270 font, which traces back to characters copied by hand from a 3270 screen.

Nothing here needs a script. There is one HTML file, one stylesheet, and one small font file. The glass is a few gradients. The keys under the screen are radio buttons, and the stylesheet reads them with :has().

The screen

A 3270 has one size of character, and so does this page. The title, the headings and the body text are all the same size. A heading is brighter, not bigger, as an intensified field is on the terminal. A smaller heading is underscored, which was the terminal's other way to mark text.

The text column is 80 characters wide, the width of the common 3270 screen. The type grows with the window, so a wide window shows the same 80 columns in larger letters.

The line under the glass is the operator information area. On the right, it shows how far the screen has scrolled, out of 100. Browsers that cannot drive an animation from a scroll position show 001/001 there instead.

Three palettes

Green is the 3278, a monochrome terminal: one phosphor at two intensities. Blue is the 3279 colour terminal, in the colours that the x3270 emulator uses. Text that the user cannot type over is blue on that terminal, so most of the screen is blue. Dracula gives the same jobs to colours from the Dracula specification.

Job 3278 Green 3279 Blue Dracula
The glass#07110BNeutral black #1A1A1ABackground #282A36
Body textNormal #33E36BBlue #1E90FFForeground #F8F8F2
Headings, site nameIntensified #B4FFCANeutral white #FFFFFFPurple #BD93F9
Fields, cursorIntensifiedGreen #00FF00Green #50FA7B
LinksIntensifiedTurquoise #00FFFFCyan #8BE9FD
LabelsIntensifiedPink #FF00FFPink #FF79C6
Quotes, stringsNormalYellow #FFFF00Yellow #F1FA8C
KeywordsIntensifiedRed #FF0000Pink #FF79C6
Numbers, parametersNormalOrange #FFA500Orange #FFB86C
Code commentsNormal, dimmedTurquoise #00FFFFComment #6272A4

Use the keys under the screen to change the palette. To fix one palette on a page that has no keys, set data-palette on the <html> element to green, blue or dracula.

The glass

Scanlines

A repeating gradient draws a dark line on every third pixel. It lies above the text and does not scroll, so the text slides under it, as it would under real glass.

.screen::before {
  background: repeating-linear-gradient(
    to bottom, rgb(0 0 0 / 0.2) 0 1px, transparent 1px 3px
  );
}

Glow

Each character glows in its own colour. The text shadow mixes currentColor, so a link glows turquoise and a keyword glows red without a rule for each one.

.screen {
  text-shadow:
    0 0 1px color-mix(in srgb, currentColor 60%, transparent),
    0 0 0.45em color-mix(in srgb, currentColor var(--glow), transparent);
}

The case

The room light is above the terminal. The top of the case is lighter than the bottom, the keys cast short shadows downward, and the lip under the glass catches the light. Around the glass, the case picks up a little colour from the screen.

Fields

A 3270 screen is a set of fields. Protected fields hold what the program wrote; unprotected fields take what you type. Inline code is drawn as an unprotected field: PF3 leaves a panel and ENTER sends it. Links are underscored, and they turn to reverse video under the pointer.

Adding manpower to a late software project makes it later.

Fred Brooks, The Mythical Man-Month

Use it

  1. Keep ibm3270.css and the fonts folder next to your page, and link the stylesheet.
  2. Put the text in <main class="scroll">. Give the first paragraph the class opening to put its first letter in reverse video.
  3. Put the site links in <nav class="keys">, one F-key each.
  4. Colour code with seven classes: kw, fn, num, str, com, typ and arg.
/* REXX: reading time for a post, in minutes */
parse arg words perMinute .
if perMinute = '' then perMinute = 230
if words = 0 then say 'nothing to read'
else say (words + perMinute - 1) % perMinute 'minutes'

That is the whole terminal. The cursor is waiting.

Palette