Skip to content

Adds support for custom text and image background - #4

Open
Parajulibkrm wants to merge 5 commits into
bimsina:mainfrom
Parajulibkrm:main
Open

Adds support for custom text and image background#4
Parajulibkrm wants to merge 5 commits into
bimsina:mainfrom
Parajulibkrm:main

Conversation

@Parajulibkrm

@Parajulibkrm Parajulibkrm commented Apr 27, 2026

Copy link
Copy Markdown

Summary

This PR adds configurable OG image customization across all progress endpoints:

  • Adds support for a custom background image via query param (backgroundImageUrl) for /api/days, /api/months, and /api/current-month.
  • Adds configurable black tint overlay alpha via query param (overlayAlpha, clamped to 0..1) and applies it across the full image canvas.
  • Adds optional custom handle text (handleText) rendered directly below progressText in the same visual style.
  • Updates OG rendering composition to use layered full-canvas background + overlay + foreground content, improving reliability of tinting and image placement behavior.

Query Params Added

  • backgroundImageUrl — URL of background image
  • overlayAlpha — black overlay intensity (0 to 1)
  • handleText — custom text shown below progress text

Files Changed

  • lib/og_image.tsx
    • Added OgRenderOptions and OgTextOptions
    • Added request URL parsers for render/text options
    • Updated createOgImageResponse() to support background image + full-image overlay composition
  • lib/generator.ts
    • Added optional textOptions to all grid generators
    • Added conditional handle text node beneath progress text in matching style
  • app/api/days/route.tsx
  • app/api/months/route.tsx
  • app/api/current-month/route.tsx
    • Parse and pass render/text options to generator + OG response helpers

@vercel

vercel Bot commented Apr 27, 2026

Copy link
Copy Markdown

@Parajulibkrm is attempting to deploy a commit to the bimsina's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant