← All posts

Building RTB Hub: A Portfolio That Plays Back

nextjsarchitecturecanvas

This is a starter post — replace it with your own writing. It exercises every feature of the blog pipeline: headings, code blocks with syntax highlighting, tables, and Mermaid diagrams.

The theming system

The entire site palette swaps by changing two CSS variables. Every color in Tailwind config references them, so purple and green can trade places with a two-line edit:

:root {
  --color-primary:   147 51 234;   /* currently purple */
  --color-secondary: 0 255 0;      /* currently green  */
}

Canvas games can't use Tailwind classes, so they resolve the same variables at draw time:

function cssCanvasColor(varName: string, alpha = 1): string {
  const rgb = getComputedStyle(document.documentElement)
    .getPropertyValue(varName)
    .trim();
  return alpha < 1 ? `rgb(${rgb} / ${alpha})` : `rgb(${rgb})`;
}

Architecture at a glance

LOADING DIAGRAM...

Trade-offs

ChoiceWinCost
Canvas games in React pagesNo engine dependencyManual game loops
CSS-variable themingTwo-line palette swapCanvas needs a resolver
Filesystem MDX blogNo CMS, posts in gitRebuild to publish

More posts soon — this pipeline makes them cheap to ship.