Files
gowtham-darkseid 44ea4d2e64 feat: Complete Mail Composer with EmailJS integration
- Rich email composer with formatting tools (bold, italic, underline, links)
- Multi-recipient support (To, CC, BCC fields)
- File attachments with drag & drop support
- Priority levels and email validation
- Draft management with auto-save and cloud sync
- Real email sending via EmailJS integration
- Responsive design for mobile and desktop
- Comprehensive error handling and fallback modes
- Complete documentation and setup guides
- Firebase integration ready for advanced features

Features:
 Real email sending (EmailJS)
 Rich text editor
 File attachments
 Draft management
 Form validation
 Responsive UI
 Error handling
 Documentation
2025-09-09 21:17:46 +05:30

481 lines
8.3 KiB
CSS

:root {
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--secondary-color: #6b7280;
--success-color: #10b981;
--error-color: #ef4444;
--warning-color: #f59e0b;
--background: #f8fafc;
--surface: #ffffff;
--text-primary: #1f2937;
--text-secondary: #6b7280;
--border-color: #d1d5db;
--border-radius: 8px;
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-primary);
background-color: var(--background);
min-height: 100vh;
}
#app {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 2rem;
padding: 2rem;
background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
color: white;
border-radius: var(--border-radius);
box-shadow: var(--shadow-lg);
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
font-weight: 700;
}
.header p {
font-size: 1.1rem;
opacity: 0.9;
}
.service-status {
margin-top: 1rem;
}
.status-indicator {
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 500;
display: inline-block;
}
.status-indicator.demo {
background: rgba(245, 158, 11, 0.2);
color: #f59e0b;
border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-indicator.emailjs {
background: rgba(16, 185, 129, 0.2);
color: #10b981;
border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-indicator.firebase {
background: rgba(59, 130, 246, 0.2);
color: #3b82f6;
border: 1px solid rgba(59, 130, 246, 0.3);
}
.main-container {
background: var(--surface);
border-radius: var(--border-radius);
padding: 2rem;
box-shadow: var(--shadow);
}
.mail-form {
display: grid;
gap: 1.5rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.form-group label {
font-weight: 600;
color: var(--text-primary);
font-size: 0.9rem;
}
.form-group input,
.form-group select {
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: var(--border-radius);
font-size: 1rem;
transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}
.help-text {
font-size: 0.8rem;
color: var(--text-secondary);
margin-top: -0.25rem;
}
.editor-toolbar {
display: flex;
gap: 0.5rem;
padding: 0.5rem;
background: var(--background);
border: 2px solid var(--border-color);
border-bottom: none;
border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.toolbar-btn {
padding: 0.5rem 0.75rem;
border: 1px solid var(--border-color);
background: var(--surface);
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
font-size: 0.9rem;
}
.toolbar-btn:hover {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.toolbar-btn.active {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.message-editor {
min-height: 200px;
padding: 1rem;
border: 2px solid var(--border-color);
border-top: none;
border-radius: 0 0 var(--border-radius) var(--border-radius);
font-size: 1rem;
line-height: 1.6;
outline: none;
overflow-y: auto;
background: var(--surface);
}
.message-editor:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}
.message-editor:empty:before {
content: attr(data-placeholder);
color: var(--text-secondary);
font-style: italic;
}
.char-counter {
text-align: right;
font-size: 0.8rem;
color: var(--text-secondary);
margin-top: 0.25rem;
}
.file-input-wrapper {
position: relative;
}
.file-input-wrapper input[type="file"] {
position: absolute;
opacity: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
.file-input-label {
display: inline-block;
padding: 0.75rem 1.5rem;
background: var(--background);
border: 2px dashed var(--border-color);
border-radius: var(--border-radius);
cursor: pointer;
transition: all 0.2s;
text-align: center;
width: 100%;
font-weight: 500;
}
.file-input-label:hover {
border-color: var(--primary-color);
background: rgb(59 130 246 / 0.05);
}
.attachment-list {
margin-top: 0.5rem;
}
.attachment-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem;
background: var(--background);
border-radius: var(--border-radius);
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.attachment-remove {
background: var(--error-color);
color: white;
border: none;
border-radius: 50%;
width: 24px;
height: 24px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.7rem;
}
.form-actions {
display: flex;
gap: 1rem;
margin-top: 1rem;
flex-wrap: wrap;
}
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: var(--border-radius);
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
position: relative;
overflow: hidden;
}
.btn-primary {
background: var(--primary-color);
color: white;
}
.btn-primary:hover {
background: var(--primary-hover);
transform: translateY(-1px);
box-shadow: var(--shadow-lg);
}
.btn-secondary {
background: var(--background);
color: var(--text-primary);
border: 2px solid var(--border-color);
}
.btn-secondary:hover {
background: var(--border-color);
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
.btn-loading {
display: none;
}
.btn.loading .btn-text {
display: none;
}
.btn.loading .btn-loading {
display: inline;
}
.message-status {
margin-top: 1.5rem;
padding: 1rem;
border-radius: var(--border-radius);
font-weight: 500;
display: none;
}
.message-status.success {
background: rgb(16 185 129 / 0.1);
color: var(--success-color);
border: 1px solid rgb(16 185 129 / 0.2);
display: block;
}
.message-status.error {
background: rgb(239 68 68 / 0.1);
color: var(--error-color);
border: 1px solid rgb(239 68 68 / 0.2);
display: block;
}
.message-status.warning {
background: rgb(245 158 11 / 0.1);
color: var(--warning-color);
border: 1px solid rgb(245 158 11 / 0.2);
display: block;
}
.drafts-section {
margin-top: 3rem;
padding-top: 2rem;
border-top: 2px solid var(--border-color);
}
.drafts-section h2 {
margin-bottom: 1rem;
color: var(--text-primary);
}
.drafts-list {
display: grid;
gap: 1rem;
}
.draft-item {
padding: 1rem;
background: var(--background);
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.2s;
}
.draft-item:hover {
transform: translateY(-1px);
box-shadow: var(--shadow);
border-color: var(--primary-color);
}
.draft-subject {
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--text-primary);
}
.draft-preview {
font-size: 0.9rem;
color: var(--text-secondary);
line-height: 1.4;
margin-bottom: 0.5rem;
}
.draft-meta {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.8rem;
color: var(--text-secondary);
}
.draft-actions {
display: flex;
gap: 0.5rem;
}
.draft-actions button {
padding: 0.25rem 0.5rem;
border: none;
border-radius: 4px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
}
.draft-load {
background: var(--primary-color);
color: white;
}
.draft-delete {
background: var(--error-color);
color: white;
}
.no-drafts {
text-align: center;
color: var(--text-secondary);
font-style: italic;
padding: 2rem;
}
/* Responsive Design */
@media (max-width: 768px) {
#app {
padding: 10px;
}
.header {
padding: 1.5rem;
}
.header h1 {
font-size: 2rem;
}
.main-container {
padding: 1.5rem;
}
.form-actions {
flex-direction: column;
}
.btn {
width: 100%;
}
.editor-toolbar {
flex-wrap: wrap;
}
}
/* Animation for better UX */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.mail-form {
animation: fadeIn 0.5s ease-out;
}
.attachment-item {
animation: fadeIn 0.3s ease-out;
}
.draft-item {
animation: fadeIn 0.3s ease-out;
}