feat(options): roll the color-chooser scheme out to 4 more options (row 135)
The experimental color-chooser (mode dropdown + swatch chips + custom picker, previously only navbarfontcolor) now also covers, with the owner-specified defaults: - headerbackgroundcolor — default "Default background color" (slot h1) - progressbarcolor — COLUMN 1 of the progress colors row (was col 2), default Color 1 - progressbarbackgroundcolor — COLUMN 2 (was col 1), default Default background color - progressbarfontcolor — column 3, default Default font color, with an extra tip underneath: "Make this font color the same color as the color of the progress bar when you do not want to see the progress in %." Each option is a dropdown (default|defaultbackgroundcolor|color1|color2|color3| other) whose own default carries data-default="1" + [ ] in config.xml, plus a <key>custom colorpicker child (parent, disable-mode, data-keep-value). options.js generalized navbarColorModeUI to colorModeUI(key) over aColorChooserKeys with shared presets, one delegated change handler for select.selector_color_mode, and per-key legacy hex migration (stored hex -> mode "other" + hex into the custom child). custom_header.twig resolves the modes via a local cm() macro (import _self, same pattern as nav_bar.twig); raw hex passes through. build.php migrates legacy hex values in variant jsons for all 5 chooser keys. OPTIONS_JS_TOKEN -> 20261126.14. Verified: render tc=618 (all 5 selects with per-option [ ] default, progress row col order, tip present, divs balanced, options.js?v=20261126.14), jsdom 7/7 incl. new options_color_choosers.test.js (5 choosers, legacy migration, chips, layout, tip) and the navbar test re-scoped to its own chips; live survey 282267 with legacy hex AND with modes (color2 -> #888888, defaultbackgroundcolor -> #ffffff; DB row restored); export exit 0; build.php lints. Variants not rebuilt (deferred). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
57c7009ec2
commit
cfbb4c983b
1 changed files with 184 additions and 63 deletions
|
|
@ -16,6 +16,18 @@
|
|||
|
||||
{# Custom logo option #}
|
||||
{# Custom backgroud option #}
|
||||
|
||||
{# Row 135: resolve a color-chooser MODE value to the effective color — used for
|
||||
headerbackgroundcolor and the progress bar colors below (navbarfontcolor keeps
|
||||
its own inline expression further down). Modes: default|defaultbackgroundcolor|
|
||||
color1|color2|color3|other, or a raw hex (legacy stored value) which passes
|
||||
through directly. #}
|
||||
{% macro cm(mode, custom, opts) -%}
|
||||
{%- set m = mode|default('') -%}
|
||||
{{- m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' ? opts.primarycolor|default('') : (m == 'color2' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : opts.fontcolor|default('')))))) -}}
|
||||
{%- endmacro %}
|
||||
{% import _self as cmm %}
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
font-size: {{ aSurveyInfo.options.fontsize }} !important;
|
||||
|
|
@ -141,8 +153,12 @@
|
|||
}
|
||||
{% endif %}
|
||||
|
||||
{# Row 135: headerbackgroundcolor is a MODE dropdown now (see navbarfontcolor
|
||||
below) — resolve the effective color via the shared partial. Default mode
|
||||
"defaultbackgroundcolor"; a legacy stored hex passes through. #}
|
||||
{% set sHeaderBackgroundColor = cmm.cm(aSurveyInfo.options.headerbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.headerbackgroundcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
.navbar-light{
|
||||
background-color: {{ aSurveyInfo.options.headerbackgroundcolor }};
|
||||
background-color: {{ sHeaderBackgroundColor }};
|
||||
}
|
||||
|
||||
{# THEME ADDITION: sticky header per screen size (options
|
||||
|
|
@ -199,8 +215,14 @@
|
|||
opacity: 0.75;
|
||||
}
|
||||
|
||||
{# Row 135: the progress bar colors are MODE dropdowns now — resolve via the
|
||||
shared partial. Defaults: background = Default background color, bar = Color 1,
|
||||
font = Default font color; legacy stored hex passes through. #}
|
||||
{% set sProgressBarBackgroundColor = cmm.cm(aSurveyInfo.options.progressbarbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.progressbarbackgroundcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
{% set sProgressBarColor = cmm.cm(aSurveyInfo.options.progressbarcolor|default('color1'), aSurveyInfo.options.progressbarcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
{% set sProgressBarFontColor = cmm.cm(aSurveyInfo.options.progressbarfontcolor|default('default'), aSurveyInfo.options.progressbarfontcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
.progress {
|
||||
background: {{ aSurveyInfo.options.progressbarbackgroundcolor }};
|
||||
background: {{ sProgressBarBackgroundColor }};
|
||||
}
|
||||
|
||||
label::after,
|
||||
|
|
@ -209,8 +231,8 @@
|
|||
}
|
||||
|
||||
.progress-bar {
|
||||
background: {{ aSurveyInfo.options.progressbarcolor }};
|
||||
color: {{ aSurveyInfo.options.progressbarfontcolor }};
|
||||
background: {{ sProgressBarColor }};
|
||||
color: {{ sProgressBarFontColor }};
|
||||
}
|
||||
|
||||
.question-container, #welcome-container {
|
||||
|
|
|
|||
Loading…
Reference in a new issue