Field — password last-character peek
Variant: Password peek
The mobile password convention: only the newest character is readable, so a fat-fingered key on glass can be caught without showing the whole secret over a shoulder. Two clocks decide when it masks. When the next key lands, the previous letter becomes a dot on that frame, because masking during typing is bookkeeping and the user is already looking at the new letter. When typing stops, the letter masks itself after one second: the glyph leaves in 100ms while the dot grows from 85% over 160ms on ease-out, so the two never sit on top of each other. That is the one swap that happens while someone may be watching, so it gets the soft edge. Meanwhile the caret starts its ordinary blink 500ms after the last key, which is what makes “typing stopped” readable before the mask confirms it. The loop shows both clocks: “falcon” masks key by key, the pause lets the “n” go on its own, then “-42” does the same. Glyph and dot share a fixed monospaced cell, because in a proportional field an “m” turning into a dot pulls everything after it left and the caret hops. Under reduced motion the dot keeps its fade and loses its growth.
The source
A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Field — password last-character peek</title>
<style>
:root {
/* Neutrals — fixed, never remixed. */
--ivory: #faf9f5;
--paper: #ffffff;
--oat: #e3dacc;
--slate: #141413;
/* Knobs — the remix API. A knob exists iff declared here and used below. */
--hue: 38.8;
--lift: 0;
--chroma: 1;
--round: 1;
--speed: 1;
/* Accents — derived from the knobs with the family's offsets baked in,
so one hue roll moves them together. Defaults reproduce the original hex. */
--clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
--clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
--olive: oklch(
calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
);
--rust: oklch(
calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
);
/* Clock — 5.1s. "falcon" lands 110ms a key from 400ms; a 1.25s pause
(the "n" masks itself at 1.95s); "-42" from 2.2s; the final 2
masks at 3.42s; the loop rewinds inside a fade at 4.2–4.7s. */
--cycle: 5.1s;
--t: calc(var(--cycle) / var(--speed));
--_quiet: color-mix(in srgb, var(--slate) 55%, transparent);
--_halo: color-mix(in srgb, var(--clay) 16%, transparent);
--_cell: 0.74em;
}
/* Curves are written out inside @keyframes, not as tokens: a var() in a
keyframe's animation-timing-function is dropped and falls back to
ease, which would quietly flatten every curve below. */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
padding: clamp(12px, 3vw, 28px);
background: var(--ivory);
color: var(--slate);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
}
.stack {
display: grid;
gap: 8px;
width: min(300px, 86vw);
animation: seam var(--t) infinite;
}
.title,
.foot {
font-size: 12.5px;
color: var(--_quiet);
}
.title {
font-weight: 600;
letter-spacing: 0.01em;
}
.field {
position: relative;
height: 50px;
border: 1.5px solid var(--oat);
border-radius: calc(12px * var(--round));
background: var(--paper);
}
.ring {
position: absolute;
inset: -1.5px;
border: 1.5px solid var(--clay);
border-radius: calc(12px * var(--round));
box-shadow: 0 0 0 3px var(--_halo);
}
/* Fixed cells: the glyph and the dot that replaces it share one, so
the swap never reflows the row and the caret never hops. In a
proportional field an "m" becoming a dot pulls everything after
it left by half a letter. */
.value {
position: absolute;
top: 13px;
left: 15px;
display: flex;
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
font-size: 16px;
line-height: 22px;
}
.cell {
position: relative;
width: var(--_cell);
height: 22px;
text-align: center;
}
.cell b,
.cell i {
position: absolute;
inset: 0;
font-weight: 500;
font-style: normal;
opacity: 0;
animation-duration: var(--t);
animation-timing-function: step-end;
animation-iteration-count: infinite;
}
.cell i::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0.4em;
height: 0.4em;
margin: -0.2em 0 0 -0.2em;
border-radius: 50%;
background: var(--slate);
}
/* Only the newest character is ever readable. When the next key lands
it becomes a dot on that frame — masking because the user typed on
is bookkeeping, and they are looking at the new letter anyway. When
they stop, it masks itself after 1s: the letter leaves in 100ms
and the dot grows from 85% over 160ms, so the two never sit on
top of each other. The one swap that happens while someone may be
watching gets a soft edge. */
.cell:nth-child(1) b {
animation-name: g0;
}
.cell:nth-child(1) i {
animation-name: d0;
}
.cell:nth-child(2) b {
animation-name: g1;
}
.cell:nth-child(2) i {
animation-name: d1;
}
.cell:nth-child(3) b {
animation-name: g2;
}
.cell:nth-child(3) i {
animation-name: d2;
}
.cell:nth-child(4) b {
animation-name: g3;
}
.cell:nth-child(4) i {
animation-name: d3;
}
.cell:nth-child(5) b {
animation-name: g4;
}
.cell:nth-child(5) i {
animation-name: d4;
}
.cell:nth-child(6) b {
animation-name: g5;
}
.cell:nth-child(6) i {
animation-name: d5;
}
.cell:nth-child(7) b {
animation-name: g6;
}
.cell:nth-child(7) i {
animation-name: d6;
}
.cell:nth-child(8) b {
animation-name: g7;
}
.cell:nth-child(8) i {
animation-name: d7;
}
.cell:nth-child(9) b {
animation-name: g8;
}
.cell:nth-child(9) i {
animation-name: d8;
}
.caret {
position: absolute;
top: 14px;
left: 15px;
width: 2px;
height: 19px;
margin-left: -1px;
border-radius: 999px;
background: var(--clay);
font-size: 16px;
animation:
caret var(--t) step-end infinite,
blink var(--t) step-end infinite;
}
@keyframes caret {
0% {
transform: translateX(0);
}
7.843% {
transform: translateX(calc(1 * var(--_cell)));
}
10% {
transform: translateX(calc(2 * var(--_cell)));
}
12.157% {
transform: translateX(calc(3 * var(--_cell)));
}
14.314% {
transform: translateX(calc(4 * var(--_cell)));
}
16.471% {
transform: translateX(calc(5 * var(--_cell)));
}
18.627% {
transform: translateX(calc(6 * var(--_cell)));
}
43.137% {
transform: translateX(calc(7 * var(--_cell)));
}
45.294% {
transform: translateX(calc(8 * var(--_cell)));
}
47.451% {
transform: translateX(calc(9 * var(--_cell)));
}
86.275% {
transform: translateX(0);
}
100% {
transform: translateX(0);
}
}
@keyframes blink {
0% {
opacity: 1;
}
18.627% {
opacity: 1;
}
28.431% {
opacity: 0;
}
38.235% {
opacity: 1;
}
47.451% {
opacity: 1;
}
57.255% {
opacity: 0;
}
67.059% {
opacity: 1;
}
76.863% {
opacity: 0;
}
86.275% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@keyframes seam {
0% {
opacity: 1;
}
82.353% {
opacity: 1;
animation-timing-function: ease;
}
86.275% {
opacity: 0;
}
88.235% {
opacity: 0;
animation-timing-function: ease;
}
92.157% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@keyframes g0 {
0% {
opacity: 0;
}
7.843% {
opacity: 1;
}
10% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d0 {
0% {
opacity: 0;
transform: none;
}
10% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g1 {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
12.157% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d1 {
0% {
opacity: 0;
transform: none;
}
12.157% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g2 {
0% {
opacity: 0;
}
12.157% {
opacity: 1;
}
14.314% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d2 {
0% {
opacity: 0;
transform: none;
}
14.314% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g3 {
0% {
opacity: 0;
}
14.314% {
opacity: 1;
}
16.471% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d3 {
0% {
opacity: 0;
transform: none;
}
16.471% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g4 {
0% {
opacity: 0;
}
16.471% {
opacity: 1;
}
18.627% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d4 {
0% {
opacity: 0;
transform: none;
}
18.627% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g5 {
0% {
opacity: 0;
}
18.627% {
opacity: 1;
}
38.235% {
opacity: 1;
animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
40.196% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d5 {
0% {
opacity: 0;
transform: scale(0.85);
}
38.235% {
opacity: 0;
transform: scale(0.85);
animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
41.373% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: scale(0.85);
}
100% {
opacity: 0;
transform: scale(0.85);
}
}
@keyframes g6 {
0% {
opacity: 0;
}
43.137% {
opacity: 1;
}
45.294% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d6 {
0% {
opacity: 0;
transform: none;
}
45.294% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g7 {
0% {
opacity: 0;
}
45.294% {
opacity: 1;
}
47.451% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d7 {
0% {
opacity: 0;
transform: none;
}
47.451% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: none;
}
100% {
opacity: 0;
transform: none;
}
}
@keyframes g8 {
0% {
opacity: 0;
}
47.451% {
opacity: 1;
}
67.059% {
opacity: 1;
animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
69.02% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d8 {
0% {
opacity: 0;
transform: scale(0.85);
}
67.059% {
opacity: 0;
transform: scale(0.85);
animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
70.196% {
opacity: 1;
transform: none;
}
86.275% {
opacity: 0;
transform: scale(0.85);
}
100% {
opacity: 0;
transform: scale(0.85);
}
}
@media (prefers-reduced-motion: reduce) {
/* The dot keeps its fade and loses its scale; the clock runs 1.6x
slower. */
.stack,
.cell b,
.cell i,
.caret {
animation-duration: calc(var(--t) * 1.6);
}
.cell:nth-child(6) i {
animation-name: d5-rm;
}
.cell:nth-child(9) i {
animation-name: d8-rm;
}
@keyframes d5-rm {
0% {
opacity: 0;
}
38.235% {
opacity: 0;
animation-timing-function: ease;
}
41.373% {
opacity: 1;
}
86.275% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes d8-rm {
0% {
opacity: 0;
}
67.059% {
opacity: 0;
animation-timing-function: ease;
}
70.196% {
opacity: 1;
}
86.275% {
opacity: 0;
}
100% {
opacity: 0;
}
}
}
</style>
</head>
<body>
<div
class="stack"
role="img"
aria-label="A password field where only the newest character is readable. Each letter becomes a dot as soon as the next key is pressed; when typing pauses, the last letter softly turns into a dot by itself after a second."
>
<p class="title">Password</p>
<div class="field">
<div class="ring"></div>
<span class="value" aria-hidden="true"
><span class="cell"><b>f</b><i></i></span><span class="cell"><b>a</b><i></i></span
><span class="cell"><b>l</b><i></i></span><span class="cell"><b>c</b><i></i></span
><span class="cell"><b>o</b><i></i></span><span class="cell"><b>n</b><i></i></span
><span class="cell"><b>-</b><i></i></span><span class="cell"><b>4</b><i></i></span
><span class="cell"><b>2</b><i></i></span
></span>
<span class="caret"></span>
</div>
<p class="foot">At least 8 characters</p>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.