Implement right-click color editor modal for customizable calendar colors

- Add ColorEditorModal component with full color picker interface
- Replace theme-dependent colors with unified color palette
- Store custom colors in database via preferences API for cross-device sync
- Add right-click handlers on color dots to open editor modal
- Fix event bubbling to prevent calendar context menu conflicts
- Add comprehensive CSS styling for modal with proper positioning

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-09-19 11:56:16 -04:00
parent fd80624429
commit 4aca6c7fae
6 changed files with 512 additions and 36 deletions

View File

@@ -4186,3 +4186,207 @@ body {
z-index: 1;
}
/* Color Editor Modal */
.color-editor-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.color-editor-modal {
background: var(--modal-background);
color: var(--modal-text);
border-radius: var(--border-radius-medium);
box-shadow: var(--shadow-lg);
max-width: 400px;
width: 95%;
max-height: 80vh;
overflow-y: auto;
position: relative;
animation: modalAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.color-editor-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--spacing-md);
border-bottom: 1px solid var(--modal-header-border);
background: var(--modal-header-background);
border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
}
.color-editor-header h3 {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
color: var(--text-primary);
}
.close-button {
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-secondary);
cursor: pointer;
padding: var(--spacing-xs);
line-height: 1;
border-radius: var(--border-radius-small);
transition: var(--transition-fast);
}
.close-button:hover {
background: var(--background-tertiary);
color: var(--text-primary);
}
.color-editor-content {
padding: var(--spacing-md);
}
.current-color-preview {
display: flex;
align-items: center;
gap: var(--spacing-md);
margin-bottom: var(--spacing-md);
padding: var(--spacing-md);
background: var(--background-tertiary);
border-radius: var(--border-radius-medium);
}
.color-preview-large {
width: 48px;
height: 48px;
border-radius: var(--border-radius-medium);
border: 2px solid var(--border-secondary);
flex-shrink: 0;
}
.color-value {
font-family: monospace;
font-size: 0.9rem;
color: var(--text-secondary);
font-weight: 500;
}
.color-input-section {
margin-bottom: var(--spacing-lg);
}
.color-input-section label {
display: block;
margin-bottom: var(--spacing-sm);
font-weight: 500;
color: var(--text-primary);
}
.color-input-group {
display: flex;
gap: var(--spacing-sm);
align-items: center;
}
.color-input-group input[type="color"] {
width: 48px;
height: 40px;
border: 1px solid var(--border-secondary);
border-radius: var(--border-radius-small);
cursor: pointer;
background: none;
padding: 0;
}
.color-text-input {
flex: 1;
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--border-secondary);
border-radius: var(--border-radius-small);
font-family: monospace;
font-size: 0.9rem;
background: var(--background-secondary);
color: var(--text-primary);
transition: var(--transition-fast);
}
.color-text-input:focus {
outline: none;
border-color: var(--info-color);
box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
}
.suggested-colors-section label {
display: block;
margin-bottom: var(--spacing-sm);
font-weight: 500;
color: var(--text-primary);
}
.suggested-colors-grid {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: var(--spacing-sm);
}
.suggested-color {
width: 32px;
height: 32px;
border-radius: var(--border-radius-small);
border: 2px solid var(--border-secondary);
cursor: pointer;
transition: var(--transition-fast);
}
.suggested-color:hover {
transform: scale(1.1);
border-color: var(--text-primary);
}
.color-editor-footer {
display: flex;
justify-content: flex-end;
gap: var(--spacing-sm);
padding: var(--spacing-md);
border-top: 1px solid var(--modal-header-border);
background: var(--background-tertiary);
border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium);
}
.cancel-button, .save-button {
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--border-secondary);
border-radius: var(--border-radius-small);
cursor: pointer;
font-size: 0.9rem;
font-weight: 500;
transition: var(--transition-fast);
}
.cancel-button {
background: var(--background-secondary);
color: var(--text-secondary);
}
.cancel-button:hover {
background: var(--background-tertiary);
color: var(--text-primary);
}
.save-button {
background: var(--info-color);
color: white;
border-color: var(--info-color);
}
.save-button:hover {
background: #138496;
border-color: #138496;
}