Redacted line
Sentences with secret words set as shuffling block glyphs; hover or focus pops a bouncing bubble with typing dots, then a hint.
Part of the style
Pixel Redaction Notes
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/pixel-redaction-notes/redact/figma.html?palette=fd5b10e9dc049081&type=violet-difference
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/pixel-redaction-notes/redact/figma.html?palette=fd5b10e9dc049081&type=violet-difference and pass that whole HTML document to the html_to_figma tool, so the part "Redacted line" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;800&family=Newsreader:opsz,wght@6..72,400;6..72,600&display=swap");
:root {
--paper: #ffffff;
--paper-depth: #ffffff;
--well: #dddcda;
--line: #dddcda;
--marker: #c2c0bc;
--ink: #000000;
--ink-soft: #02020a;
--ink-faint: #75726a;
--dot: rgba(0, 0, 0, 0.5);
--font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, monospace;
}
</style>
<section class="redact">
<div class="redact__inner">
<h2 class="redact__label">In the workshop</h2>
<p class="redact__text">
On the side I'm building
<button class="redact__secret is-open" type="button" aria-describedby="redact-hint-1">
<span class="redact__glyphs" aria-hidden="true" data-length="9">▓▓░▒█░░▓▒</span>
<span class="redact__sr">a secret project</span>
<span class="redact__bubble" role="tooltip">
<span class="redact__dots" aria-hidden="true"><span class="redact__dot"></span><span class="redact__dot"></span><span class="redact__dot"></span></span>
<span class="redact__hint" id="redact-hint-1">A tiny bookbinding app. Out in March.</span>
</span>
</button>
and slowly teaching my
<button class="redact__secret" type="button" aria-describedby="redact-hint-2">
<span class="redact__glyphs" aria-hidden="true" data-length="7">░▒▓█▒░▓</span>
<span class="redact__sr">a second secret</span>
<span class="redact__bubble" role="tooltip">
<span class="redact__dots" aria-hidden="true"><span class="redact__dot"></span><span class="redact__dot"></span><span class="redact__dot"></span></span>
<span class="redact__hint" id="redact-hint-2">Old letterpress. It is going badly.</span>
</span>
</button>
to read.
</p>
<p class="redact__aside">Hover or tap the blocks. Some things are better said later.</p>
</div>
</section>
<style>
.redact {
padding: var(--section-space) var(--edge);
overflow-x: clip;
}
.redact__inner {
max-width: var(--measure);
margin: 0 auto;
padding-top: var(--space-m);
}
.redact__label {
margin: 0 0 var(--space-xl);
color: var(--ink);
font-size: var(--text-m);
font-weight: 500;
line-height: var(--leading-label);
}
.redact__text {
margin: 0;
color: var(--ink-soft);
font-size: var(--text-m);
line-height: var(--leading-read);
}
.redact__aside {
margin: var(--space-l) 0 0;
color: var(--ink-faint);
font-size: var(--text-s);
line-height: var(--leading-small);
}
.redact__secret {
position: relative;
display: inline-block;
min-height: 44px;
margin-block: -9px;
padding: 9px 0;
border: 0;
background: none;
color: var(--ink-soft);
font: 400 var(--text-m)/var(--leading-read) var(--font-mono);
vertical-align: baseline;
cursor: help;
border-radius: var(--radius-s);
}
.redact__secret:focus-visible {
outline: var(--rule) solid var(--ink);
outline-offset: 2px;
}
.redact__glyphs {
letter-spacing: -0.08em;
white-space: pre;
}
.redact__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.redact__bubble {
position: absolute;
left: 0;
bottom: calc(100% - 2px);
z-index: 2;
display: flex;
width: max-content;
max-width: min(320px, calc(100vw - 48px));
padding: var(--space-xs) 12px;
background: var(--well);
border-radius: var(--radius-l);
color: var(--ink);
font: 400 var(--text-m)/var(--leading-label) var(--font-body);
text-align: left;
white-space: normal;
translate: var(--redact-shift, 0px) 0;
transform-origin: 12px 100%;
visibility: hidden;
opacity: 0;
scale: 1.05;
filter: blur(6px);
transition-property: opacity, scale, filter, visibility;
transition-duration: var(--pop);
transition-timing-function: var(--ease-bounce);
}
.redact__secret:hover .redact__bubble,
.redact__secret:focus-visible .redact__bubble,
.redact__secret.is-open .redact__bubble {
visibility: visible;
opacity: 1;
scale: 1;
filter: blur(0);
}
.redact__dots {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
height: 26px;
}
.redact__dot {
width: 8px;
height: 8px;
border-radius: var(--radius-pill);
background: var(--dot);
animation: redact-pulse var(--pulse) cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.redact__dot:nth-child(2) { animation-delay: 300ms; }
.redact__dot:nth-child(3) { animation-delay: 600ms; }
.redact__hint {
display: none;
}
.redact__secret.is-said .redact__dots {
display: none;
}
.redact__secret.is-said .redact__hint {
display: block;
animation: redact-reveal var(--reveal) linear both;
}
@keyframes redact-pulse {
50% { opacity: 0.35; }
}
@keyframes redact-reveal {
from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.redact__bubble { transition: none; filter: none; }
.redact__dot { animation: none; }
.redact__secret.is-said .redact__hint { animation: none; }
}
</style>
<script>
(() => {
const BLOCKS = ['░', '▒', '▓', '█', '░', '▒', ' '];
const STEP = 90;
const SAY_AFTER = 1100;
const still = window.matchMedia('(prefers-reduced-motion: reduce)');
for (const root of document.querySelectorAll('.redact')) {
const secrets = [...root.querySelectorAll('.redact__secret')];
let timer = 0;
let onScreen = false;
const shuffle = () => {
for (const secret of secrets) {
const glyphs = secret.querySelector('.redact__glyphs');
const length = Number(glyphs.dataset.length) || glyphs.textContent.length;
let text = '';
for (let i = 0; i < length; i += 1) text += BLOCKS[Math.floor(Math.random() * BLOCKS.length)];
glyphs.textContent = text;
}
};
const run = () => {
clearInterval(timer);
timer = 0;
if (onScreen && !still.matches) timer = setInterval(shuffle, STEP);
};
new IntersectionObserver((entries) => {
onScreen = entries[0].isIntersecting;
run();
}).observe(root);
still.addEventListener('change', run);
// Keep each bubble inside the section, then let the dots give way to the words.
const place = (secret) => {
const bubble = secret.querySelector('.redact__bubble');
const box = root.getBoundingClientRect();
const anchor = secret.getBoundingClientRect();
const over = anchor.left + bubble.offsetWidth - (box.right - 16);
secret.style.setProperty('--redact-shift', `${over > 0 ? -over : 0}px`);
};
const open = (secret) => {
for (const other of secrets) if (other !== secret) other.classList.remove('is-open', 'is-said');
secret.classList.add('is-open');
place(secret);
clearTimeout(secret.sayTimer);
secret.sayTimer = setTimeout(() => { secret.classList.add('is-said'); place(secret); }, still.matches ? 0 : SAY_AFTER);
};
const close = (secret) => {
clearTimeout(secret.sayTimer);
secret.classList.remove('is-open', 'is-said');
};
window.addEventListener('resize', () => secrets.filter((s) => s.classList.contains('is-open')).forEach(place));
for (const secret of secrets) {
if (secret.classList.contains('is-open')) {
requestAnimationFrame(() => open(secret));
if (document.fonts) document.fonts.ready.then(() => place(secret));
}
secret.addEventListener('pointerenter', () => open(secret));
secret.addEventListener('focus', () => open(secret));
secret.addEventListener('click', () => (secret.classList.contains('is-said') ? close(secret) : open(secret)));
secret.addEventListener('pointerleave', (event) => { if (event.pointerType === 'mouse') close(secret); });
secret.addEventListener('blur', () => close(secret));
}
shuffle();
run();
}
})();
</script>