Kabine

Module

Club mascot

Many clubs have a mascot children know. With this module admins upload its pictures, and the app shows them where the original club app shows its own mascot: faces next to a game's result for players under 14, and the mascot on the cards of the home game day. Ported from the original club app (docs/dev/upstream-tasks.md, 2026-11-26), where the pictures are fixed files in src/images/. Kabine has no club's pictures in code.

Switch on: Administration → Modules → Club mascot (beta, off for a new club).

  • Slots (MASCOT_SLOTS in shared/module-api.ts, rules in shared/rules.ts):
    • four faces for results, square: win, draw, close (lost by up to 4 goals), clear (lost by 5 or more). Players under 14 see the face for the outcome next to the result of a played game, in the event list and on the game page (src/result.tsx).
    • card: the picture on the large home game day card, any shape.
    • head: the head on the small tiles of later home game days and on the page of the day, any shape.
  • Administration → Club mascot (/verwaltung/maskottchen): one tile per slot with the picture on a checkerboard (to see transparency), upload or replace, remove.
  • Upload, checked like profile pictures: PNG, WebP or SVG with a transparent or white background, at least 256 pixels on the longer side, faces square (2 % tolerance, then drawn square). The browser scales to 256 px (faces, head) or 512 px (card) on the longer side and writes WebP, or PNG where the browser cannot write WebP (Safari); an SVG is drawn into one of them, so no SVG is stored. More than a quarter of the outer two pixel rows neither transparent nor white counts as a coloured background and is refused. At most 200,000 bytes; a larger picture is scaled down step by step to 256 px. The server reads type and size from the bytes again (PNG, WebP), refuses everything else, and needs at least 256 px, square faces and at most 200,000 bytes. Blocked in the public demo (worker/demo/routes.ts).
  • For other code (hook mascot, docs/dev/modules.md): GET /api/club carries the URLs of the filled slots as mascot while the module is on. The app asks useMascotImage(slot) (src/modules.ts), worker code moduleMascot(db) (worker/modules.ts). Both answer none while the module is off or the slot is empty; the pictures stay stored while it is off.

Preparing the pictures

The app checks every picture before the upload and says what is wrong. These pictures pass and look good:

  • Format: PNG or WebP with transparency, or SVG. An SVG is drawn into a PNG or WebP at the slot's size, so gradients, filters and embedded fonts become pixels; plain shapes work best. JPEG is refused, it has no transparency.
  • Size: at least 256 pixels on the longer side; 512 to 1024 pixels is a good start. The app scales faces and the head to 256 pixels and the card picture to 512 pixels, never larger than the original.
  • Faces square: width and height may differ by at most 2 %; the face is then drawn square. Leave a little room around the face, so it does not touch the edges.
  • Background transparent or white: the app looks at the outer two rows and columns of pixels. If more than a quarter of them are neither transparent nor white, the picture counts as having a coloured background and is refused. A mascot that touches the edge here and there is fine; a coloured square behind it is not. Transparent is best: the large home game day card is black, and a white background shows there as a white box.
  • At most about 200 KB after scaling (200,000 bytes). The file you choose may be larger: the app compresses it and, if it is still too large, makes it smaller step by step down to 256 pixels. Flat colours and clear outlines stay small; photos and fine textures may not fit.
  • A simple shape that is still readable when small: the faces appear at about 38 pixels in a small white box next to a game's result, the head at about 56 pixels on the tiles, the card picture at about 120 pixels wide. Strong outlines, few details, a clear expression. Try the picture at that size before uploading it.
  • One face per result: Win, Draw, Close loss (lost by up to 4 goals) and Clear loss (lost by 5 or more). Make the four look alike, with the same framing and size, so only the expression changes: cheering, content, a little sad but encouraging, comforting. They are shown to players under 14, so keep the losses kind.
  • Card and head: the Home game day card picture may have any shape, a mascot that cheers or waves works well; it sits at the bottom right of the large card. The Home game day tile is the head only, roughly square, since it is shown in a small square.

Where a picture is missing, nothing is shown in its place, so a club can start with the faces and add the rest later.

Privacy

  • Stores: no personal data. Up to six pictures (mascot_images: slot, type, version, upload time, picture), uploaded by an admin; who uploaded is not stored.
  • Who sees it: everyone who opens the app, like the club logo (also the sign-in page). Served with the version in the URL and cached for a year.
  • Deleted: when an admin removes or replaces a picture. Not in the export.

Read load

One query per start of the app while the module is on: slot and version of at most six rows (the picture is the last column and not read). The pictures themselves are cached by the browser under their version.

Source: modules/mascot/README.md · Edit on GitHub

Try it

In the demo, in every role.

Player, parent, coach or admin: one tap and you are in the invented club “SV Musterstadt”. No sign-up, reset every night.