diff --git a/src/css/component.css b/src/css/component.css index 607072e..23175bf 100644 --- a/src/css/component.css +++ b/src/css/component.css @@ -276,11 +276,16 @@ button img{ } .ui_input_group > input, .ui_input_group > .ui_number_input, -.ui_input_group > .ui_range { +.ui_input_group > .ui_range, +.ui_input_group > .ui_color_sample { border-radius: 0; height: auto; min-width: 0; } +.ui_input_group > .ui_color_sample { + border: none; + width: 100%; +} .ui_input_group > :first-child { border-radius: var(--input-border-radius) 0 0 var(--input-border-radius); } diff --git a/src/css/layout.css b/src/css/layout.css index 6cfdfbd..8b8e3a9 100644 --- a/src/css/layout.css +++ b/src/css/layout.css @@ -473,7 +473,7 @@ body .sp-preview{ clear:both; margin-bottom: 2px; } -.block.details input{ +.block.details input[type="number"]{ width: 70px; padding: 3px 5px; } @@ -638,3 +638,27 @@ canvas{ width: 88px; } } + +/* ========== dialogs ======================================================= */ + +#dialog_color_picker_group { + width: 60%; +} +#dialog_color_channel_group { + width: 40%; + margin-left: 1rem; +} + +@media screen and (max-width: 450px) { + #dialog_color_picker .ui_flex_group { + flex-wrap: wrap; + } + #dialog_color_picker_group { + width: 100%; + } + #dialog_color_channel_group { + width: 100%; + margin-left: 0; + margin-top: 1rem; + } +} \ No newline at end of file diff --git a/src/css/utility.css b/src/css/utility.css index 4a2b0f2..6a387e7 100644 --- a/src/css/utility.css +++ b/src/css/utility.css @@ -11,6 +11,11 @@ max-width: 6.4rem; overflow: hidden; } +.label_width_medium { + width: 100%; + max-width: 10.4rem; + overflow: hidden; +} /* Font color utility */ .text_red { color: var(--text-color-red); } diff --git a/src/js/config.js b/src/js/config.js index 1a08c77..0e5ac72 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -18,6 +18,9 @@ config.layer = null; config.need_render = false; config.need_render_changed_params = false; // Set specifically when param change in layer details triggered render config.mouse = {}; +config.swatches = { + default: [] // Only default used right now, object format for swatch swapping in future. +}; //requires styles in reset.css config.themes = [ diff --git a/src/js/core/components/color-input.js b/src/js/core/components/color-input.js index 818e6ad..0673bed 100644 --- a/src/js/core/components/color-input.js +++ b/src/js/core/components/color-input.js @@ -26,7 +26,7 @@ let POP; if (!POP) { POP = new Dialog_class(); } - let colorsDialog = new GUI_colors_class('dialog'); + let colorsDialog = new GUI_colors_class(); var settings = { title: 'Color Picker', on_finish() { @@ -38,7 +38,7 @@ let POP; params: [ { function() { - var html = '
'; + var html = ''; return html; } } @@ -57,7 +57,7 @@ let POP; colorValue = '#000000'; } POP.show(settings); - colorsDialog.render_main_colors(); + colorsDialog.render_main_colors('dialog'); colorsDialog.set_color({ hex: colorValue, a: alpha }); }; diff --git a/src/js/core/gui/gui-colors.js b/src/js/core/gui/gui-colors.js index 21bce54..f5adf60 100644 --- a/src/js/core/gui/gui-colors.js +++ b/src/js/core/gui/gui-colors.js @@ -97,10 +97,22 @@ const sidebarTemplate = ` const dialogTemplate = `