From 70fda25c95fe298f45f955038cf3fa5945d4e168 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 4 Jun 2026 20:42:23 -0400 Subject: [PATCH] feat(badges): slow pulse mode for rainbow punch hole markers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds punch_holes.slow_pulse cfg_json flag. When enabled, replaces the fast 2.5s linear hue-rotate with a 6s ease-in-out breathing animation that dims (0.55 brightness) to bright (1.30) while shifting 180° of hue and back. Same 120° phase offsets apply (2s apart). Form shows a Slow Pulse checkbox below the slot cards whenever at least one slot has rainbow enabled. Co-Authored-By: Claude Sonnet 4.6 --- .../ae_events/types/ae_badge_template_cfg.ts | 1 + .../[badge_id]/ae_comp__badge_obj_view.svelte | 35 ++++++++++++++----- .../ae_comp__badge_template_form.svelte | 11 ++++++ 3 files changed, 38 insertions(+), 9 deletions(-) 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 ac4f4721..83a43f46 100644 --- a/src/lib/ae_events/types/ae_badge_template_cfg.ts +++ b/src/lib/ae_events/types/ae_badge_template_cfg.ts @@ -75,6 +75,7 @@ export interface BadgeTemplateCfg { center_fg?: string; center_bg?: string; center_rainbow?: boolean; + slow_pulse?: boolean; // when true: slow breathing pulse instead of fast linear cycle }; // Allow arbitrary extra keys to preserve forward-compatibility. 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 60b878b2..a5b672da 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 @@ -342,6 +342,7 @@ const PH_RAINBOW_BG = 'rgba(255,34,0,0.25)'; let punch_holes_left_rainbow = $derived(!!template_cfg?.punch_holes?.left_rainbow); let punch_holes_right_rainbow = $derived(!!template_cfg?.punch_holes?.right_rainbow); let punch_holes_center_rainbow = $derived(!!template_cfg?.punch_holes?.center_rainbow); +let punch_holes_slow_pulse = $derived(!!template_cfg?.punch_holes?.slow_pulse); let punch_holes_colors = $derived.by(() => { const ph = template_cfg?.punch_holes; const shared_fg = ph?.fg || PH_DEFAULT_FG; @@ -707,7 +708,9 @@ const code_to_icon: { starts at a different phase (0°, 120°, 240°) and they cycle in unison at the same speed — tri-phase RGB rather than drifting randomly. --> {#if punch_holes_left && punch_holes_left_rainbow} - {/if} {#if punch_holes_right && punch_holes_right_rainbow} - {/if} {#if punch_holes_center && punch_holes_center_rainbow} -