Adds DEFAULT_LAYOUT + IMAGE_FRAME_ROWS constants (fractional art/text window anchors), a ZoneEditor component for bounding-box layout editing in the designer, and expands the custom-frames/games CRUD API surface to support frame image storage and retrieval. Custom card designer pages wire these together with the existing PNG export pipeline. See .convoys/card-designer-image-frames.md for scope tracking.
23 lines
691 B
JavaScript
23 lines
691 B
JavaScript
/**
|
|
* Image-based custom frames:
|
|
* - frame_image_url: full-card frame artwork (PNG with transparent
|
|
* windows for art/text) rendered as the card base layer.
|
|
* - layout: art/text window zones as 0-1 fractions of the card
|
|
* ({ art: {x,y,w,h}, text: {x,y,w,h} }) so windows align with the
|
|
* uploaded image regardless of render size.
|
|
*/
|
|
export const up = (pgm) => {
|
|
pgm.sql(`
|
|
ALTER TABLE custom_frames
|
|
ADD COLUMN IF NOT EXISTS frame_image_url TEXT,
|
|
ADD COLUMN IF NOT EXISTS layout JSONB
|
|
`);
|
|
};
|
|
|
|
export const down = (pgm) => {
|
|
pgm.sql(`
|
|
ALTER TABLE custom_frames
|
|
DROP COLUMN IF EXISTS layout,
|
|
DROP COLUMN IF EXISTS frame_image_url
|
|
`);
|
|
};
|