kitbash Connect agent
Components

Object index

Every model as one 15 px row with its code, name, type, size and year; hovering a row fills its tiny isometric glyph black.

Part of the style

Shelf Atelier

6 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --ink: #1c0e05;
  --paper: #e1a998;
  --line: #9d7366;
  --line-soft: #bc8c7d;
  --scrim: rgba(28, 14, 5, 0.2);
}
</style>

<section class="index" aria-labelledby="index-title">
  <header class="index__head">
    <h2 class="index__title" id="index-title">_index</h2>
    <span class="index__note">Ten objects, one shelf, 2020 to 2026</span>
  </header>
  <ul class="index__list">
    <li><a class="index__row" href="#" data-dims="34 22 30"><span class="index__glyph"></span><span class="index__code">_A01</span><span class="index__name">Casa Ribera</span><span class="index__type">House</span><span class="index__size">M</span><span class="index__year">2024</span></a></li>
    <li><a class="index__row" href="#" data-dims="40 20 24"><span class="index__glyph"></span><span class="index__code">_A02</span><span class="index__name">Escalera Norte</span><span class="index__type">Stair</span><span class="index__size">S</span><span class="index__year">2022</span></a></li>
    <li><a class="index__row" href="#" data-dims="70 26 8"><span class="index__glyph"></span><span class="index__code">_A03</span><span class="index__name">Pabellón del Agua</span><span class="index__type">Pavilion</span><span class="index__size">L</span><span class="index__year">2026</span></a></li>
    <li><a class="index__row" href="#" data-dims="36 24 16"><span class="index__glyph"></span><span class="index__code">_A04</span><span class="index__name">Biblioteca Mínima</span><span class="index__type">Library</span><span class="index__size">S</span><span class="index__year">2025</span></a></li>
    <li><a class="index__row" href="#" data-dims="20 20 52"><span class="index__glyph"></span><span class="index__code">_A05</span><span class="index__name">Torre Lenta</span><span class="index__type">Tower</span><span class="index__size">XL</span><span class="index__year">2023</span></a></li>
    <li><a class="index__row" href="#" data-dims="78 14 12"><span class="index__glyph"></span><span class="index__code">_A06</span><span class="index__name">Banco Largo</span><span class="index__type">Bench</span><span class="index__size">M</span><span class="index__year">2021</span></a></li>
    <li><a class="index__row" href="#" data-dims="60 30 14"><span class="index__glyph"></span><span class="index__code">_A07</span><span class="index__name">Patio Doble</span><span class="index__type">Housing</span><span class="index__size">L</span><span class="index__year">2024</span></a></li>
    <li><a class="index__row" href="#" data-dims="38 18 16"><span class="index__glyph"></span><span class="index__code">_A08</span><span class="index__name">Mesa Plegable</span><span class="index__type">Table</span><span class="index__size">S</span><span class="index__year">2020</span></a></li>
  </ul>
</section>

<style>
  .index {
    padding: var(--edge);
    background: var(--paper);
    color: var(--ink);
  }
  .index__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 var(--gap);
    margin-bottom: var(--space-m);
  }
  .index__title {
    margin: 0;
    font-size: var(--text-mid);
    font-weight: var(--weight-bold);
    line-height: 1;
    letter-spacing: -0.02em;
  }
  .index__note {
    align-self: end;
    color: var(--line);
  }
  .index__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .index__row {
    display: grid;
    grid-template-columns: 44px 4.5em minmax(0, 2fr) minmax(0, 1fr) 3em 3.5em;
    align-items: center;
    gap: var(--gap);
    min-height: var(--tap);
    color: inherit;
    text-decoration: none;
  }
  .index__row:focus-visible {
    outline: var(--hair) solid var(--ink);
  }
  .index__code,
  .index__name {
    font-weight: var(--weight-bold);
  }
  .index__year {
    text-align: right;
  }
  .index__glyph svg {
    width: 36px;
    height: 36px;
    overflow: visible;
  }
  .index__glyph polygon {
    fill: var(--paper);
    stroke: var(--line);
    stroke-width: var(--stroke);
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    transition: fill var(--time) var(--ease), stroke var(--time) var(--ease);
  }
  .index__row:hover .index__glyph polygon,
  .index__row:focus-visible .index__glyph polygon {
    fill: var(--ink);
    stroke: var(--paper);
  }
  .index__row:hover .index__name {
    text-decoration: underline;
    text-decoration-thickness: var(--hair);
    text-underline-offset: 3px;
  }

  @media (max-width: 600px) {
    .index__row {
      grid-template-columns: 36px 3.6em minmax(0, 1fr) 2em;
      gap: var(--space-s);
    }
    .index__type,
    .index__year {
      display: none;
    }
  }
</style>

<script>
  (() => {
    const NS = 'http://www.w3.org/2000/svg';
    const COS30 = Math.cos(Math.PI / 6);
    const project = ([x, y, z]) => [(x - y) * COS30, (x + y) * 0.5 - z];
    const face = (corners) => {
      const node = document.createElementNS(NS, 'polygon');
      node.setAttribute('points', corners.map((corner) => project(corner).map((n) => n.toFixed(2)).join(',')).join(' '));
      return node;
    };

    /* One isometric block per row, sized from data-dims (width, depth, height). */
    function glyph([w, d, h]) {
      const svg = document.createElementNS(NS, 'svg');
      svg.setAttribute('aria-hidden', 'true');
      svg.append(
        face([[w, 0, 0], [w, d, 0], [w, d, h], [w, 0, h]]),
        face([[0, d, 0], [w, d, 0], [w, d, h], [0, d, h]]),
        face([[0, 0, h], [w, 0, h], [w, d, h], [0, d, h]]),
      );
      const [left, right, top, bottom] = [-d * COS30, w * COS30, -h, (w + d) * 0.5];
      const side = Math.max(right - left, bottom - top);
      svg.setAttribute('viewBox', `${(left + right - side) / 2} ${(top + bottom - side) / 2} ${side} ${side}`);
      return svg;
    }

    for (const root of document.querySelectorAll('.index')) {
      root.querySelectorAll('.index__row').forEach((row) => {
        row.querySelector('.index__glyph').append(glyph(row.dataset.dims.split(' ').map(Number)));
      });
    }
  })();
</script>

Similar components

Honours table

Honours table

Film index

Film index

Bracket table

Bracket table

Theme flood

Theme flood

Corner nav with stepped panels

Corner nav with stepped panels

Clock sentence footer

Clock sentence footer

Work globe

Work globe

Counter loader

Counter loader