\n
\n"
+ # Accent word: 0 = last word (default), N = Nth word (1-indexed)
title_words = @s.hero_title.to_s.split(" ")
+ accent_idx = (@s.hero_accent_word rescue 0).to_i
if title_words.length > 1
- html << "
#{e(title_words[0..-2].join(' '))} #{e(title_words.last)}
\n"
+ # Convert to 0-based index; 0 means last word
+ target = accent_idx > 0 ? [accent_idx - 1, title_words.length - 1].min : title_words.length - 1
+ before = title_words[0...target]
+ accent = title_words[target]
+ after = title_words[(target + 1)..]
+ parts = +""
+ parts << "#{e(before.join(' '))} " if before.any?
+ parts << "#{e(accent)}"
+ parts << " #{e(after.join(' '))}" if after.any?
+ html << "#{parts}
\n"
else
html << "#{e(@s.hero_title)}
\n"
end
diff --git a/lib/community_landing/style_builder.rb b/lib/community_landing/style_builder.rb
index 4ad95f9..88c3764 100644
--- a/lib/community_landing/style_builder.rb
+++ b/lib/community_landing/style_builder.rb
@@ -15,9 +15,7 @@ module CommunityLanding
dark_bg = hex(@s.dark_bg_color) || "#06060f"
light_bg = hex(@s.light_bg_color) || "#faf6f0"
stat_icon = hex(@s.stat_icon_color) || accent
- about_g1 = hex(@s.about_gradient_start) || "#fdf6ec"
- about_g2 = hex(@s.about_gradient_mid) || "#fef9f0"
- about_g3 = hex(@s.about_gradient_end) || "#fdf6ec"
+ about_card = hex(@s.about_card_color.presence) rescue nil
about_bg_img = @s.about_background_image_url.presence
app_g1 = hex(@s.app_cta_gradient_start) || accent
app_g2 = hex(@s.app_cta_gradient_mid) || accent_hover
@@ -45,7 +43,8 @@ module CommunityLanding
hero_card_dark_val = "rgba(#{hero_card_dark_rgb}, #{hero_card_opacity})"
hero_card_light_val = "rgba(#{hero_card_light_rgb}, #{hero_card_opacity})"
- about_bg_extra = about_bg_img ? ", url('#{about_bg_img}') center/cover no-repeat" : ""
+ about_card_val = about_card || "var(--cl-card)"
+ about_card_css = about_bg_img ? "#{about_card_val}, url('#{about_bg_img}') center/cover no-repeat" : about_card_val
video_btn_line = video_btn_bg ? "\n --cl-video-btn-bg: #{video_btn_bg};" : ""
"