Refresh tabs/presets UI and add a mobile menu.

This improves navigation and profile workflows on smaller screens.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-08 13:51:09 +13:00
parent 6c6ed22dbe
commit d907ca37ad
6 changed files with 917 additions and 379 deletions

View File

@@ -20,25 +20,65 @@ body {
header {
background-color: #1a1a1a;
padding: 1rem 2rem;
padding: 0.75rem 1rem;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid #4a4a4a;
gap: 0.75rem;
}
header h1 {
font-size: 1.5rem;
font-size: 1.35rem;
font-weight: 600;
}
.header-actions {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
justify-content: flex-end;
}
.header-menu-mobile {
display: none;
position: relative;
}
.main-menu-dropdown {
position: absolute;
top: 100%;
right: 0;
background-color: #1a1a1a;
border: 1px solid #4a4a4a;
border-radius: 4px;
padding: 0.25rem 0;
display: none;
min-width: 160px;
z-index: 1100;
}
.main-menu-dropdown.open {
display: block;
}
.main-menu-dropdown button {
width: 100%;
background: none;
border: none;
color: white;
text-align: left;
padding: 0.4rem 0.75rem;
font-size: 0.85rem;
cursor: pointer;
}
.main-menu-dropdown button:hover {
background-color: #333;
}
.btn {
padding: 0.5rem 1rem;
padding: 0.45rem 0.9rem;
border: none;
border-radius: 4px;
cursor: pointer;
@@ -87,15 +127,22 @@ header h1 {
}
.tabs-container {
background-color: #1a1a1a;
border-bottom: 2px solid #4a4a4a;
padding: 0.5rem 1rem;
background-color: transparent;
padding: 0.5rem 0;
flex: 1;
min-width: 0;
align-self: stretch;
display: flex;
align-items: center;
}
.tabs-list {
display: flex;
gap: 0.5rem;
overflow-x: auto;
padding-bottom: 0.25rem;
flex: 1;
min-width: 0;
}
.tab-button {
@@ -122,10 +169,28 @@ header h1 {
.tab-content {
flex: 1;
display: block;
overflow: auto;
overflow-y: auto;
overflow-x: hidden;
padding: 0.5rem 1rem 1rem;
}
.presets-toolbar {
align-items: center;
}
.tab-brightness-group {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 0.25rem;
margin-left: auto;
}
.tab-brightness-group label {
white-space: nowrap;
font-size: 0.85rem;
}
.left-panel {
flex: 0 0 50%;
display: flex;
@@ -355,6 +420,33 @@ header h1 {
font-size: 1.1rem;
}
/* Make the presets area fill available vertical space; no border around presets */
.presets-section {
display: flex;
flex-direction: column;
height: 100%;
min-width: 0;
overflow-x: hidden;
border: none;
background-color: transparent;
padding: 0;
}
/* Tab preset selecting area: 3 columns, vertical scroll only */
#presets-list-tab {
flex: 1;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
grid-auto-rows: 5rem;
column-gap: 0.3rem;
row-gap: 0.3rem;
align-content: start;
width: 100%;
}
/* Settings modal layout */
.settings-section {
background-color: #1a1a1a;
@@ -478,21 +570,38 @@ header h1 {
}
.presets-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
width: 100%;
}
.pattern-button {
padding: 0.75rem;
height: 5rem;
padding: 0 0.5rem;
background-color: #3a3a3a;
color: white;
border: none;
border: 3px solid #000;
border-radius: 4px;
cursor: pointer;
font-size: 0.9rem;
font-size: 0.85rem;
text-align: left;
transition: background-color 0.2s;
line-height: 1;
display: flex;
align-items: center;
overflow: hidden;
box-shadow: none;
outline: none;
position: relative;
}
/* Preset select buttons inside the tab grid */
#presets-list-tab .pattern-button {
display: flex;
}
.pattern-button .pattern-button-label {
text-shadow: 0 0 2px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.6);
}
.pattern-button:hover {
@@ -502,10 +611,28 @@ header h1 {
.pattern-button.active {
background-color: #6a5acd;
color: white;
border-color: #ffffff;
}
.pattern-button.active[style*="background-image"] {
background-color: transparent;
}
.pattern-button.active::after {
content: '';
position: absolute;
inset: -3px;
border-radius: 7px;
padding: 3px;
pointer-events: none;
background: #ffffff;
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
mask-composite: exclude;
}
.pattern-button.default-preset {
border: 2px solid #6a5acd;
/* No border; active state shows selection */
}
.color-palette {
@@ -604,7 +731,7 @@ header h1 {
background-color: #2e2e2e;
padding: 2rem;
border-radius: 8px;
min-width: 400px;
min-width: 320px;
max-width: 500px;
}
@@ -661,3 +788,269 @@ header h1 {
background: #5a5a5a;
}
/* Mobile-friendly layout */
@media (max-width: 800px) {
header {
flex-direction: row;
align-items: center;
gap: 0.25rem;
}
header h1 {
font-size: 1.1rem;
} /* On mobile, hide header buttons; all actions (including Tabs) are in the Menu dropdown */
.header-actions {
display: none;
}
.header-menu-mobile {
display: block;
margin-top: 0;
margin-left: auto;
}
.btn {
font-size: 0.8rem;
padding: 0.4rem 0.7rem;
}
.tabs-container {
padding: 0.5rem 0;
border-bottom: none;
}
.tab-content {
padding: 0.5rem;
}
.left-panel {
flex: 1;
border-right: none;
padding-right: 0;
}
.right-panel {
padding-left: 0;
margin-top: 1rem;
}
/* Hide the "Presets for ..." heading to save space on mobile */
.presets-section h3 {
display: none;
}
.modal-content {
min-width: 280px;
max-width: 95vw;
padding: 1.25rem;
}
.form-row {
grid-template-columns: 1fr;
}
}
/* Styles moved from inline <style> in templates/index.html */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.7);
}
.modal.active {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background-color: #2e2e2e;
padding: 2rem;
border-radius: 8px;
min-width: 400px;
max-width: 600px;
}
.modal-content label {
display: block;
margin-top: 1rem;
margin-bottom: 0.5rem;
}
.modal-content input[type="text"] {
width: 100%;
padding: 0.5rem;
background-color: #3a3a3a;
border: 1px solid #4a4a4a;
border-radius: 4px;
color: white;
}
.profiles-actions {
display: flex;
gap: 0.5rem;
margin-top: 1rem;
}
.profiles-actions input[type="text"] {
flex: 1;
}
.profiles-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-top: 1rem;
max-height: 50vh;
overflow-y: auto;
}
.profiles-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
padding: 0.5rem;
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;
}
.modal-actions {
display: flex;
gap: 0.5rem;
margin-top: 1.5rem;
justify-content: flex-end;
}
.error {
color: #d32f2f;
padding: 0.5rem;
background-color: #3a1a1a;
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;
}
/* Presets list: 3 columns and vertical scroll (defined above); mobile same */
@media (max-width: 800px) {
#presets-list-tab {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
/* Help modal readability */
#help-modal .modal-content {
max-width: 720px;
line-height: 1.6;
font-size: 0.95rem;
}
#help-modal .modal-content h2 {
margin-bottom: 0.75rem;
}
#help-modal .modal-content h3 {
margin-top: 1.25rem;
margin-bottom: 0.4rem;
font-size: 1.05rem;
font-weight: 600;
}
#help-modal .modal-content p {
text-align: left;
margin-bottom: 0.5rem;
}
#help-modal .modal-content ul {
margin-top: 0.25rem;
margin-left: 1.25rem;
padding-left: 0;
text-align: left;
}
#help-modal .modal-content li {
margin: 0.2rem 0;
line-height: 1.5;
}
#help-modal .muted-text {
text-align: left;
color: #bbb;
font-size: 0.9rem;
}
/* Tab content placeholder (no tab selected) */
.tab-content-placeholder {
padding: 2rem;
text-align: center;
color: #aaa;
}
/* Preset editor: color actions row */
#preset-editor-modal .preset-colors-container + .profiles-actions {
margin-top: 0.5rem;
}
/* Preset editor: brightness/delay field wrappers */
.preset-editor-field {
flex: 1;
display: flex;
flex-direction: column;
}
/* Settings modal */
#settings-modal .modal-content {
max-width: 900px;
max-height: 90vh;
overflow-y: auto;
}
#settings-modal .modal-content > p.muted-text {
margin-bottom: 1rem;
}#settings-modal .settings-section.ap-settings-section {
margin-top: 1.5rem;
}