Terminal aesthetic: a green screen that types itself
Green phosphor, scanlines and a blinking block caret. Each line types itself with one CSS animation and a steps() timing.
Motion loop
Terminal aesthetic, typed live
$ boot --warm phosphor phosphor ...... ok scanlines ..... ok$ cat todo.txt 1. make something small 2. make it well 3. ship it$
Sundry Millsundrymill.com/library
Terminal colours
-
Phosphor
-
Output
-
Amber
-
Screen
-
Title bar
The font
The font is Departure Mono by Helena Zhang, free under the SIL Open Font License. See it paired with Inter on its own page.
The code
Terminal
Each line needs --n, its number of characters, and --i, its place in the order.
HTML
<div class="term" role="img" aria-label="A green terminal typing out commands">
<div class="term-bar"><i></i><i></i><i></i><span>~/sundry-mill</span></div>
<div class="term-screen"><span class="term-line term-cmd" style="--n:22;--i:0">$ boot --warm phosphor</span><span class="term-line term-out" style="--n:20;--i:1"> phosphor ...... ok</span><span class="term-line term-out" style="--n:20;--i:2"> scanlines ..... ok</span><span class="term-line term-cmd" style="--n:14;--i:3">$ cat todo.txt</span><span class="term-line term-out" style="--n:25;--i:4"> 1. make something small</span><span class="term-line term-out" style="--n:17;--i:5"> 2. make it well</span><span class="term-line term-out" style="--n:12;--i:6"> 3. ship it</span><span class="term-line term-cmd term-last" style="--n:3;--i:7">$ <b class="term-caret"></b></span></div>
</div>
CSS
.term {
--green: #7CFF9B;
width: min(100%, 440px);
border-radius: 14px;
overflow: hidden;
background: #0B130E;
box-shadow: 0 0 0 1px rgba(124, 255, 155, .18), 0 30px 60px -30px rgba(0, 0, 0, .8);
font-family: 'Departure Mono', ui-monospace, monospace;
}
.term-bar {
display: flex;
align-items: center;
gap: 6px;
padding: 10px 14px;
background: #13201A;
color: rgba(124, 255, 155, .6);
font-size: 11px;
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(124, 255, 155, .3); }
.term-bar span { margin-left: 8px; }
.term-screen {
position: relative;
margin: 0;
padding: 16px 18px 20px;
min-height: 15em;
color: var(--green);
font: 15px/1.6 'Departure Mono', ui-monospace, monospace;
text-shadow: 0 0 6px rgba(124, 255, 155, .55);
overflow: hidden;
}
/* scanlines */
.term-screen::after {
content: "";
position: absolute;
inset: 0;
background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
pointer-events: none;
}
.term-line {
display: block;
width: 0;
white-space: pre;
overflow: hidden;
animation: term-type 8s steps(var(--n)) infinite both;
animation-delay: calc(var(--i) * .7s);
}
.term-out { color: #C8FFD6; }
@keyframes term-type {
0% { width: 0; }
8% { width: calc(var(--n) * 1ch); }
90% { width: calc(var(--n) * 1ch); }
100% { width: 0; }
}
.term-caret {
display: inline-block;
width: .6em;
height: 1.1em;
vertical-align: -.2em;
background: var(--green);
animation: term-blink 1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
How to use it
- The typing is a width animation with steps(n): the line grows one character at a time because the font is monospaced and 1ch is one character.
- The caret blinks once a second. Keep anything that flashes under three times a second so it is safe for people with photosensitive epilepsy.
- For an amber screen, swap the green for #FFB23F. It was the other common phosphor colour.
When to use it
- Developer tools, hacker themed events, a game's boot screen, a portfolio that wants a retro computer opening.
- Showing a command or a short output as part of a story, like how to install something.
- Not for real instructions people need to copy. Animated text is hard to select; show those in a plain code block too.
A worked example: an install section on a project page
A tool's page shows the install command typing itself, with a plain copyable version underneath.
- Change the lines to your own:
$ npm install your-tool, then a line of output. Give each line its --n (the number of characters) and its --i (its place in the order). - Keep the role="img" and write the aria-label as the commands themselves, so a screen reader hears them once and in full.
- Under the terminal, the same command in a normal code block with a copy button.
- The green on the screen is 14.9:1 and the output colour 16.8:1, so readability is not the problem. Motion is: wrap the typing in a prefers-reduced-motion check and show the full lines straight away for people who ask for less movement.
Full lines for reduced motion
@media (prefers-reduced-motion: reduce) {
.term-line { animation: none; width: auto; }
.term-caret { animation: none; }
}
Free to use in personal and commercial work. No credit needed, though a link back is always nice.