Brick breaker

A small brick breaker on a canvas, in the theme's colours: pointer or arrow keys, Space to launch.

Press Space or click to launch.

Features

  • A canvas game: paddle by pointer or arrow keys, Space or a click launches, clear the bricks to win.
  • Where the ball lands on the paddle steers it.
  • Colours come from the theme: accent and muted bricks, an ink paddle and ball.

Use it for

  • A 404 page.
  • An easter egg.

On this site

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

API

PropTypeWhat it does
rows / colsnumberThe wall (4 by 8).
labelstringNames the canvas.

Accessibility

Source

The code is in src/kit/brick-breaker.tsx in runets, MIT licensed.