Add drag-and-drop for presets and colors, max_colors validation, and 2D grid layout
- Add drag-and-drop to reorder presets in tabs (2D grid layout) - Add drag-and-drop to reorder colors within presets - Add max_colors field to pattern definitions - Hide color section when max_colors is 0 - Validate color count against pattern max_colors limit - Store presets in 2D grid format (3 columns) - Remove left panel from tab content, show only presets - Update color palette to show swatches instead of hex codes - Improve preset editor UI with visual color swatches
This commit is contained in:
@@ -129,10 +129,12 @@
|
||||
<option value="">Pattern</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>Colors (comma-separated hex)</label>
|
||||
<div class="profiles-actions">
|
||||
<input type="text" id="preset-colors-input" placeholder="#FF0000,#00FF00,#0000FF">
|
||||
<button class="btn btn-secondary" id="preset-add-from-palette-btn">Add from Palette</button>
|
||||
<label>Colors</label>
|
||||
<div id="preset-colors-container" class="preset-colors-container"></div>
|
||||
<div class="profiles-actions" style="margin-top: 0.5rem;">
|
||||
<input type="color" id="preset-new-color" value="#ffffff">
|
||||
<button class="btn btn-secondary btn-small" id="preset-add-color-btn">Add Color</button>
|
||||
<button class="btn btn-secondary btn-small" id="preset-add-from-palette-btn">Add from Palette</button>
|
||||
</div>
|
||||
<div class="profiles-actions">
|
||||
<input type="number" id="preset-brightness-input" placeholder="Brightness" min="0" max="255" value="0">
|
||||
@@ -268,6 +270,34 @@
|
||||
background-color: #3a3a3a;
|
||||
border-radius: 4px;
|
||||
}
|
||||
/* Hide any text content in palette rows - only show color swatches */
|
||||
#palette-container .profiles-row {
|
||||
font-size: 0; /* Hide any text nodes */
|
||||
}
|
||||
#palette-container .profiles-row > * {
|
||||
font-size: 1rem; /* Restore font size for buttons */
|
||||
}
|
||||
#palette-container .profiles-row > span:not(.btn),
|
||||
#palette-container .profiles-row > label,
|
||||
#palette-container .profiles-row::before,
|
||||
#palette-container .profiles-row::after {
|
||||
display: none !important;
|
||||
content: none !important;
|
||||
}
|
||||
/* Preset colors container */
|
||||
#preset-colors-container {
|
||||
min-height: 80px;
|
||||
padding: 0.5rem;
|
||||
background-color: #2a2a2a;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
#preset-colors-container .muted-text {
|
||||
color: #888;
|
||||
font-size: 0.9rem;
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
.muted-text {
|
||||
text-align: center;
|
||||
color: #888;
|
||||
@@ -285,6 +315,38 @@
|
||||
border-radius: 4px;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
/* Drag and drop styles for presets */
|
||||
.draggable-preset {
|
||||
cursor: move;
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
}
|
||||
.draggable-preset.dragging {
|
||||
opacity: 0.5;
|
||||
transform: scale(0.95);
|
||||
}
|
||||
.draggable-preset:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
/* Drag and drop styles for color swatches */
|
||||
.draggable-color-swatch {
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
}
|
||||
.draggable-color-swatch.dragging-color {
|
||||
opacity: 0.5;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
.draggable-color-swatch.drag-over-color {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
.color-swatches-container {
|
||||
min-height: 80px;
|
||||
}
|
||||
/* Ensure presets list uses grid layout */
|
||||
#presets-list-tab {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 0.75rem;
|
||||
}
|
||||
</style>
|
||||
<script src="/static/color_palette.js"></script>
|
||||
<script src="/static/profiles.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user