482 lines
24 KiB
HTML
482 lines
24 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Audiobook Maker Pro v4</title>
|
|
|
|
|
|
<!-- Bootstrap 5 -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
|
|
|
<!-- Google Fonts -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="/static/css/style.css">
|
|
<link rel="stylesheet" href="/static/css/markdown-editor.css">
|
|
</head>
|
|
<body>
|
|
<!-- Loading Overlay -->
|
|
<div class="loading-overlay" id="loadingOverlay">
|
|
<div class="loading-content">
|
|
<div class="spinner-border text-primary" role="status"></div>
|
|
<h5 id="loadingText">Processing...</h5>
|
|
<p id="loadingSubtext" class="text-muted">Please wait</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Welcome Overlay (first-time guide) -->
|
|
<div class="welcome-overlay" id="welcomeOverlay">
|
|
<div class="welcome-card">
|
|
<div class="welcome-header">
|
|
<i class="bi bi-soundwave"></i>
|
|
<h2>Welcome to Audiobook Maker Pro</h2>
|
|
<p>Turn any document into an interactive audiobook in 3 simple steps</p>
|
|
</div>
|
|
<div class="welcome-steps">
|
|
<!-- Step 1 -->
|
|
<div class="welcome-step">
|
|
<div class="welcome-step-number">Step-1</div>
|
|
<div class="welcome-step-icon"><i class="bi bi-upload"></i></div>
|
|
<h4>Upload Document</h4>
|
|
<div class="welcome-step-details">
|
|
<p>Drag & drop a <strong>PDF</strong>, <strong>DOCX</strong>, or <strong>DOC</strong> file into the upload area</p>
|
|
<div class="welcome-step-alt">
|
|
<span class="welcome-alt-label">or</span>
|
|
<p>Click <span class="welcome-ui-btn"><i class="bi bi-pencil"></i> Start from scratch</span> to write your own content</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="welcome-step-arrow"><i class="bi bi-arrow-right"></i></div>
|
|
|
|
<!-- Step 2 -->
|
|
<div class="welcome-step">
|
|
<div class="welcome-step-number">Step-2</div>
|
|
<div class="welcome-step-icon"><i class="bi bi-soundwave"></i></div>
|
|
<h4>Edit & Generate Audio</h4>
|
|
<div class="welcome-step-details">
|
|
<p>Hover between blocks and click <span class="welcome-ui-dot chapter-dot"><i class="bi bi-bookmark-star"></i></span> to add chapter markers for multi-chapter books</p>
|
|
<p>Select a <strong>voice</strong> from the chapter dropdown, then click <span class="welcome-ui-btn success-btn"><i class="bi bi-play-fill"></i> Generate All</span></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="welcome-step-arrow"><i class="bi bi-arrow-right"></i></div>
|
|
|
|
<!-- Step 3 -->
|
|
<div class="welcome-step">
|
|
<div class="welcome-step-number">Step-3</div>
|
|
<div class="welcome-step-icon"><i class="bi bi-book"></i></div>
|
|
<h4>Read & Export</h4>
|
|
<div class="welcome-step-details">
|
|
<p>Switch to the <span class="welcome-ui-btn"><i class="bi bi-book"></i> Interactive Reader</span> tab to listen with word-by-word highlighting</p>
|
|
<p>Click <span class="welcome-ui-btn primary-btn"><i class="bi bi-download"></i> Export</span> in the header to download your audiobook as a ZIP</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="welcome-actions">
|
|
<button class="btn btn-primary btn-lg" onclick="dismissWelcome()">
|
|
<i class="bi bi-rocket-takeoff me-2"></i>Get Started
|
|
</button>
|
|
<label class="welcome-dismiss-label">
|
|
<input type="checkbox" id="welcomeDontShow"> Don't show this again
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ================================================
|
|
FLOATING GUIDE PANEL (Draggable)
|
|
================================================= -->
|
|
<div class="floating-guide-panel" id="floatingGuidePanel">
|
|
<!-- Drag Handle / Header -->
|
|
<div class="guide-panel-header" id="guidePanelHeader">
|
|
<div class="guide-panel-title">
|
|
<i class="bi bi-lightbulb"></i>
|
|
<span>Quick Guide</span>
|
|
</div>
|
|
<div class="guide-panel-controls">
|
|
<button class="guide-panel-btn" id="guidePanelCollapse" onclick="toggleGuideCollapse()" title="Collapse / Expand">
|
|
<i class="bi bi-chevron-up" id="guideCollapseIcon"></i>
|
|
</button>
|
|
<button class="guide-panel-btn" onclick="hideGuidePanel()" title="Hide guide panel">
|
|
<i class="bi bi-x-lg"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<!-- Panel Body -->
|
|
<div class="guide-panel-body" id="guidePanelBody">
|
|
<!-- Step 2: Edit & Generate -->
|
|
<div class="guide-section">
|
|
<div class="guide-section-badge">Step 2 — Edit & Generate</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">1</span>
|
|
<div class="guide-instruction-text">
|
|
Hover between blocks and click
|
|
<span class="guide-ui chapter-marker-ui" title="Add chapter marker"><i class="bi bi-bookmark-star-fill"></i></span>
|
|
to add <strong>chapter markers</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">2</span>
|
|
<div class="guide-instruction-text">
|
|
Select a <strong>voice</strong> from the chapter dropdown
|
|
<span class="guide-ui voice-dropdown-ui">
|
|
<i class="bi bi-mic-fill"></i> Voice <i class="bi bi-chevron-down" style="font-size:0.55rem;"></i>
|
|
</span>,
|
|
then click
|
|
<span class="guide-ui generate-btn-ui"><i class="bi bi-play-fill"></i> Generate All</span>
|
|
to create audio
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">3</span>
|
|
<div class="guide-instruction-text">
|
|
Click
|
|
<span class="guide-ui image-btn-ui"><i class="bi bi-image"></i></span>
|
|
between blocks to <strong>add an image</strong> (optional)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">4</span>
|
|
<div class="guide-instruction-text">
|
|
Click
|
|
<span class="guide-ui add-block-btn-ui"><i class="bi bi-plus"></i></span>
|
|
between blocks to <strong>add a new text block</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Step 3: Read & Export -->
|
|
<div class="guide-section">
|
|
<div class="guide-section-badge step3-badge">Step 3 — Read & Export</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">5</span>
|
|
<div class="guide-instruction-text">
|
|
Switch to the
|
|
<span class="guide-ui reader-tab-ui"><i class="bi bi-book"></i> Interactive Reader</span>
|
|
tab to <strong>listen</strong> with word-by-word highlighting
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-instruction">
|
|
<span class="guide-step-num">6</span>
|
|
<div class="guide-instruction-text">
|
|
Click
|
|
<span class="guide-ui export-btn-ui"><i class="bi bi-download"></i> Export</span>
|
|
in the header to <strong>download</strong> your audiobook as a ZIP
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Don't show option -->
|
|
<div class="guide-panel-footer">
|
|
<label class="guide-dont-show">
|
|
<input type="checkbox" id="guidePanelDontShow" onchange="handleGuideDontShow()">
|
|
Don't show this again
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Floating Guide Toggle Button (when panel is hidden) -->
|
|
<button class="floating-guide-toggle" id="floatingGuideToggle" onclick="showGuidePanel()" title="Show Quick Guide">
|
|
<i class="bi bi-lightbulb"></i>
|
|
</button>
|
|
|
|
|
|
<!-- Main Container -->
|
|
<div class="app-container">
|
|
<!-- Header -->
|
|
<header class="app-header">
|
|
<div class="header-left">
|
|
<h1 class="app-title">
|
|
<i class="bi bi-soundwave"></i>
|
|
Audiobook Maker Pro
|
|
<span class="version-badge">v4.0</span>
|
|
</h1>
|
|
</div>
|
|
<div class="header-right">
|
|
<div class="project-controls">
|
|
<input type="text" id="projectName" class="form-control project-name-input"
|
|
placeholder="Project Name" value="My Audiobook">
|
|
<button class="btn btn-success" id="saveProjectBtn" onclick="saveProject()" title="Save project (Ctrl+S)">
|
|
<i class="bi bi-save me-1"></i> Save
|
|
</button>
|
|
<button class="btn btn-primary" onclick="exportProject()" title="Export as ZIP with audio + reader">
|
|
<i class="bi bi-download me-1"></i> Export
|
|
</button>
|
|
<button class="btn btn-header-archive" onclick="openProjectArchive()" title="Load or manage saved projects">
|
|
<i class="bi bi-archive me-1"></i> Archive
|
|
</button>
|
|
<button class="btn btn-header-help" id="headerHelpBtn" onclick="handleHeaderHelp()" title="Show quick start guide">
|
|
<i class="bi bi-question-circle me-1"></i>
|
|
<span id="headerHelpLabel">Quick Start</span>
|
|
</button>
|
|
|
|
<!-- User Menu -->
|
|
<div class="dropdown">
|
|
<button class="btn btn-header-user dropdown-toggle" type="button"
|
|
data-bs-toggle="dropdown" aria-expanded="false" id="userMenuBtn">
|
|
<i class="bi bi-person-circle me-1"></i>
|
|
<span id="headerUsername">User</span>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
<li id="adminMenuItem" style="display:none;">
|
|
<a class="dropdown-item" href="/admin">
|
|
<i class="bi bi-shield-lock me-2"></i>Admin Dashboard
|
|
</a>
|
|
</li>
|
|
<li id="adminDivider" style="display:none;"><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<a class="dropdown-item" href="#" onclick="openChangePassword()">
|
|
<i class="bi bi-key me-2"></i>Change Password
|
|
</a>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<a class="dropdown-item text-danger" href="#" onclick="handleLogout()">
|
|
<i class="bi bi-box-arrow-right me-2"></i>Logout
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<!-- Workflow Progress Bar -->
|
|
<div class="workflow-progress" id="workflowProgress">
|
|
<div class="workflow-step active" id="wpStep1">
|
|
<div class="workflow-step-dot">1</div>
|
|
<span>Upload</span>
|
|
</div>
|
|
<div class="workflow-connector" id="wpConn1"></div>
|
|
<div class="workflow-step" id="wpStep2">
|
|
<div class="workflow-step-dot">2</div>
|
|
<span>Edit & Generate</span>
|
|
</div>
|
|
<div class="workflow-connector" id="wpConn2"></div>
|
|
<div class="workflow-step" id="wpStep3">
|
|
<div class="workflow-step-dot">3</div>
|
|
<span>Read & Export</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main Content Area -->
|
|
<main class="main-content">
|
|
<!-- Tab Navigation -->
|
|
<ul class="nav nav-tabs main-tabs" id="mainTabs" role="tablist">
|
|
<li class="nav-item">
|
|
<button class="nav-link active" id="editor-tab" data-bs-toggle="tab"
|
|
data-bs-target="#editorPanel" type="button">
|
|
<i class="bi bi-pencil-square me-1"></i> Audiobook Maker Editor
|
|
</button>
|
|
</li>
|
|
<li class="nav-item">
|
|
<button class="nav-link" id="reader-tab" data-bs-toggle="tab"
|
|
data-bs-target="#readerPanel" type="button">
|
|
<i class="bi bi-book me-1"></i> Interactive Reader
|
|
<span class="reader-tab-badge" id="readerTabBadge" style="display:none;">
|
|
Ready
|
|
</span>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
|
|
<!-- Tab Content -->
|
|
<div class="tab-content" id="mainTabContent">
|
|
<!-- Editor Panel -->
|
|
<div class="tab-pane fade show active" id="editorPanel" role="tabpanel">
|
|
|
|
<!-- Upload Section: Two-Pathway Layout -->
|
|
<div class="upload-section" id="uploadSection">
|
|
<div class="upload-zone-wrapper">
|
|
|
|
<!-- Option A: Upload a Document -->
|
|
<div class="upload-zone" id="uploadZone">
|
|
<input type="file" id="docInput" accept=".pdf,.doc,.docx" hidden>
|
|
<div class="upload-content">
|
|
<i class="bi bi-file-earmark-arrow-up upload-icon"></i>
|
|
<h4>Upload Document</h4>
|
|
<p class="text-muted mb-3">
|
|
Drag & drop a file here, or click the button below to browse
|
|
</p>
|
|
<div class="d-flex gap-2 justify-content-center flex-wrap mb-3">
|
|
<span class="badge bg-danger bg-opacity-10 text-danger px-3 py-2">
|
|
<i class="bi bi-file-earmark-pdf me-1"></i>PDF
|
|
</span>
|
|
<span class="badge bg-primary bg-opacity-10 text-primary px-3 py-2">
|
|
<i class="bi bi-file-earmark-word me-1"></i>DOCX
|
|
</span>
|
|
<span class="badge bg-info bg-opacity-10 text-info px-3 py-2">
|
|
<i class="bi bi-file-earmark-word me-1"></i>DOC
|
|
</span>
|
|
</div>
|
|
<button class="btn btn-primary btn-lg" onclick="event.stopPropagation(); document.getElementById('docInput').click()">
|
|
<i class="bi bi-upload me-2"></i>Choose File
|
|
</button>
|
|
<p class="upload-hint-text">
|
|
<i class="bi bi-info-circle me-1"></i>
|
|
Your document will be split into editable blocks automatically
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Vertical "or" Divider -->
|
|
<div class="pathway-divider">
|
|
<span>or</span>
|
|
</div>
|
|
|
|
<!-- Option B: Start from Scratch -->
|
|
<div class="scratch-zone" id="scratchZone" onclick="startFromScratch()">
|
|
<div class="scratch-content">
|
|
<i class="bi bi-pencil-square scratch-icon"></i>
|
|
<h4>Start from Scratch</h4>
|
|
<p class="text-muted mb-3">
|
|
Write or paste your own content directly into the editor
|
|
</p>
|
|
<button class="btn btn-outline-primary btn-lg" onclick="event.stopPropagation(); startFromScratch()">
|
|
<i class="bi bi-pencil me-2"></i>Start Writing
|
|
</button>
|
|
<p class="upload-hint-text">
|
|
<i class="bi bi-info-circle me-1"></i>
|
|
Add chapters, format text, and insert images manually
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Editor Section: Hidden by default -->
|
|
<div class="editor-section" id="editorSection" style="display:none">
|
|
<div class="editor-container" id="markdownEditor">
|
|
<div class="empty-editor-message" id="emptyEditorMessage">
|
|
<i class="bi bi-file-text"></i>
|
|
<p>Upload a document or start typing to create content</p>
|
|
<p class="text-muted small">Click anywhere to add a new block</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Reader Panel -->
|
|
<div class="tab-pane fade" id="readerPanel" role="tabpanel">
|
|
<div class="reader-container" id="readerContainer">
|
|
<div class="reader-empty-state">
|
|
<i class="bi bi-book"></i>
|
|
<p>Generate audio to view the interactive reader</p>
|
|
<p class="text-muted">Go to the Editor tab, then click <strong>"Generate All"</strong> on a chapter</p>
|
|
<button class="btn btn-primary mt-3" onclick="switchToEditorTab()">
|
|
<i class="bi bi-arrow-left me-1"></i> Go to Editor
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- Project Archive Modal -->
|
|
<div class="modal fade" id="archiveModal" tabindex="-1">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">
|
|
<i class="bi bi-archive me-2"></i>Project Archive
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="projectList"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- TTS Edit Modal -->
|
|
<div class="modal fade" id="ttsEditModal" tabindex="-1">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">
|
|
<i class="bi bi-mic me-2"></i>Edit Text for TTS Generation
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p class="text-muted small mb-2">
|
|
<i class="bi bi-info-circle me-1"></i>
|
|
This text will be used for audio generation. The original markdown content will be preserved.
|
|
</p>
|
|
<textarea id="ttsTextInput" class="form-control" rows="8"></textarea>
|
|
<input type="hidden" id="ttsBlockId">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-primary" onclick="saveTtsText()">
|
|
<i class="bi bi-check-lg me-1"></i>Save
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Change Password Modal -->
|
|
<div class="modal fade" id="changePasswordModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">
|
|
<i class="bi bi-key me-2"></i>Change Password
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label for="currentPassword" class="form-label">Current Password</label>
|
|
<input type="password" class="form-control" id="currentPassword" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="newPassword" class="form-label">New Password</label>
|
|
<input type="password" class="form-control" id="newPassword" required minlength="4">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="confirmPassword" class="form-label">Confirm New Password</label>
|
|
<input type="password" class="form-control" id="confirmPassword" required>
|
|
</div>
|
|
<div class="alert alert-danger" id="changePasswordError" style="display:none;"></div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-primary" onclick="submitChangePassword()">
|
|
<i class="bi bi-check-lg me-1"></i>Change Password
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Scripts -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
<script src="/static/js/app.js"></script>
|
|
<script src="/static/js/markdown-editor.js"></script>
|
|
<script src="/static/js/pdf-handler.js"></script>
|
|
<script src="/static/js/generation.js"></script>
|
|
<script src="/static/js/interactive-reader.js"></script>
|
|
</body>
|
|
</html>
|