Shaders / Examples / Ember

Ember

The footer: the wordmark as hot iron, the one place where orange rises.

Drawn with
Canvas 2D
Chain
hearth → palette
Code
@forgeron/shaders: builtInPresets()["role-ember"]
/01 → What it is
  • Cells of five tones by the 8×8 Bayer matrix: iron letters, white hot then ember at their foot, on a bed of embers with a few rising sparks; the pointer is the bellows.
  • Orange here and on the anvil only: the rest of the language stays grey.
  • Without JavaScript the wordmark stands in cold iron at the same place.
/02 → Where Forgeron uses it
SiteWhereSettings
forgeron.shFooter of every page, under the site indexmountHearth(footer) · cells of 4 px, 2 px under 560 px
/03 → Versions
  • /01 Footercell 4
  • /02 Narrowcell 2
  • /03 Another wordtext="Forge"
  • /04 Stillstill
/04 → Use it
/01 → React
import { Hearth } from "@forgeron/ui";

<Hearth text="Forgeron">
  <nav className="footer-links">…</nav>
</Hearth>
/02 → Astro, plain DOM
<div class="fg-hearth" data-hearth>
  <canvas aria-hidden="true"></canvas>
  <nav>…</nav>
  <div class="fg-hearth-word" data-hearth-word><PixelText text="forgeron" /></div>
</div>

<script>
  import { mountHearth } from "@forgeron/ui";

  const hearth = document.querySelector<HTMLElement>("[data-hearth]");
  if (hearth) mountHearth(hearth);
</script>
/03 → Preset "role-ember" (builtInPresets())
{
  "$schema": "https://shaders.forgeron.sh/schema/preset.v1.json",
  "version": 1,
  "name": "role-ember",
  "source": {
    "type": "hearth"
  },
  "passes": [
    {
      "type": "palette",
      "tones": [
        "--bg",
        "--line-strong",
        "--ink-dim",
        "--ink",
        "--accent"
      ],
      "transparent": [
        0
      ]
    }
  ]
}
API → Options
OptionTypeDefaultDescription
textstring"Forgeron"The wordmark, in the pixel face's capitals.
cellnumber4, 2 under 560 pxCell side in CSS pixels.
stillboolean—One frame at t = 0. Without it, the reader's prefers-reduced-motion decides.
childrenReactNode—Content laid over the embers, above the wordmark.