diff --git a/src/lib/ae_events/types/ae_badge_template_cfg.ts b/src/lib/ae_events/types/ae_badge_template_cfg.ts index 7e060ffa..14905488 100644 --- a/src/lib/ae_events/types/ae_badge_template_cfg.ts +++ b/src/lib/ae_events/types/ae_badge_template_cfg.ts @@ -36,6 +36,13 @@ export interface BadgeTemplateCfg { // Leave unset (or "0") for no bleed. bleed?: string; + // Header image vertical offset. CSS length applied as margin-top on the badge_header div. + // Default (unset) = "2rem" (matches the prior hardcoded mt-8). + // Negative values shift the image toward the top edge; larger values push it down. + // Useful when a background image's designed zone doesn't align with the default position. + // Any CSS length works: "-0.5in", "1rem", "8px". + header_margin_top?: string; + // Allow arbitrary extra keys to preserve forward-compatibility. [key: string]: any; } diff --git a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte index c61f9377..ae1aec53 100644 --- a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte @@ -319,6 +319,13 @@ let bleed_offset = $derived.by(() => { return `-${b}`; }); +// Header image vertical position. Defaults to "2rem" (= prior hardcoded mt-8). +// Set cfg_json.header_margin_top on the template to shift the image up (negative) or down. +let header_margin_top = $derived.by(() => { + const v = template_cfg?.header_margin_top; + return v && typeof v === 'string' && v.trim() ? v.trim() : '2rem'; +}); + /** * Layout-aware section heights for Element_fit_text. * @@ -662,13 +669,14 @@ const code_to_icon: {
+ " + style="margin-top: {header_margin_top};"> Header Path (URL) — top banner image (used when no background image) +