UNPKG

sourabhrealtime

Version:

ROBUST RICH TEXT EDITOR: Single-pane contentEditable with direct text selection formatting, speech features, undo/redo, professional UI - Perfect TipTap alternative

793 lines (672 loc) 11.9 kB
/* Enhanced RealtimeCursor Styles v2.6.5 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; background: #f5f7fa; color: #333; } /* Login Container */ .login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; } .login-card { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; } .login-card h1 { color: #333; margin-bottom: 10px; font-size: 2rem; } .login-card p { color: #666; margin-bottom: 30px; } .demo-credentials { margin-top: 20px; padding: 15px; background: #f8f9fa; border-radius: 10px; font-size: 0.9rem; color: #666; text-align: left; } .demo-credentials h4 { color: #333; margin-bottom: 10px; } /* App Container */ .app-container { min-height: 100vh; background: #f5f7fa; } /* Header */ .header { background: white; padding: 15px 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; } .header-left { display: flex; align-items: center; gap: 20px; } .header-left h1 { color: #333; font-size: 1.5rem; } .connection-status { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #666; } .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc3545; transition: background-color 0.3s; } .status-dot.connected { background: #28a745; } .header-right { display: flex; align-items: center; gap: 20px; } .user-info { display: flex; flex-direction: column; align-items: flex-end; } .user-name { font-weight: 600; color: #333; } .user-role { font-size: 0.8rem; color: #666; text-transform: uppercase; } .header-actions { display: flex; gap: 10px; } /* Buttons */ .btn-primary, .btn-secondary, .btn-admin, .btn-success, .btn-danger { padding: 8px 16px; border: none; border-radius: 8px; font-weight: 500; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; } .btn-primary { background: #007bff; color: white; } .btn-primary:hover { background: #0056b3; transform: translateY(-1px); } .btn-secondary { background: #6c757d; color: white; } .btn-secondary:hover { background: #545b62; } .btn-admin { background: #17a2b8; color: white; } .btn-admin:hover { background: #138496; } .btn-success { background: #28a745; color: white; } .btn-success:hover { background: #1e7e34; } .btn-danger { background: #dc3545; color: white; } .btn-danger:hover { background: #c82333; } .btn-primary:disabled, .btn-secondary:disabled { background: #e9ecef; color: #6c757d; cursor: not-allowed; transform: none; } /* Notifications */ .notifications { position: fixed; top: 80px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; } .notification { padding: 12px 20px; border-radius: 8px; color: white; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-width: 300px; } .notification.info { background: #17a2b8; } .notification.success { background: #28a745; } .notification.warning { background: #ffc107; color: #333; } .notification.error { background: #dc3545; } @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } /* Admin Panel */ .admin-panel { background: white; margin: 20px 30px; padding: 25px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); } .admin-panel h2 { color: #333; margin-bottom: 20px; font-size: 1.5rem; } .admin-section { margin-bottom: 30px; } .admin-section h3 { color: #555; margin-bottom: 15px; font-size: 1.2rem; } .requests-list { display: flex; flex-direction: column; gap: 15px; } .request-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #f8f9fa; border-radius: 10px; border-left: 4px solid #ffc107; } .request-info strong { display: block; color: #333; margin-bottom: 5px; } .request-info span { color: #666; font-size: 0.9rem; } .request-info p { margin: 8px 0; color: #555; } .request-info small { color: #999; font-size: 0.8rem; } .request-actions { display: flex; gap: 10px; } .form-row { display: flex; gap: 10px; align-items: center; } .form-row input, .form-row select { padding: 8px 12px; border: 2px solid #e9ecef; border-radius: 6px; font-size: 0.9rem; } .form-row input { flex: 1; } .collaborators-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; } .collaborator-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: #f8f9fa; border-radius: 10px; border-left: 4px solid #28a745; } .collaborator-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 1.1rem; } .collaborator-info strong { display: block; color: #333; } .collaborator-info span { color: #666; font-size: 0.9rem; text-transform: uppercase; } /* Main Content */ .main-content { display: flex; gap: 20px; padding: 20px 30px; min-height: calc(100vh - 80px); } /* Sidebar */ .sidebar { width: 300px; background: white; border-radius: 15px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); height: fit-content; } .sidebar h3 { color: #333; margin-bottom: 20px; font-size: 1.3rem; } .projects-list { display: flex; flex-direction: column; gap: 15px; } .project-item { padding: 15px; border: 2px solid #e9ecef; border-radius: 10px; transition: all 0.2s; } .project-item:hover { border-color: #007bff; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,123,255,0.1); } .project-info strong { display: block; color: #333; margin-bottom: 8px; font-size: 1.1rem; } .project-info p { color: #666; margin-bottom: 8px; font-size: 0.9rem; } .project-info small { color: #999; font-size: 0.8rem; } .project-actions { display: flex; gap: 8px; margin-top: 12px; } /* Editor Section */ .editor-section { flex: 1; background: white; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; } .editor-header { padding: 20px 25px; border-bottom: 1px solid #e9ecef; display: flex; justify-content: space-between; align-items: center; } .editor-header h3 { color: #333; font-size: 1.3rem; } .editor-info { display: flex; gap: 20px; font-size: 0.9rem; color: #666; } /* TipTap Editor */ .tiptap-editor { flex: 1; display: flex; flex-direction: column; } .editor-toolbar { display: flex; gap: 4px; padding: 15px 25px; border-bottom: 1px solid #e9ecef; flex-wrap: wrap; align-items: center; } .toolbar-btn { padding: 8px 12px; border: 1px solid #e9ecef; background: white; border-radius: 6px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; } .toolbar-btn:hover { background: #f8f9fa; border-color: #007bff; transform: translateY(-1px); } .toolbar-separator { width: 1px; height: 24px; background: #e9ecef; margin: 0 8px; } .editor-content { flex: 1; padding: 25px; font-size: 16px; line-height: 1.6; background: #fafbfc; } .editor-content:focus { background: #ffffff; } .editor-content h1 { font-size: 2rem; margin-bottom: 16px; color: #333; } .editor-content h2 { font-size: 1.5rem; margin-bottom: 12px; color: #333; } .editor-content p { margin-bottom: 12px; } .editor-content ul, .editor-content ol { margin-left: 20px; margin-bottom: 12px; } .editor-content a { color: #007bff; text-decoration: underline; } .collaborators-bar { display: flex; gap: 10px; padding: 15px 25px; border-top: 1px solid #e9ecef; align-items: center; min-height: 60px; } .collaborators-bar .collaborator-avatar { width: 32px; height: 32px; font-size: 0.9rem; } .no-project { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #666; text-align: center; } .no-project h3 { margin-bottom: 10px; font-size: 1.5rem; } /* Modal */ .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; } .modal { background: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); } .modal h2 { color: #333; margin-bottom: 25px; font-size: 1.5rem; } .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 8px; color: #555; font-weight: 500; } .form-group input, .form-group textarea { width: 100%; padding: 12px; border: 2px solid #e9ecef; border-radius: 8px; font-size: 16px; transition: border-color 0.2s; } .form-group input:focus, .form-group textarea:focus { outline: none; border-color: #007bff; } .form-group textarea { resize: vertical; min-height: 80px; } .form-group input[type="checkbox"] { width: auto; margin-right: 8px; } .modal-actions { display: flex; gap: 15px; justify-content: flex-end; margin-top: 25px; } /* Enhanced RealtimeEditor */ .enhanced-realtime-editor { border: 1px solid #e1e5e9; border-radius: 8px; background: white; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; overflow: hidden; } .editor-status { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f8f9fa; border-bottom: 1px solid #e1e5e9; font-size: 0.85rem; } .status-indicator { display: flex; align-items: center; gap: 6px; } .status-indicator.connected .status-dot { background: #28a745; } .collaborators-info { color: #6c757d; font-weight: 500; } /* Responsive Design */ @media (max-width: 768px) { .header { padding: 10px 15px; flex-direction: column; gap: 15px; } .main-content { flex-direction: column; padding: 15px; } .sidebar { width: 100%; } .admin-panel { margin: 15px; padding: 20px; } .collaborators-grid { grid-template-columns: 1fr; } .request-item { flex-direction: column; align-items: flex-start; gap: 15px; } .modal { margin: 20px; width: calc(100% - 40px); } .editor-toolbar { padding: 10px 15px; } .toolbar-btn { padding: 6px 8px; min-width: 32px; height: 32px; font-size: 0.8rem; } .form-row { flex-direction: column; align-items: stretch; } } /* Animations */ @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .project-item, .collaborator-card, .request-item { animation: fadeIn 0.3s ease; } /* Dark mode support */ @media (prefers-color-scheme: dark) { body { background: #1a1a1a; color: #e0e0e0; } .app-container { background: #1a1a1a; } .header, .sidebar, .editor-section, .admin-panel, .modal { background: #2d2d2d; color: #e0e0e0; } .editor-content { background: #1e1e1e; color: #e0e0e0; } .toolbar-btn { background: #3a3a3a; border-color: #555; color: #e0e0e0; } .toolbar-btn:hover { background: #4a4a4a; } }