slideshare/src/components/presentations/PresentationEditor.css
Michael Mainguy 9b0b16969f feat: implement complete presentation management system with aspect ratio support
## Major Features Added:

### Presentation Management
- Complete CRUD operations for presentations (create, read, update, delete)
- IndexedDB storage for offline presentation data
- Comprehensive presentation list view with metadata
- Navigation integration with header menu

### Slide Management
- Full slide editor with layout selection and content editing
- Live preview with theme styling applied
- Speaker notes functionality
- Enhanced layout previews with realistic sample content
- Themed layout selection with proper CSS inheritance

### Aspect Ratio System
- Support for 3 common presentation formats: 16:9, 4:3, 16:10
- Global CSS system baked into theme engine
- Visual aspect ratio selection in presentation creation
- Responsive scaling for different viewing contexts
- Print-optimized styling with proper dimensions

### User Experience Improvements
- Enhanced sample content generation for realistic previews
- Improved navigation with presentation management
- Better form styling and user interaction
- Comprehensive error handling and loading states
- Mobile-responsive design throughout

### Technical Infrastructure
- Complete TypeScript type system for presentations
- Modular component architecture
- CSS aspect ratio classes for theme consistency
- Enhanced template rendering with live updates
- Robust storage utilities with proper error handling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 16:34:00 -05:00

730 lines
12 KiB
CSS

.presentation-editor {
min-height: 100vh;
background: #f8fafc;
display: flex;
flex-direction: column;
}
/* Header */
.editor-header {
background: white;
border-bottom: 1px solid #e2e8f0;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
flex-wrap: wrap;
}
.presentation-info {
display: flex;
align-items: center;
gap: 1.5rem;
flex: 1;
min-width: 0;
}
.back-link {
color: #64748b;
text-decoration: none;
font-weight: 500;
font-size: 0.875rem;
padding: 0.5rem 0.75rem;
border-radius: 0.375rem;
transition: all 0.2s ease;
flex-shrink: 0;
}
.back-link:hover {
background: #f1f5f9;
color: #334155;
}
.presentation-title {
flex: 1;
min-width: 0;
}
.presentation-title h1 {
margin: 0;
font-size: 1.5rem;
font-weight: 600;
color: #1e293b;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.presentation-description {
margin: 0.25rem 0 0 0;
color: #64748b;
font-size: 0.875rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.presentation-meta {
display: flex;
gap: 1rem;
align-items: center;
flex-shrink: 0;
flex-wrap: wrap;
}
.theme-badge {
background: #dbeafe;
color: #1e40af;
padding: 0.25rem 0.75rem;
border-radius: 0.375rem;
font-size: 0.75rem;
font-weight: 500;
}
.slide-counter {
color: #6b7280;
font-size: 0.875rem;
font-weight: 500;
}
.saving-indicator {
color: #f59e0b;
font-size: 0.875rem;
font-weight: 500;
}
.editor-actions {
display: flex;
gap: 0.75rem;
flex-shrink: 0;
}
.action-button {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
font-size: 0.875rem;
border: none;
cursor: pointer;
transition: all 0.2s ease;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
}
.action-button.primary {
background: #3b82f6;
color: white;
}
.action-button.primary:hover:not(:disabled) {
background: #2563eb;
}
.action-button.secondary {
background: #f8fafc;
color: #64748b;
border: 1px solid #e2e8f0;
}
.action-button.secondary:hover:not(:disabled) {
background: #f1f5f9;
color: #475569;
}
.action-button.large {
padding: 0.75rem 1.5rem;
font-size: 1rem;
}
.action-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Main Content */
.editor-content {
flex: 1;
display: flex;
flex-direction: column;
}
/* Empty State */
.empty-presentation {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
}
.empty-content {
text-align: center;
max-width: 800px;
}
.empty-content h2 {
margin: 0 0 0.5rem 0;
color: #374151;
font-size: 1.5rem;
}
.empty-content p {
margin: 0 0 2rem 0;
color: #6b7280;
font-size: 1rem;
}
/* Theme Preview in Empty State */
.theme-preview {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 0.75rem;
padding: 2rem;
margin: 2rem 0;
text-align: left;
max-height: 500px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.theme-preview h3 {
margin: 0 0 0.5rem 0;
color: #1e293b;
font-size: 1.25rem;
font-weight: 600;
}
.theme-description {
margin: 0 0 1.5rem 0;
color: #64748b;
font-size: 0.875rem;
}
.available-layouts {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.available-layouts h4 {
margin: 0 0 1rem 0;
color: #374151;
font-size: 1rem;
font-weight: 600;
flex-shrink: 0;
}
.layouts-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1rem;
overflow-y: auto;
max-height: 300px;
padding-right: 0.5rem;
}
/* Custom scrollbar for layouts grid */
.layouts-grid::-webkit-scrollbar {
width: 6px;
}
.layouts-grid::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 3px;
}
.layouts-grid::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 3px;
}
.layouts-grid::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
.layout-preview-card {
background: white;
border: 1px solid #e2e8f0;
border-radius: 0.5rem;
padding: 1rem;
transition: all 0.2s ease;
}
.layout-preview-card:hover {
border-color: #cbd5e1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.layout-name {
font-weight: 600;
color: #1e293b;
font-size: 0.875rem;
margin-bottom: 0.25rem;
}
.layout-description {
color: #64748b;
font-size: 0.75rem;
margin-bottom: 0.5rem;
line-height: 1.4;
}
.slot-count {
color: #059669;
font-size: 0.75rem;
font-weight: 500;
}
.more-layouts {
display: flex;
align-items: center;
justify-content: center;
background: #f1f5f9;
border: 1px dashed #cbd5e1;
border-radius: 0.5rem;
padding: 1rem;
color: #64748b;
font-size: 0.875rem;
font-weight: 500;
}
/* Editor Layout */
.editor-layout {
display: flex;
flex: 1;
min-height: 0;
}
/* Slide Sidebar */
.slide-sidebar {
width: 280px;
background: white;
border-right: 1px solid #e2e8f0;
display: flex;
flex-direction: column;
}
.sidebar-header {
padding: 1rem;
border-bottom: 1px solid #e2e8f0;
display: flex;
justify-content: space-between;
align-items: center;
}
.sidebar-header h3 {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: #1e293b;
}
.add-slide-button {
width: 32px;
height: 32px;
border: 1px solid #e2e8f0;
background: white;
border-radius: 0.375rem;
cursor: pointer;
font-size: 1.25rem;
color: #3b82f6;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.add-slide-button:hover:not(:disabled) {
background: #f8fafc;
border-color: #3b82f6;
}
.add-slide-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.slides-list {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.slide-thumbnail {
background: white;
border: 2px solid #e2e8f0;
border-radius: 0.5rem;
margin-bottom: 0.5rem;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.slide-thumbnail:hover {
border-color: #cbd5e1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.slide-thumbnail.active {
border-color: #3b82f6;
box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}
.thumbnail-number {
position: absolute;
top: 0.5rem;
left: 0.5rem;
background: #374151;
color: white;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
font-weight: 500;
z-index: 10;
}
.slide-thumbnail.active .thumbnail-number {
background: #3b82f6;
}
.thumbnail-preview {
padding: 2rem 1rem 1rem;
min-height: 80px;
background: #f8fafc;
border-radius: 0.25rem;
margin: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
}
.thumbnail-content {
text-align: center;
}
.layout-name {
display: block;
font-size: 0.75rem;
font-weight: 500;
color: #374151;
margin-bottom: 0.25rem;
}
.content-count {
display: block;
font-size: 0.625rem;
color: #6b7280;
}
.thumbnail-actions {
display: flex;
gap: 0.25rem;
padding: 0.5rem;
justify-content: center;
border-top: 1px solid #f1f5f9;
}
.thumbnail-action {
width: 28px;
height: 28px;
border: 1px solid #e2e8f0;
background: white;
border-radius: 0.25rem;
cursor: pointer;
font-size: 0.875rem;
color: #6b7280;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.thumbnail-action:hover:not(:disabled) {
background: #f8fafc;
border-color: #cbd5e1;
}
.thumbnail-action.delete:hover:not(:disabled) {
background: #fef2f2;
border-color: #fecaca;
color: #dc2626;
}
.thumbnail-action:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Slide Editor Area */
.slide-editor-area {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
.slide-editor {
flex: 1;
display: flex;
flex-direction: column;
padding: 1rem;
}
.slide-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
gap: 1rem;
flex-wrap: wrap;
}
.slide-header h3 {
margin: 0;
font-size: 1.125rem;
font-weight: 600;
color: #1e293b;
}
.slide-controls {
display: flex;
gap: 0.5rem;
}
.control-button {
padding: 0.375rem 0.75rem;
border: 1px solid #e2e8f0;
background: white;
color: #374151;
border-radius: 0.375rem;
cursor: pointer;
font-weight: 500;
font-size: 0.875rem;
transition: all 0.2s ease;
}
.control-button:hover:not(:disabled) {
background: #f8fafc;
border-color: #cbd5e1;
}
.control-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.slide-content-editor {
flex: 1;
display: flex;
flex-direction: column;
gap: 1rem;
}
.content-preview {
flex: 1;
background: white;
border: 1px solid #e2e8f0;
border-radius: 0.75rem;
padding: 2rem;
min-height: 400px;
}
.editor-placeholder {
text-align: center;
color: #6b7280;
}
.editor-placeholder h4 {
margin: 0 0 1rem 0;
color: #374151;
}
.editor-placeholder p {
margin: 0.5rem 0;
}
.content-slots {
margin: 1.5rem 0;
text-align: left;
}
.content-slot {
margin-bottom: 1rem;
padding: 0.75rem;
background: #f8fafc;
border-radius: 0.375rem;
}
.content-slot label {
display: block;
font-weight: 500;
color: #374151;
margin-bottom: 0.25rem;
font-size: 0.875rem;
}
.slot-content {
color: #6b7280;
font-size: 0.875rem;
}
.placeholder-note {
font-style: italic;
color: #9ca3af;
margin-top: 1.5rem;
}
.slide-notes-editor {
background: white;
border: 1px solid #e2e8f0;
border-radius: 0.75rem;
padding: 1rem;
}
.slide-notes-editor h4 {
margin: 0 0 0.75rem 0;
font-size: 0.875rem;
font-weight: 600;
color: #374151;
}
.notes-textarea {
width: 100%;
min-height: 80px;
padding: 0.75rem;
border: 1px solid #d1d5db;
border-radius: 0.5rem;
font-size: 0.875rem;
color: #374151;
background: white;
box-sizing: border-box;
resize: vertical;
font-family: inherit;
}
.notes-textarea:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.slide-error {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
text-align: center;
color: #dc2626;
}
/* Loading and Error States */
.loading-content,
.error-content,
.not-found-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 50vh;
text-align: center;
gap: 1rem;
}
.loading-spinner {
color: #64748b;
font-size: 1.125rem;
}
.error-content h2,
.not-found-content h2 {
color: #dc2626;
margin: 0;
}
.error-content p,
.not-found-content p {
color: #64748b;
margin: 0.5rem 0 1.5rem 0;
}
/* Responsive Design */
@media (max-width: 1024px) {
.slide-sidebar {
width: 240px;
}
.editor-header {
padding: 1rem;
flex-direction: column;
align-items: stretch;
gap: 1rem;
}
.presentation-info {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
.presentation-meta {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.editor-actions {
justify-content: stretch;
}
.action-button {
flex: 1;
}
}
@media (max-width: 768px) {
.editor-layout {
flex-direction: column;
}
.slide-sidebar {
width: 100%;
max-height: 200px;
border-right: none;
border-bottom: 1px solid #e2e8f0;
}
.slides-list {
display: flex;
gap: 0.5rem;
overflow-x: auto;
padding: 0.5rem;
}
.slide-thumbnail {
min-width: 120px;
margin-bottom: 0;
}
.slide-header {
flex-direction: column;
align-items: stretch;
}
.slide-controls {
justify-content: stretch;
}
.control-button {
flex: 1;
}
}