UICraft / Craft
CSSPixel Weather

How Pixel Weather works

A compact weather box built from bitmap temperatures and weather icons.

Demo
Pixel weatherSample data

Sunny, 24 degrees Celsius. Orange device. Sample weather data.

Current conditions

Sunny

Condition

How it works

01 — Start with a display inside a case

The visible structure has three layers: a colored Shell, a dark recessed well, and the screen. The well supplies depth; the screen carries the weather text and icons. Start with that plain layout before filling the screen.

01-screen-structure.tsx
<Shell finish={finish}>
  <div style={wellPaint(finish)}>
    <div className="rounded-[14px]">
      {/* Weather content goes here. */}
    </div>
  </div>
</Shell>

02 — Draw weather with bitmaps

A bitmap is a grid of 1s and 0s. Each 1 becomes a lit SVG circle; each 0 becomes a dim circle. The five conditions reuse that drawing method for the large weather icon, while the temperature uses five-column digit patterns. On screen, changing a condition swaps the dot pattern without changing the physical display.

02-bitmap-dots.tsx
{rows.join("").split("").map((bit, index) => (
  <circle
    key={index}
    cx={(index % cols) + 0.5}
    cy={Math.floor(index / cols) + 0.5}
    className={bit === "1" ? "fill-current" : "fill-white/5"}
  />
))}

03 — Fill the display with black

The screen stays black when the device color changes. That gives the bitmap dots a consistent background and lets the surrounding well provide the depth.

03-black-screen.tsx
<div className="rounded-[14px] border border-black/70 bg-black">
  {/* Weather content goes here. */}
</div>

Try switching between the device colors. The shell and well change, but the screen stays black.

04 — Keep the information usable

The condition selector and unit buttons update React state. aria-pressed marks the selected unit, while the screen-reader-only aria-live sentence announces the current condition and temperature. The dot fill transition is disabled when someone requests reduced motion. It uses CSS rather than a timer, so there is no animation cleanup.

Check: Which layer changes with the device color, and how is the selected temperature unit announced?