Implement complete calendar creation functionality

Add full end-to-end calendar creation feature including:
- Create Calendar button in sidebar footer
- Modal form with name, description, and color picker (16 predefined colors in 4x4 grid)
- Form validation and error handling with loading states
- Backend API endpoint for calendar creation with authentication
- CalDAV MKCALENDAR protocol implementation with proper XML generation
- Real-time calendar list refresh after successful creation
- Responsive design for mobile and desktop

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-28 21:21:30 -04:00
parent f94d057f81
commit f9c87369e5
10 changed files with 748 additions and 7 deletions

View File

@@ -828,4 +828,283 @@ body {
.login-form, .register-form {
padding: 1.5rem;
}
}
/* Create Calendar Button */
.create-calendar-button {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 0.75rem 1rem;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
margin-bottom: 1rem;
font-size: 0.9rem;
font-weight: 500;
backdrop-filter: blur(10px);
width: 100%;
}
.create-calendar-button:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-1px);
}
.create-calendar-button:active {
transform: translateY(0);
}
/* Create Calendar Modal */
.modal-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;
padding: 2rem;
}
.create-calendar-modal {
background: white;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 500px;
width: 100%;
max-height: 90vh;
overflow-y: auto;
animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
from {
opacity: 0;
transform: scale(0.9) translateY(-20px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.create-calendar-modal .modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 2rem 2rem 1rem;
border-bottom: 1px solid #e9ecef;
}
.create-calendar-modal .modal-header h2 {
margin: 0;
color: #495057;
font-size: 1.5rem;
font-weight: 600;
}
.close-button {
background: none;
border: none;
font-size: 1.5rem;
color: #6c757d;
cursor: pointer;
padding: 0.25rem;
line-height: 1;
border-radius: 4px;
transition: all 0.2s ease;
}
.close-button:hover {
color: #495057;
background: #f8f9fa;
}
.create-calendar-modal .modal-body {
padding: 1.5rem 2rem 2rem;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
color: #495057;
font-weight: 500;
font-size: 0.9rem;
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 0.75rem;
border: 1px solid #ced4da;
border-radius: 8px;
font-size: 1rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-group input:disabled,
.form-group textarea:disabled {
background-color: #f8f9fa;
color: #6c757d;
cursor: not-allowed;
}
.color-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 0.75rem;
margin: 0.75rem 0;
}
.color-option {
width: 40px;
height: 40px;
border: 3px solid transparent;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.color-option:hover {
transform: scale(1.1);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.color-option.selected {
border-color: #495057;
transform: scale(1.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.color-option.selected::after {
content: '✓';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-weight: bold;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.color-help-text {
font-size: 0.8rem;
color: #6c757d;
margin-top: 0.5rem;
margin-bottom: 0;
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 1rem;
margin-top: 2rem;
padding-top: 1.5rem;
border-top: 1px solid #e9ecef;
}
.cancel-button,
.create-button {
padding: 0.75rem 1.5rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: none;
}
.cancel-button {
background: #f8f9fa;
color: #6c757d;
border: 1px solid #ced4da;
}
.cancel-button:hover:not(:disabled) {
background: #e9ecef;
color: #495057;
}
.create-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.create-button:hover:not(:disabled) {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.cancel-button:disabled,
.create-button:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none !important;
}
.error-message {
background: #f8d7da;
color: #721c24;
padding: 0.75rem 1rem;
border: 1px solid #f5c6cb;
border-radius: 6px;
margin-bottom: 1rem;
font-size: 0.9rem;
}
/* Mobile adjustments for create calendar modal */
@media (max-width: 768px) {
.modal-backdrop {
padding: 1rem;
}
.create-calendar-modal {
max-height: 95vh;
}
.create-calendar-modal .modal-header,
.create-calendar-modal .modal-body {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.color-grid {
grid-template-columns: repeat(4, 1fr);
gap: 0.5rem;
}
.color-option {
width: 35px;
height: 35px;
}
.modal-actions {
flex-direction: column;
gap: 0.75rem;
}
.cancel-button,
.create-button {
width: 100%;
text-align: center;
}
}