Services table
A ruled table of material, discipline and scope whose rows go black on hover and pick a detail panel with a photograph, two ruled notes and a link.
Part of the style
Machine Shop Grid
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/machine-shop-grid/services/figma.html?palette=9999e3d929324595
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/machine-shop-grid/services/figma.html?palette=9999e3d929324595 and pass that whole HTML document to the html_to_figma tool, so the part "Services table" 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 */
:root {
--page: #4a422c;
--ink: #ccddeb;
--ink-soft: rgba(203, 220, 234, 0.65);
--paper: #3c341f;
--on-dark: #4a422c;
--rule-col: #5a523c;
--grid-dark: rgba(74, 66, 44, 0.12);
--hatch: #554d37;
--steel: #605842;
--accent: #695b2b;
}
</style>
<section class="services" aria-labelledby="services-title">
<div class="services__index">
<p class="services__strip"><span>Core disciplines</span><span class="services__arrows" aria-hidden="true">>>>>>>>><<<<<<<<</span></p>
<div class="services__intro">
<h2 class="services__title" id="services-title">Services</h2>
<p class="services__text">Four disciplines, one workshop. Glass, steel and firmware are drawn on the same sheet, so nothing is handed over blind between them.</p>
<a class="services__button" href="#">All services <span class="services__arrow" aria-hidden="true">→</span></a>
</div>
<table class="services__table">
<caption class="services__caption">Disciplines, with what each one covers</caption>
<thead>
<tr><th scope="col">Material</th><th scope="col">Discipline</th><th scope="col">Covers</th></tr>
</thead>
<tbody>
<tr class="services__row is-current" data-panel="0"><td>Glass</td><th scope="row"><button class="services__pick" type="button" aria-pressed="true">Optical design</button></th><td>Objectives</td></tr>
<tr class="services__row" data-panel="1"><td>Steel</td><th scope="row"><button class="services__pick" type="button" aria-pressed="false">Mounts & drives</button></th><td>Fork & German</td></tr>
<tr class="services__row" data-panel="2"><td>Firmware</td><th scope="row"><button class="services__pick" type="button" aria-pressed="false">Encoders & control</button></th><td>Pointing models</td></tr>
<tr class="services__row" data-panel="3"><td>Shop</td><th scope="row"><button class="services__pick" type="button" aria-pressed="false">Machining & build</button></th><td>Piers & tubes</td></tr>
</tbody>
</table>
</div>
<div class="services__detail" aria-live="polite">
<article class="services__panel">
<header class="services__head"><span class="services__label">Glass</span><h3 class="services__name">Optical design</h3></header>
<div class="services__body">
<div class="services__picture" style="--cx: 0.325; --cy: 0.137; --cw: 0.585; --ch: 0.639;"><img src="assets/lens-spindle.jpg" alt="A long room of spindle machines grinding and polishing lenses" width="800" height="549" loading="lazy"></div>
<div class="services__notes">
<div class="services__note"><h4>Objectives</h4><p>Doublets and triplets figured to a twentieth of a wave on slow spindles, checked against a flat.</p></div>
<div class="services__note"><h4>Mirrors</h4><p>Primaries up to 1.2 metres, ground, polished and silvered under one roof.</p></div>
</div>
</div>
<a class="services__more" href="#">View service <span class="services__arrow" aria-hidden="true">→</span></a>
</article>
<article class="services__panel" hidden>
<header class="services__head"><span class="services__label">Steel</span><h3 class="services__name">Mounts & drives</h3></header>
<div class="services__body">
<div class="services__picture" style="--cx: 0.235; --cy: 0.3625; --cw: 0.4; --ch: 0.255;"><img src="assets/driving-clock.jpg" alt="The open case of a telescope driving clock, gears and governor inside" width="680" height="800" loading="lazy"></div>
<div class="services__notes">
<div class="services__note"><h4>Fork mounts</h4><p>Cast and stress-relieved forks that hold a two-tonne tube still in a gusting dome.</p></div>
<div class="services__note"><h4>German mounts</h4><p>Counterweighted heads for refractors, with worm drives lapped to their own wheels.</p></div>
</div>
</div>
<a class="services__more" href="#">View service <span class="services__arrow" aria-hidden="true">→</span></a>
</article>
<article class="services__panel" hidden>
<header class="services__head"><span class="services__label">Firmware</span><h3 class="services__name">Encoders & control</h3></header>
<div class="services__body">
<div class="services__picture" style="--cx: 0; --cy: 0.126; --cw: 1; --ch: 0.755;"><img src="assets/dividing-engine.jpg" alt="An engraving of a circular dividing engine for cutting graduations into a ring" width="800" height="795" loading="lazy"></div>
<div class="services__notes">
<div class="services__note"><h4>Encoder rings</h4><p>Absolute rings read to 26 bits, cut on the dividing engine in the basement.</p></div>
<div class="services__note"><h4>Pointing models</h4><p>A sky model from two hundred stars on site, so the first target lands in the eyepiece.</p></div>
</div>
</div>
<a class="services__more" href="#">View service <span class="services__arrow" aria-hidden="true">→</span></a>
</article>
<article class="services__panel" hidden>
<header class="services__head"><span class="services__label">Shop</span><h3 class="services__name">Machining & build</h3></header>
<div class="services__body">
<div class="services__picture" style="--cx: 0.07; --cy: 0.04; --cw: 0.86; --ch: 0.892;"><img src="assets/machine-shop.jpg" alt="A long timber-roofed machine shop with lathes along one wall" width="1200" height="868" loading="lazy"></div>
<div class="services__notes">
<div class="services__note"><h4>Tubes & piers</h4><p>Steel tubes rolled and welded in house, piers cast to the plan of each site.</p></div>
<div class="services__note"><h4>Fixtures</h4><p>Every jig a commission needs, turned the same week on the long lathes downstairs.</p></div>
</div>
</div>
<a class="services__more" href="#">View service <span class="services__arrow" aria-hidden="true">→</span></a>
</article>
</div>
</section>
<style>
.services {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: var(--frame);
padding: var(--frame);
background: var(--ink);
}
.services__index,
.services__detail {
background: var(--paper);
}
.services__strip {
display: flex;
justify-content: space-between;
gap: var(--space-m);
margin: 0;
padding: var(--space-s) var(--gutter);
border-bottom: var(--hair) solid var(--ink);
background: var(--page);
font: var(--weight-label) var(--text-label)/var(--lh-label) var(--font-display);
text-transform: uppercase;
overflow: hidden;
white-space: nowrap;
}
.services__arrows {
letter-spacing: 0.08em;
}
.services__intro {
padding: var(--space-l) var(--gutter) 0;
}
.services__title,
.services__name {
margin: 0;
font: var(--weight-mid) var(--title-xl)/1 var(--font-display);
text-transform: uppercase;
letter-spacing: -0.01em;
}
.services__text {
max-width: 30em;
margin: var(--space-m) 0;
}
.services__button {
display: inline-flex;
align-items: center;
gap: var(--space-s);
height: var(--cell-h);
padding: 0 var(--cell-pad);
background: var(--ink);
color: var(--on-dark);
font: var(--weight-label) var(--text-label)/var(--lh-label) var(--font-display);
text-transform: uppercase;
text-decoration: none;
transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
.services__button:hover,
.services__button:focus-visible {
background: var(--accent);
color: var(--ink);
}
.services__arrow {
display: inline-block;
translate: -4px 0;
transition: translate var(--quick) var(--ease);
}
.services__button:hover .services__arrow,
.services__more:hover .services__arrow {
translate: 0 0;
}
.services__table {
width: calc(100% - 2 * var(--gutter));
margin: var(--space-l) var(--gutter);
border-collapse: collapse;
}
.services__caption,
.services__table thead {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}
.services__row {
border-bottom: var(--hair) solid var(--ink);
cursor: pointer;
transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
.services__row td,
.services__row th {
height: var(--tap);
padding: 0 8px;
font-size: var(--text-body);
font-weight: var(--weight-light);
text-align: left;
}
.services__row td:last-child {
text-align: right;
}
.services__pick {
width: 100%;
min-height: var(--tap);
padding: 0;
border: 0;
background: none;
color: inherit;
font: var(--weight-bold) var(--text-body)/var(--lh-body) var(--font-body);
letter-spacing: var(--track-body);
text-align: left;
cursor: pointer;
}
.services__row:hover,
.services__row.is-current {
background: var(--ink);
color: var(--on-dark);
}
.services__detail {
display: flex;
}
.services__panel {
display: flex;
flex-direction: column;
gap: var(--space-l);
width: 100%;
padding: var(--space-l) var(--gutter);
animation: services-in var(--quick) var(--ease);
}
.services__panel[hidden] {
display: none;
}
@keyframes services-in {
from { opacity: 0; }
}
.services__head {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-s) var(--space-m);
}
.services__label {
font: var(--weight-label) var(--text-label)/var(--lh-label) var(--font-display);
text-transform: uppercase;
}
.services__name {
text-align: right;
}
.services__body {
display: grid;
grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
gap: var(--space-l);
align-items: start;
}
/* A picture box cut to one region of its file: --cx and --cy place the region, --cw and --ch size it, all as fractions of the file. */
.services__picture {
position: relative;
aspect-ratio: 4 / 3;
overflow: hidden;
background: var(--steel);
}
.services__picture img {
position: absolute;
top: calc(-100% * var(--cy) / var(--ch));
left: calc(-100% * var(--cx) / var(--cw));
width: calc(100% / var(--cw));
height: calc(100% / var(--ch));
max-width: none;
filter: grayscale(1) contrast(1.35) brightness(1.08);
mix-blend-mode: multiply;
}
.services__notes {
display: grid;
gap: var(--space-m);
}
.services__note h4 {
margin: 0;
padding-bottom: var(--space-s);
border-bottom: var(--hair) solid var(--ink);
font: var(--weight-bold) var(--text-body)/var(--lh-body) var(--font-body);
}
.services__note p {
margin: var(--space-s) 0 0;
}
.services__more {
display: inline-flex;
align-items: center;
align-self: flex-end;
gap: var(--space-s);
min-height: var(--tap);
margin-top: auto;
color: var(--ink);
font: var(--weight-label) var(--text-label)/var(--lh-label) var(--font-display);
text-transform: uppercase;
text-decoration: none;
}
@media (max-width: 56rem) {
.services {
grid-template-columns: minmax(0, 1fr);
}
.services__body {
grid-template-columns: minmax(0, 1fr);
}
.services__row td:first-child {
display: none;
}
}
</style>
<script>
(() => {
const finePointer = matchMedia('(hover: hover) and (pointer: fine)');
document.querySelectorAll('.services').forEach((root) => {
const rows = [...root.querySelectorAll('.services__row')];
const panels = [...root.querySelectorAll('.services__panel')];
function choose(row) {
if (row.classList.contains('is-current')) return;
rows.forEach((other) => {
const current = other === row;
other.classList.toggle('is-current', current);
other.querySelector('.services__pick').setAttribute('aria-pressed', String(current));
});
panels.forEach((panel, index) => { panel.hidden = index !== Number(row.dataset.panel); });
}
rows.forEach((row) => {
row.addEventListener('click', () => choose(row));
row.addEventListener('pointerenter', () => { if (finePointer.matches) choose(row); });
});
});
})();
</script>