{{/* Hugo Blox Parser v3 - Preact Component Support */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/kit/blob/main/LICENSE.md */}} {{ $page := .page }} {{ $block := .block }} {{- $block_type := partial "hbx/resolve-block-param" (dict "config" $block "context" "content section") | default "markdown" -}} {{ $block_type = lower $block_type }} {{/* Handle block renames/aliases */}} {{ range $r := hugo.Data.blox_aliases.renames }} {{ $block_type = cond (eq $block_type $r.old) $r.new $block_type }} {{ end }} {{/* Check if this is a Preact-enabled block by looking for component file */}} {{ $component_path := printf "js/hbx/blocks/%s/component.jsx" $block_type }} {{ $is_preact := resources.Get $component_path }} {{/* Apply styling wrapper for all blocks (both Preact and traditional) */}} {{ $bg := $block.design.background }} {{ $style := "" }} {{ $style_bg := "" }} {{/* Process background colors */}} {{ if $bg.color }} {{ $color_type := printf "%T" $bg.color }} {{ if eq $color_type "map[string]interface {}" }} {{ if and $bg.color.light $bg.color.dark }} {{ $light_color := $bg.color.light }} {{ $dark_color := $bg.color.dark }} {{ $style_bg = printf "background-color: %s;" $light_color }} {{ $style_bg = printf "%s--dark-bg-color: %s;" $style_bg $dark_color }} {{ else if $bg.color.light }} {{ $light_color := $bg.color.light }} {{ $style_bg = printf "background-color: %s;" $light_color }} {{ else if $bg.color.dark }} {{ $dark_color := $bg.color.dark }} {{ $style_bg = printf "--dark-bg-color: %s; background-color: var(--dark-bg-color);" $dark_color }} {{ end }} {{ else }} {{ $bg_color := $bg.color }} {{ $style_bg = printf "background-color: %s;" $bg_color }} {{ end }} {{ end }} {{/* Process gradients and images */}} {{ $background_layers := slice }} {{ $gradient_layer := "" }} {{ $has_gradient_mesh := false }} {{ $gradient_mesh_html := "" }} {{/* Enhanced Gradient Mesh System */}} {{ $gradient_mesh := $bg.gradient_mesh | default dict }} {{ if $gradient_mesh.enable }} {{ $has_gradient_mesh = true }} {{/* Stacking-fix: the mesh wrapper sits at z-index:-10, while .home-section-bg sits at z-index:-1. If we leave bg-color on home-section-bg, the colour paints OVER the mesh and the orbs are hidden. Migrate the bg-color off home-section-bg and onto the section element itself, so the section's own background paints BEHIND the mesh layer (orbs visible) and the radial gradient + image layers on home-section-bg paint ABOVE the mesh (still visible). */}} {{ if $style_bg }} {{ $style = print $style $style_bg }} {{ $style_bg = "" }} {{ end }} {{ $mesh_style := $gradient_mesh.style | default "orbs" }} {{ $mesh_animation_raw := $gradient_mesh.animation | default "pulse" }} {{ $mesh_intensity := $gradient_mesh.intensity | default "subtle" }} {{/* Auto-theme: Mix Primary and Secondary brand colors for dynamic personalization */}} {{ $mesh_colors := $gradient_mesh.colors | default (slice "primary-500/20" "secondary-500/20") }} {{/* Map animation names to CSS classes */}} {{ $mesh_animation := "" }} {{ if eq $mesh_animation_raw "pulse" }} {{ $mesh_animation = "pulse" }} {{ else if eq $mesh_animation_raw "float" }} {{ $mesh_animation = "float" }} {{ else if eq $mesh_animation_raw "rotate" }} {{ $mesh_animation = "rotate-slow" }} {{ else if ne $mesh_animation_raw "none" }} {{ $mesh_animation = "pulse" }} {{/* Default fallback */}} {{ end }} {{/* Build gradient mesh HTML */}} {{ $mesh_html := "