UNPKG

sourabhrealtime

Version:

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

799 lines (694 loc) 13.9 kB
/* Modern CSS for Enhanced Collaboration Platform */ :root { --primary: #6366f1; --primary-dark: #4f46e5; --secondary: #10b981; --danger: #ef4444; --warning: #f59e0b; --success: #22c55e; --info: #3b82f6; --dark: #1f2937; --light: #f8fafc; --border: #e2e8f0; --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1); --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%); --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); } * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: var(--dark); background: var(--light); } /* Login & Signup Styles */ .auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gradient); padding: 20px; } .auth-card { background: white; padding: 40px; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 450px; text-align: center; backdrop-filter: blur(10px); } .auth-title { font-size: 2rem; font-weight: 700; margin-bottom: 30px; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .form-group { margin-bottom: 20px; text-align: left; } .form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--dark); font-size: 0.9rem; } .form-input { width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; transition: all 0.3s ease; background: white; } .form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); transform: translateY(-1px); } .form-select { width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; background: white; cursor: pointer; } .btn { padding: 14px 24px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; } .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); } .btn:active { transform: translateY(0); } .btn-primary { background: var(--gradient); color: white; } .btn-success { background: var(--gradient-success); color: white; } .btn-danger { background: var(--gradient-danger); color: white; } .btn-secondary { background: #6b7280; color: white; } .btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); } .btn-sm { padding: 8px 16px; font-size: 14px; } .btn-lg { padding: 16px 32px; font-size: 18px; } .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; } /* Header Styles */ .header { background: white; padding: 16px 32px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; } .header-title { font-size: 1.5rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .header-actions { display: flex; align-items: center; gap: 16px; } .user-info { text-align: right; } .user-name { font-weight: 600; color: var(--dark); } .user-role { font-size: 0.8rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; } .status-indicator { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: rgba(34, 197, 94, 0.1); color: var(--success); font-size: 0.9rem; font-weight: 500; } .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } /* Notification Styles */ .notifications { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; } .notification { padding: 16px 20px; border-radius: 12px; color: white; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 350px; animation: slideIn 0.3s ease; backdrop-filter: blur(10px); } @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } .notification.success { background: var(--gradient-success); } .notification.error { background: var(--gradient-danger); } .notification.warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); } .notification.info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); } /* Invitation Banner */ .invitation-banner { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; padding: 20px 32px; display: flex; justify-content: space-between; align-items: center; animation: slideDown 0.5s ease; } @keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } } .invitation-content h3 { font-size: 1.2rem; margin-bottom: 8px; } .invitation-actions { display: flex; gap: 12px; } .invitation-item { background: rgba(255, 255, 255, 0.1); padding: 12px 16px; border-radius: 12px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; backdrop-filter: blur(10px); } /* Admin Panel */ .admin-panel { background: white; margin: 24px 32px; padding: 32px; border-radius: 20px; box-shadow: var(--shadow); } .admin-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 24px; color: var(--dark); } .user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 24px; } .user-card { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); border-radius: 16px; border: 2px solid var(--border); transition: all 0.3s ease; } .user-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); } .user-info-card { flex: 1; } .user-name-card { font-weight: 600; font-size: 1.1rem; color: var(--dark); margin-bottom: 4px; } .user-email { color: #6b7280; font-size: 0.9rem; margin-bottom: 4px; } .user-role-badge { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; } .role-admin { background: #fef3c7; color: #d97706; } .role-super_admin { background: #fce7f3; color: #be185d; } .role-editor { background: #dbeafe; color: #2563eb; } /* Main Layout */ .main-container { display: flex; gap: 24px; padding: 24px 32px; min-height: calc(100vh - 80px); } /* Sidebar */ .sidebar { width: 350px; background: white; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); height: fit-content; position: sticky; top: 104px; } .sidebar-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; color: var(--dark); } .project-list { display: flex; flex-direction: column; gap: 16px; } .project-card { padding: 20px; border: 2px solid var(--border); border-radius: 16px; cursor: pointer; transition: all 0.3s ease; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); } .project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); } .project-card.active { border-color: var(--primary); background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); } .project-name { font-weight: 600; font-size: 1.1rem; color: var(--dark); margin-bottom: 8px; } .project-description { color: #6b7280; font-size: 0.9rem; margin-bottom: 12px; line-height: 1.5; } .project-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #9ca3af; } .empty-state { text-align: center; padding: 40px 20px; color: #6b7280; } .empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; } /* Editor */ .editor-container { flex: 1; background: white; border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; } .editor-header { padding: 24px 32px; border-bottom: 2px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); } .editor-title { font-size: 1.4rem; font-weight: 700; color: var(--dark); } .editor-meta { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; color: #6b7280; } .collaborator-count { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(99, 102, 241, 0.1); color: var(--primary); border-radius: 20px; font-weight: 500; } /* Toolbar */ .editor-toolbar { padding: 16px 32px; border-bottom: 2px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; background: #fafbfc; } .toolbar-btn { padding: 10px 14px; border: 2px solid var(--border); background: white; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; font-weight: 600; display: flex; align-items: center; gap: 6px; } .toolbar-btn:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); transform: translateY(-1px); } .toolbar-btn:active { transform: translateY(0); background: rgba(99, 102, 241, 0.1); } .toolbar-separator { width: 2px; background: var(--border); margin: 0 8px; } /* Editor Content */ .editor-content { flex: 1; padding: 32px; min-height: 500px; outline: none; font-size: 16px; line-height: 1.8; background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); font-family: 'Inter', sans-serif; } .editor-content h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 24px; color: var(--dark); line-height: 1.2; } .editor-content h2 { font-size: 2rem; font-weight: 600; margin: 32px 0 16px 0; color: var(--dark); line-height: 1.3; } .editor-content p { margin-bottom: 16px; color: #374151; } .editor-content ul, .editor-content ol { margin: 16px 0; padding-left: 24px; } .editor-content li { margin-bottom: 8px; color: #374151; } .editor-content a { color: var(--primary); text-decoration: none; font-weight: 500; } .editor-content a:hover { text-decoration: underline; } /* Collaborators Bar */ .collaborators-bar { display: flex; align-items: center; gap: 12px; padding: 20px 32px; border-top: 2px solid var(--border); background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); min-height: 80px; } .collaborators-label { font-weight: 600; color: var(--dark); margin-right: 8px; } .collaborator-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 1rem; border: 3px solid white; box-shadow: var(--shadow); cursor: pointer; transition: all 0.3s ease; position: relative; } .collaborator-avatar:hover { transform: scale(1.1); z-index: 10; } .collaborator-tooltip { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: var(--dark); color: white; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .collaborator-avatar:hover .collaborator-tooltip { opacity: 1; } .empty-collaborators { color: #9ca3af; font-style: italic; font-size: 0.9rem; } /* Modal */ .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(4px); } .modal { background: white; padding: 32px; border-radius: 20px; width: 90%; max-width: 600px; box-shadow: var(--shadow-lg); animation: modalSlideIn 0.3s ease; } @keyframes modalSlideIn { from { transform: scale(0.9) translateY(-20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } } .modal-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 24px; color: var(--dark); } .modal-actions { display: flex; gap: 16px; justify-content: flex-end; margin-top: 32px; } /* Responsive Design */ @media (max-width: 768px) { .main-container { flex-direction: column; padding: 16px; gap: 16px; } .sidebar { width: 100%; position: static; } .header { padding: 12px 16px; } .header-actions { gap: 8px; } .btn { padding: 10px 16px; font-size: 14px; } .auth-card { padding: 24px; margin: 16px; } .user-grid { grid-template-columns: 1fr; } .editor-toolbar { padding: 12px 16px; } .editor-content { padding: 20px; } } /* Dark mode support */ @media (prefers-color-scheme: dark) { :root { --dark: #f8fafc; --light: #1f2937; --border: #374151; } body { background: #111827; color: #f8fafc; } .form-input, .form-select { background: #374151; border-color: #4b5563; color: #f8fafc; } .editor-content { background: #374151; color: #f8fafc; } }