Skip to content
Work

Fillyr

Turn any flyer into a fillable link.

Role
Design and engineering, start to finish
Built with
Next.js, tRPC, Drizzle, Konva, Cloudflare R2
Links
fillyr.appThe story
The Fillyr editor with a youth convention flyer, a circular photo slot and a name field in gold
Fig. 1The editor, with a photo slot and a name field mapped onto a church convention flyer.

Text you add should look like it was always part of the design, so the colour picker samples the flyer itself. Where the browser has an eyedropper, Fillyr hands over to it. Everywhere else it draws the flyer at full resolution into a hidden canvas and reads the exact pixel under your click, mapped from the scaled preview.

Fig. 2Sampling the ring's gold for the name, then centring it.

Names are never the length you designed for. With auto-fit on, a field finds the largest size its text fits at, by binary search between the field's minimum and maximum. Multiline text wraps first and only shrinks once wrapping no longer fits. The same measuring code runs in the editor, on the fill page and in the exported PNG, so what you see while typing is what downloads. The photo you add never leaves your browser.

Fig. 3A short name, then a long one, on the public fill page.
lib/text-fit.ts · ts
const fits = (size: number) => {
  ctx.font = fontSpec(style, size)
  const lines = wrapText(ctx, text || " ", width)
  if (lines.length * size * lineHeight > height) return false
  return lines.every((line) => ctx.measureText(line).width <= width)
}
…
while (lo <= hi) {
  const mid = (lo + hi) >> 1
  if (fits(mid)) {
    best = mid
    lo = mid + 1
  } else {
    hi = mid - 1
  }
}
Excerpt, trimmed with …

Fields are stored in the flyer's own pixels, not the screen's: the name sits at x 161, y 971 on a 1080 × 1350 design, whatever size the editor happens to be drawn at. Each field remembers the size it was placed against and is projected onto whatever renders it, with its font sizes scaled too. A field dragged partly off the edge clips exactly as it will on the fill page, and one left entirely off is pulled back so it never becomes unreachable. Rotation snaps every 45° within 5°, around the box's centre.

lib/field-geometry.ts · ts
export function projectField(field: FlyerField, from: Size, to: Size) {
  const scaleX = to.w / Math.max(from.w, 1)
  const scaleY = to.h / Math.max(from.h, 1)

  return {
    ...field,
    x: field.x * scaleX,
    y: field.y * scaleY,
    width: field.width * scaleX,
    height: field.height * scaleY,
    …
  }
}
Excerpt, trimmed with …

For a class register or fifty vendors, Bulk Fill writes a CSV template whose columns are your field labels, renders one card per row with the same renderer as a single download, and zips them. A row whose photo link won't load fails loudly instead of shipping a card with an empty circle, and the progress also shows in the editor's top bar.

Fig. 4Six names in, six cards previewed, one ZIP out.