feat: refactorer et améliorer le système de palette de couleurs avec nouveau Background Studio, sections organisées (couleurs/backgrounds), scrolling horizontal optimisé, galerie de miniatures avec filtres et recherche, swatches de couleurs interactifs, et améliorations visuelles incluant hover states, transitions fluides, et support complet du thème sombre

This commit is contained in:
2026-02-17 10:25:21 -05:00
parent 7e0ff872df
commit 97f3bbca45
6 changed files with 980 additions and 94 deletions
+461 -4
View File
@@ -774,11 +774,16 @@ body.view-notes .content-container {
background: var(--background-secondary, #ffffff);
border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 12px;
padding: 10px;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
padding: 12px;
box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
z-index: 50;
width: max-content;
max-width: min(340px, calc(100vw - 32px));
max-height: min(320px, calc(100vh - 140px));
overflow: auto;
overscroll-behavior: contain;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
[data-theme="dark"] .palette-popup {
@@ -790,25 +795,84 @@ body.view-notes .content-container {
display: block;
}
.palette-section {
display: flex;
flex-direction: column;
gap: 10px;
}
.palette-section-title {
font-size: 0.75rem;
line-height: 1;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: rgba(0, 0, 0, 0.62);
}
[data-theme="dark"] .palette-section-title {
color: rgba(255, 255, 255, 0.72);
}
.palette-divider {
height: 1px;
background: rgba(0, 0, 0, 0.10);
margin: 10px 0;
}
[data-theme="dark"] .palette-divider {
background: rgba(255, 255, 255, 0.12);
}
.palette-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.palette-row-colors {
flex-wrap: nowrap;
overflow-x: hidden;
overflow-y: hidden;
padding-bottom: 4px;
scrollbar-width: thin;
}
.palette-row-colors::-webkit-scrollbar {
height: 8px;
}
.palette-row-colors::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.18);
border-radius: 10px;
}
[data-theme="dark"] .palette-row-colors::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.18);
}
.palette-row-backgrounds {
display: grid;
grid-template-columns: repeat(auto-fill, 28px);
gap: 10px;
justify-content: start;
}
.palette-row + .palette-row {
margin-top: 10px;
}
.palette-btn {
width: 24px;
height: 24px;
width: 28px;
height: 28px;
border-radius: 50%;
border: 1px solid rgba(0, 0, 0, 0.18);
cursor: pointer;
padding: 0;
background-position: center bottom;
background-size: cover;
flex: 0 0 auto;
transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
[data-theme="dark"] .palette-btn {
@@ -820,6 +884,20 @@ body.view-notes .content-container {
outline-offset: 2px;
}
.palette-btn:hover {
transform: translateY(-1px);
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .palette-btn:hover {
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.palette-btn:focus-visible {
outline: 2px solid var(--primary-color, #2563eb);
outline-offset: 2px;
}
.palette-btn-bg-none {
display: flex;
align-items: center;
@@ -835,6 +913,385 @@ body.view-notes .content-container {
top: calc(100% + 8px);
}
.bg-studio-panel {
position: fixed;
z-index: 1200;
width: min(420px, calc(100vw - 24px));
border-radius: 20px;
background: rgba(255, 255, 255, 0.92);
border: 1px solid var(--border, #d1d5db);
box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
color: var(--text-main, #0f172a);
padding: 16px;
}
[data-theme="dark"] .bg-studio-panel {
background: rgba(31, 37, 41, 0.92);
border-color: #2A3238;
box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
color: rgba(255, 255, 255, 0.92);
}
.bg-studio-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.bg-studio-title {
font-size: 18px;
font-weight: 600;
letter-spacing: 0.01em;
}
.bg-studio-close {
width: 34px;
height: 34px;
border-radius: 12px;
border: 1px solid rgba(15, 23, 42, 0.16);
background: rgba(15, 23, 42, 0.05);
color: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.bg-studio-close:hover {
background: rgba(15, 23, 42, 0.10);
}
[data-theme="dark"] .bg-studio-close {
border-color: rgba(255, 255, 255, 0.12);
background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .bg-studio-close:hover {
background: rgba(255, 255, 255, 0.10);
}
.bg-studio-gallery {
display: grid;
grid-auto-flow: column;
grid-template-rows: repeat(2, 102px);
grid-auto-columns: 84px;
gap: 12px;
overflow-x: auto;
overflow-y: hidden;
padding: 2px 2px 10px;
margin-bottom: 12px;
overscroll-behavior: contain;
scrollbar-width: thin;
}
.bg-studio-gallery::-webkit-scrollbar {
height: 10px;
}
.bg-studio-gallery::-webkit-scrollbar-thumb {
background: rgba(15, 23, 42, 0.20);
border-radius: 10px;
}
[data-theme="dark"] .bg-studio-gallery::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.18);
}
.bg-studio-thumb {
width: 84px;
height: 72px;
border-radius: 12px;
border: 1px solid rgba(15, 23, 42, 0.16);
background: rgba(15, 23, 42, 0.05);
background-position: center bottom;
background-size: cover;
cursor: pointer;
padding: 0;
position: relative;
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
flex: 0 0 auto;
overflow: hidden;
isolation: isolate;
}
.bg-studio-thumb:hover {
transform: translateY(-2px);
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}
.bg-studio-thumb.is-active {
border: 3px solid #3b82f6;
box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}
.bg-studio-thumb:focus-visible {
outline: 3px solid rgba(59, 130, 246, 0.9);
outline-offset: 3px;
}
.bg-studio-thumb-color,
.bg-studio-thumb-solid {
position: absolute;
inset: 0;
border-radius: 12px;
}
.bg-studio-thumb-solid {
background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02));
}
.bg-studio-tile {
display: grid;
grid-template-rows: 72px auto;
gap: 6px;
width: 84px;
}
.bg-studio-thumb-label {
font-size: 0.72rem;
line-height: 1.1;
text-align: center;
color: var(--text-muted, rgba(15, 23, 42, 0.62));
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
[data-theme="dark"] .bg-studio-thumb-label {
color: rgba(255, 255, 255, 0.72);
}
.bg-studio-rows {
display: grid;
grid-template-columns: 1fr;
gap: 10px;
margin-bottom: 12px;
}
.bg-studio-row {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
align-items: center;
gap: 12px;
}
.bg-studio-row-heading {
display: inline-flex;
align-items: center;
gap: 8px;
}
.bg-studio-row-label {
min-width: 108px;
font-size: 0.9rem;
font-weight: 600;
color: inherit;
}
.bg-studio-swatches {
display: grid;
grid-template-columns: repeat(6, 26px);
grid-auto-rows: 26px;
gap: 8px;
min-width: 0;
width: 100%;
overflow: hidden;
}
.bg-studio-swatch {
width: 26px;
height: 26px;
border-radius: 999px;
border: 1px solid rgba(15, 23, 42, 0.22);
cursor: pointer;
padding: 0;
transition: transform 0.12s ease, box-shadow 0.12s ease;
flex: 0 0 auto;
}
.bg-studio-swatch:hover {
transform: scale(1.15);
box-shadow: 0 10px 20px rgba(0,0,0,0.35);
}
.bg-studio-swatch.is-active {
border: 2px solid rgba(255, 255, 255, 0.95);
box-shadow: 0 8px 16px rgba(0,0,0,0.35);
}
[data-theme="dark"] .bg-studio-swatch {
border-color: rgba(255, 255, 255, 0.28);
}
.bg-studio-filters {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.bg-studio-filter-btn {
width: 30px;
height: 30px;
border-radius: 8px;
border: 1px solid rgba(15, 23, 42, 0.16);
background: rgba(15, 23, 42, 0.05);
color: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.bg-studio-filter-btn.is-active {
border-color: rgba(59, 130, 246, 0.9);
color: #60a5fa;
}
[data-theme="dark"] .bg-studio-filter-btn {
border-color: rgba(255, 255, 255, 0.16);
background: rgba(255, 255, 255, 0.06);
}
.bg-studio-reset {
height: 28px;
padding: 0 12px;
border-radius: 999px;
border: 1px solid rgba(15, 23, 42, 0.18);
background: linear-gradient(180deg, #ffffff, #f3f4f6);
color: #111827;
font-size: 0.82rem;
font-weight: 600;
letter-spacing: 0.01em;
cursor: pointer;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.bg-studio-reset:hover {
border-color: rgba(59, 130, 246, 0.5);
background: linear-gradient(180deg, #ffffff, #e9eefb);
box-shadow: 0 6px 14px rgba(59, 130, 246, 0.2);
transform: translateY(-1px);
}
.bg-studio-reset:focus-visible {
outline: 2px solid rgba(59, 130, 246, 0.9);
outline-offset: 2px;
}
[data-theme="dark"] .bg-studio-reset {
border-color: rgba(255, 255, 255, 0.2);
background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
color: rgba(255, 255, 255, 0.92);
box-shadow: none;
}
[data-theme="dark"] .bg-studio-reset:hover {
border-color: rgba(96, 165, 250, 0.65);
background: linear-gradient(180deg, rgba(96, 165, 250, 0.26), rgba(96, 165, 250, 0.16));
box-shadow: 0 8px 16px rgba(2, 6, 23, 0.45);
}
.bg-studio-search {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 10px 12px;
border-radius: 14px;
border: 1px solid var(--border, rgba(15, 23, 42, 0.16));
background: rgba(15, 23, 42, 0.05);
margin-bottom: 12px;
transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.bg-studio-search:focus-within {
border-color: rgba(59, 130, 246, 0.55);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.bg-studio-search i {
color: var(--text-muted, rgba(15, 23, 42, 0.62));
}
.bg-studio-search-input {
flex: 1;
border: 0 !important;
background: transparent !important;
box-shadow: none !important;
border-radius: 0;
color: inherit;
outline: none;
font-size: 0.95rem;
-webkit-appearance: none;
appearance: none;
caret-color: currentColor;
}
.bg-studio-search-input:focus,
.bg-studio-search-input:focus-visible {
outline: none;
box-shadow: none;
}
.bg-studio-search-input::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}
.bg-studio-search-input::placeholder {
color: var(--text-muted, rgba(15, 23, 42, 0.52));
}
[data-theme="dark"] .bg-studio-search {
border-color: rgba(255, 255, 255, 0.18);
background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .bg-studio-search:focus-within {
border-color: rgba(96, 165, 250, 0.75);
background: rgba(15, 23, 42, 0.34);
box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
[data-theme="dark"] .bg-studio-search i {
color: rgba(255, 255, 255, 0.82);
}
[data-theme="dark"] .bg-studio-search-input {
color: rgba(255, 255, 255, 0.95);
}
[data-theme="dark"] .bg-studio-search-input::placeholder {
color: rgba(255, 255, 255, 0.62);
}
.bg-studio-clear {
width: 28px;
height: 28px;
border-radius: 999px;
border: 1px solid rgba(15, 23, 42, 0.16);
background: rgba(15, 23, 42, 0.05);
color: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
[data-theme="dark"] .bg-studio-clear {
border-color: rgba(255, 255, 255, 0.16);
background: rgba(255, 255, 255, 0.06);
}
.spacer {
flex: 1;
}