Files
audiobook-maker-pro-v4/static/css/markdown-editor.css
Ashim Kumar 8e02b9ad09 first commit
2026-02-20 13:53:36 +06:00

466 lines
8.5 KiB
CSS

/* ============================================
Markdown Editor Styles
UPDATED: Removed slash command styles
UPDATED: Added image-btn style for new-block-line
============================================= */
/* Chapter Marker */
.chapter-marker {
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
border: 2px solid #f59e0b;
border-radius: var(--border-radius);
padding: 16px 20px;
margin: 24px 0;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
}
.chapter-marker-left {
display: flex;
align-items: center;
gap: 12px;
}
.chapter-label {
font-weight: 700;
color: #92400e;
text-transform: uppercase;
font-size: 0.875rem;
letter-spacing: 1px;
}
.chapter-number-input {
width: 80px;
text-align: center;
font-weight: 600;
border: 2px solid #f59e0b;
border-radius: 6px;
}
.chapter-voice-select {
min-width: 180px;
border: 2px solid #f59e0b;
border-radius: 6px;
}
.chapter-actions {
display: flex;
gap: 8px;
}
/* Markdown Block */
.md-block {
position: relative;
margin: 8px 0;
padding: 12px 16px;
border-radius: var(--border-radius-sm);
border: 2px solid transparent;
transition: all 0.2s;
min-height: 48px;
}
.md-block:hover {
background: var(--bg-tertiary);
border-color: var(--border-color);
}
.md-block.editing {
background: #eff6ff;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
/* Block Content */
.md-block-content {
font-family: var(--font-serif);
font-size: 1.125rem;
line-height: 1.8;
color: var(--text-primary);
}
.md-block-content h1 {
font-size: 2rem;
font-weight: 700;
margin: 0;
padding-bottom: 8px;
}
.md-block-content h2 {
font-size: 1.5rem;
font-weight: 700;
margin: 0;
}
.md-block-content h3 {
font-size: 1.25rem;
font-weight: 600;
margin: 0;
}
.md-block-content p {
margin: 0;
}
.md-block-content blockquote {
border-left: 4px solid var(--primary-color);
padding-left: 16px;
margin: 0;
font-style: italic;
color: var(--text-secondary);
}
.md-block-content ul,
.md-block-content ol {
margin: 0;
padding-left: 24px;
}
.md-block-content img {
max-width: 100%;
height: auto;
border-radius: var(--border-radius-sm);
margin: 8px auto;
display: block;
}
.md-block-content table {
width: 100%;
border-collapse: collapse;
margin: 8px 0;
}
.md-block-content th,
.md-block-content td {
border: 1px solid var(--border-color);
padding: 8px 12px;
text-align: left;
}
.md-block-content th {
background: var(--bg-tertiary);
font-weight: 600;
}
/* Block Edit Mode */
.md-block-edit {
display: none;
}
.md-block.editing .md-block-content {
display: none;
}
.md-block.editing .md-block-edit {
display: block;
}
.md-block-textarea {
width: 100%;
min-height: 100px;
padding: 12px;
border: none;
border-radius: var(--border-radius-sm);
font-family: var(--font-mono);
font-size: 0.9375rem;
line-height: 1.6;
resize: vertical;
background: white;
}
.md-block-textarea:focus {
outline: none;
}
/* Block Toolbar */
.md-block-toolbar {
display: none;
position: absolute;
top: -40px;
left: 0;
background: white;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
padding: 4px;
box-shadow: var(--shadow-md);
z-index: 100;
}
.md-block.editing .md-block-toolbar {
display: flex;
gap: 4px;
}
.toolbar-btn {
width: 32px;
height: 32px;
border: none;
background: transparent;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
transition: all 0.2s;
}
.toolbar-btn:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
}
.toolbar-btn.active {
background: var(--primary-color);
color: white;
}
.toolbar-divider {
width: 1px;
background: var(--border-color);
margin: 4px;
}
/* Block Type Menu */
.block-type-menu {
position: absolute;
top: 100%;
left: 0;
background: white;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-lg);
padding: 8px;
min-width: 200px;
z-index: 1000;
display: none;
}
.block-type-menu.active {
display: block;
}
.block-type-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}
.block-type-item:hover {
background: var(--bg-tertiary);
}
.block-type-item i {
font-size: 1.25rem;
color: var(--text-secondary);
width: 24px;
text-align: center;
}
.block-type-item span {
font-weight: 500;
}
.block-type-item small {
display: block;
color: var(--text-muted);
font-size: 0.75rem;
}
/* Empty Block Placeholder */
.md-block-placeholder {
color: var(--text-muted);
font-style: italic;
}
/* ============================================
New Block Line
============================================= */
.new-block-line {
height: 24px;
position: relative;
cursor: text;
}
.new-block-line:hover::before {
content: '';
position: absolute;
left: 0;
right: 0;
top: 50%;
height: 2px;
background: var(--primary-color);
opacity: 0.3;
}
.new-block-line:hover .add-line-buttons {
display: flex;
}
.add-line-buttons {
display: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
gap: 8px;
z-index: 50;
}
.add-line-btn {
width: 28px;
height: 28px;
border: none;
border-radius: 50%;
background: var(--primary-color);
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
transition: all 0.2s;
}
.add-line-btn:hover {
transform: scale(1.1);
}
/* Image add button - teal */
.add-line-btn.image-btn {
background: #06b6d4;
}
.add-line-btn.image-btn:hover {
background: #0891b2;
}
/* Chapter add button - amber */
.add-line-btn.chapter-btn {
background: #f59e0b;
}
.add-line-btn.chapter-btn:hover {
background: #d97706;
}
/* ============================================
Image Block - Centered
============================================= */
.image-block {
text-align: center;
padding: 24px;
border: 2px dashed var(--border-color);
border-radius: var(--border-radius);
background: var(--bg-tertiary);
cursor: pointer;
transition: all 0.2s;
}
.image-block:hover {
border-color: var(--primary-color);
background: rgba(79, 70, 229, 0.05);
}
.image-block img {
max-width: 100%;
height: auto;
border-radius: var(--border-radius-sm);
margin: 0 auto;
display: block;
}
.image-upload-placeholder {
color: var(--text-muted);
}
.image-upload-placeholder i {
font-size: 2rem;
margin-bottom: 8px;
display: block;
}
/* ============================================
Audio Indicator
============================================= */
.audio-indicator {
position: absolute;
top: 8px;
right: 8px;
width: 24px;
height: 24px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
}
.audio-indicator.has-audio {
background: var(--success-color);
color: white;
}
.audio-indicator.no-audio {
background: var(--bg-tertiary);
color: var(--text-muted);
}
/* ============================================
Block Actions Indicator (Edit + Delete)
============================================= */
.block-actions-indicator {
position: absolute;
top: 8px;
right: 40px;
display: flex;
gap: 4px;
opacity: 0;
transition: opacity 0.2s;
z-index: 10;
}
.md-block:hover .block-actions-indicator {
opacity: 1;
}
.action-indicator-btn {
width: 28px;
height: 28px;
border: none;
background: var(--bg-tertiary);
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
transition: all 0.2s;
padding: 0;
}
.action-indicator-btn.edit-block-btn:hover {
background: var(--primary-color);
color: white;
}
.action-indicator-btn.delete-block-btn:hover {
background: var(--danger-color);
color: white;
}
/* Hide the old block-edit-indicator since we replaced it */
.block-edit-indicator {
display: none !important;
}