Spaces:
Running
Running
Download index.html from DrZesh/typsetting: direct link, hf CLI and curl.
- Browser
- Download file 22.1 kB
-
https://huggingface.co/spaces/DrZesh/typsetting/resolve/main/index.html
- Command line
-
hf download hf://spaces/DrZesh/typsetting/index.html
-
curl -L -o index.html https://huggingface.co/spaces/DrZesh/typsetting/resolve/main/index.html
22.1 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>BookSmith - Professional Typesetting</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.0/mammoth.browser.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/docx/7.1.0/docx.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js"></script> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Serif+Pro:wght@400;600;700&display=swap'); | |
| .book-preview { | |
| box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); | |
| transform: scale(0.9); | |
| transition: transform 0.2s ease; | |
| } | |
| .book-preview:hover { | |
| transform: scale(0.92); | |
| } | |
| .page-spread { | |
| perspective: 1500px; | |
| } | |
| .page { | |
| transform-style: preserve-3d; | |
| transform: rotateY(-5deg); | |
| box-shadow: -15px 0 30px -10px rgba(0, 0, 0, 0.2); | |
| background: linear-gradient(to right, #f9f9f9, white 5%, white 95%, #f9f9f9); | |
| } | |
| .page + .page { | |
| transform: rotateY(5deg); | |
| box-shadow: 15px 0 30px -10px rgba(0, 0, 0, 0.2); | |
| } | |
| .custom-scrollbar::-webkit-scrollbar { | |
| width: 6px; | |
| height: 6px; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-track { | |
| background: #f1f1f1; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-thumb { | |
| background: #888; | |
| border-radius: 3px; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-thumb:hover { | |
| background: #555; | |
| } | |
| [contenteditable] { | |
| outline: none; | |
| } | |
| .dropzone { | |
| border: 2px dashed #ccc; | |
| transition: all 0.3s; | |
| } | |
| .dropzone.active { | |
| border-color: #10b981; | |
| background-color: #f0fdf4; | |
| } | |
| .loading-spinner { | |
| display: none; | |
| } | |
| .loading .loading-spinner { | |
| display: block; | |
| } | |
| .loading .loading-text { | |
| display: none; | |
| } | |
| .font-preview { | |
| font-family: var(--font-family); | |
| } | |
| .multi-page-container { | |
| display: flex; | |
| overflow-x: auto; | |
| scroll-behavior: smooth; | |
| scroll-snap-type: x mandatory; | |
| gap: 20px; | |
| padding: 20px 0; | |
| } | |
| .multi-page-container::-webkit-scrollbar { | |
| display: none; | |
| } | |
| .page-group { | |
| display: flex; | |
| scroll-snap-align: start; | |
| flex-shrink: 0; | |
| } | |
| .navigation-arrows { | |
| position: absolute; | |
| top: 50%; | |
| width: 100%; | |
| display: flex; | |
| justify-content: space-between; | |
| pointer-events: none; | |
| } | |
| .nav-arrow { | |
| pointer-events: all; | |
| background: rgba(255, 255, 255, 0.8); | |
| border-radius: 50%; | |
| width: 40px; | |
| height: 40px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); | |
| cursor: pointer; | |
| transition: all 0.2s; | |
| } | |
| .nav-arrow:hover { | |
| background: white; | |
| transform: scale(1.1); | |
| } | |
| .nav-arrow.left { | |
| margin-left: 20px; | |
| } | |
| .nav-arrow.right { | |
| margin-right: 20px; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <div class="flex h-screen overflow-hidden"> | |
| <!-- Sidebar --> | |
| <div class="w-64 bg-white border-r border-gray-200 flex flex-col"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <h1 class="text-xl font-bold text-emerald-600 flex items-center"> | |
| <i class="fas fa-book-open mr-2"></i> BookSmith | |
| </h1> | |
| <p class="text-xs text-gray-500 mt-1">Professional Typesetting</p> | |
| </div> | |
| <div class="flex-1 overflow-y-auto custom-scrollbar p-4"> | |
| <div class="mb-6"> | |
| <h2 class="text-xs uppercase font-semibold text-gray-500 mb-2">Project</h2> | |
| <div class="space-y-1"> | |
| <button id="importBtn" class="w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center"> | |
| <i class="fas fa-file-import mr-2"></i> Import Manuscript | |
| </button> | |
| <button class="w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center"> | |
| <i class="fas fa-save mr-2"></i> Save Project | |
| </button> | |
| <button id="exportMenuBtn" class="w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center justify-between"> | |
| <span><i class="fas fa-file-export mr-2"></i> Export Book</span> | |
| <i class="fas fa-chevron-down text-xs"></i> | |
| </button> | |
| <div id="exportMenu" class="hidden ml-4 mt-1 space-y-1"> | |
| <button id="exportPdfBtn" class="w-full text-left px-3 py-1 rounded hover:bg-gray-100 flex items-center text-sm"> | |
| <i class="fas fa-file-pdf mr-2"></i> PDF | |
| </button> | |
| <button id="exportWordBtn" class="w-full text-left px-3 py-1 rounded hover:bg-gray-100 flex items-center text-sm"> | |
| <i class="fas fa-file-word mr-2"></i> Microsoft Word | |
| </button> | |
| <button id="exportEpubBtn" class="w-full text-left px-3 py-1 rounded hover:bg-gray-100 flex items-center text-sm"> | |
| <i class="fas fa-book-open mr-2"></i> EPUB | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <h2 class="text-xs uppercase font-semibold text-gray-500 mb-2">Navigation</h2> | |
| <div class="space-y-1"> | |
| <button class="nav-btn w-full text-left px-3 py-2 rounded bg-gray-100 font-medium flex items-center" data-section="typography"> | |
| <i class="fas fa-font mr-2"></i> Typography | |
| </button> | |
| <button class="nav-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-section="layout"> | |
| <i class="fas fa-layer-group mr-2"></i> Layout | |
| </button> | |
| <button class="nav-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-section="advanced"> | |
| <i class="fas fa-magic mr-2"></i> Advanced | |
| </button> | |
| <button class="nav-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-section="preview"> | |
| <i class="fas fa-eye mr-2"></i> Preview | |
| </button> | |
| </div> | |
| </div> | |
| <div> | |
| <h2 class="text-xs uppercase font-semibold text-gray-500 mb-2">Document</h2> | |
| <div id="chapterList" class="space-y-1"> | |
| <button class="chapter-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-chapter="1"> | |
| <i class="fas fa-file-alt mr-2"></i> Chapter 1 | |
| </button> | |
| <button class="chapter-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-chapter="2"> | |
| <i class="fas fa-file-alt mr-2"></i> Chapter 2 | |
| </button> | |
| <button class="chapter-btn w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center" data-chapter="3"> | |
| <i class="fas fa-file-alt mr-2"></i> Chapter 3 | |
| </button> | |
| <button class="w-full text-left px-3 py-2 rounded hover:bg-gray-100 flex items-center text-gray-400"> | |
| <i class="fas fa-plus mr-2"></i> Add Chapter | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4 border-t border-gray-200"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 rounded-full bg-emerald-100 text-emerald-600 flex items-center justify-center"> | |
| <i class="fas fa-user"></i> | |
| </div> | |
| <div class="ml-2"> | |
| <p class="text-sm font-medium">John Doe</p> | |
| <p class="text-xs text-gray-500">Author</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="flex-1 flex flex-col overflow-hidden"> | |
| <!-- Toolbar --> | |
| <div class="bg-white border-b border-gray-200 p-3 flex items-center justify-between"> | |
| <div class="flex items-center space-x-4"> | |
| <div class="flex items-center space-x-2"> | |
| <span class="text-sm text-gray-600">Book Size:</span> | |
| <select id="bookSize" class="text-sm border border-gray-300 rounded px-2 py-1 bg-white"> | |
| <option>5" × 8"</option> | |
| <option>6" × 9"</option> | |
| <option selected>A5</option> | |
| <option>Custom...</option> | |
| </select> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <span class="text-sm text-gray-600">Orientation:</span> | |
| <div class="flex bg-gray-100 rounded p-1"> | |
| <button id="portraitBtn" class="p-1 rounded bg-white shadow hover:bg-gray-200"> | |
| <i class="fas fa-portrait"></i> | |
| </button> | |
| <button id="landscapeBtn" class="p-1 rounded hover:bg-gray-200"> | |
| <i class="fas fa-landscape"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <span class="text-sm text-gray-600">View:</span> | |
| <div class="flex bg-gray-100 rounded p-1"> | |
| <button id="singlePageBtn" class="p-1 rounded hover:bg-gray-200"> | |
| <i class="fas fa-file"></i> | |
| </button> | |
| <button id="spreadBtn" class="p-1 rounded bg-white shadow hover:bg-gray-200"> | |
| <i class="fas fa-book-open"></i> | |
| </button> | |
| <button id="multiPageBtn" class="p-1 rounded hover:bg-gray-200"> | |
| <i class="fas fa-copy"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <button id="quickExportPdfBtn" class="px-3 py-1 bg-emerald-600 text-white rounded hover:bg-emerald-700 flex items-center"> | |
| <i class="fas fa-file-pdf mr-2"></i> Export PDF | |
| </button> | |
| <button id="quickExportWordBtn" class="px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 flex items-center"> | |
| <i class="fas fa-file-word mr-2"></i> Export Word | |
| </button> | |
| <button id="quickExportEpubBtn" class="px-3 py-1 bg-purple-600 text-white rounded hover:bg-purple-700 flex items-center"> | |
| <i class="fas fa-book-open mr-2"></i> Export EPUB | |
| </button> | |
| <button class="w-8 h-8 rounded-full border border-gray-300 hover:bg-gray-100 flex items-center justify-center"> | |
| <i class="fas fa-cog"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Content Area --> | |
| <div class="flex-1 flex overflow-hidden"> | |
| <!-- Settings Panel --> | |
| <div id="typographyPanel" class="settings-panel w-80 bg-white border-r border-gray-200 overflow-y-auto custom-scrollbar p-4"> | |
| <h2 class="text-lg font-semibold mb-4 flex items-center"> | |
| <i class="fas fa-font mr-2 text-emerald-600"></i> Typography | |
| </h2> | |
| <div class="space-y-6"> | |
| <div> | |
| <h3 class="text-sm font-medium mb-2">Font Family</h3> | |
| <div class="grid grid-cols-2 gap-2"> | |
| <button class="font-btn border border-gray-300 rounded p-2 hover:border-emerald-400 hover:bg-emerald-50" data-font="Libre Baskerville" data-font-type="serif"> | |
| <p class="text-sm" style="font-family: 'Libre Baskerville'">Libre Baskerville</p> | |
| <p class="text-xs text-gray-500">Classic serif</p> | |
| </button> | |
| <button class="font-btn border border-gray-300 rounded p-2 hover:border-emerald-400 hover:bg-emerald-50" data-font="Arial" data-font-type="sans"> | |
| <p class="text-sm" style="font-family: Arial">Arial</p> | |
| <p class="text-xs text-gray-500">Modern sans</p> | |
| </button> | |
| <button class="font-btn border border-emerald-400 rounded p-2 bg-emerald-50" data-font="Times New Roman" data-font-type="serif"> | |
| <p class="text-sm" style="font-family: 'Times New Roman'">Times New Roman</p> | |
| <p class="text-xs text-gray-500">Traditional</p> | |
| </button> | |
| <button class="font-btn border border-gray-300 rounded p-2 hover:border-emerald-400 hover:bg-emerald-50" data-font="Source Serif Pro" data-font-type="serif"> | |
| <p class="text-sm" style="font-family: 'Source Serif Pro'">Source Serif Pro</p> | |
| <p class="text-xs text-gray-500">Elegant serif</p> | |
| </button> | |
| </div> | |
| </div> | |
| <div> | |
| <h3 class="text-sm font-medium mb-2">Text Sizing</h3> | |
| <div class="space-y-3"> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">Font Size</label> | |
| <div class="flex items-center space-x-2"> | |
| <input type="range" min="8" max="14" value="11" class="w-full"> | |
| <span class="text-xs w-8 text-right">11pt</span> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">Line Height</label> | |
| <div class="flex items-center space-x-2"> | |
| <input type="range" min="1", max="2" step="0.1" value="1.4" class="w-full"> | |
| <span class="text-xs w-8 text-right">1.4</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <h3 class="text-sm font-medium mb-2">Paragraph Settings</h3> | |
| <div class="space-y-3"> | |
| <div class="flex space-x-1"> | |
| <button class="align-btn p-2 border border-gray-300 rounded hover:bg-gray-100" data-align="left"> | |
| <i class="fas fa-align-left"></i> | |
| </button> | |
| <button class="align-btn p-2 border border-gray-300 rounded hover:bg-gray-100" data-align="center"> | |
| <i class="fas fa-align-center"></i> | |
| </button> | |
| <button class="align-btn p-2 border border-gray-300 rounded bg-gray-100" data-align="justify"> | |
| <i class="fas fa-align-justify"></i> | |
| </button> | |
| <button class="align-btn p-2 border border-gray-300 rounded hover:bg-gray-100" data-align="right"> | |
| <i class="fas fa-align-right"></i> | |
| </button> | |
| </div> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">First Line Indent</label> | |
| <div class="flex items-center space-x-2"> | |
| <input type="range" min="0", max="4" step="0.5" value="1.5" class="w-24"> | |
| <span class="text-xs">1.5em</span> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">Paragraph Spacing</label> | |
| <div class="flex items-center space-x-2"> | |
| <input type="range" min="0", max="2" step="0.1" value="0.8", class="w-24"> | |
| <span class="text-xs">0.8em</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <h3 class="text-sm font-medium mb-2">Headers</h3> | |
| <div class="space-y-3"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">Chapter Title</label> | |
| <select class="text-sm border border-gray-300 rounded px-2 py-1 bg-white"> | |
| <option>Century Schoolbook</option> | |
| <option selected>Times New Roman</option> | |
| <option>Garamond</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="text-xs text-gray-500 block mb-1">Size</label> | |
| <select class="text-sm border border-gray-300 rounded px-2 py-1 bg-white"> | |
| <option>18pt</option> | |
| <option selected>20pt</option> | |
| <option>22pt</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <button class="p-2 border border-gray-300 rounded hover:bg-gray-100"> | |
| <i class="fas fa-arrow-up"></i> | |
| </button> | |
| <button class="p-2 border border-gray-300 rounded hover:bg-gray-100"> | |
| <i class="fas fa-arrow-down"></i> | |
| </button> | |
| <span class="text-xs text-gray-500">Space before: 3em</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Layout Panel (hidden by default) --> | |
| <div id="layoutPanel" class="settings-panel w-80 bg-white border-r border-gray-200 overflow-y-auto custom-scrollbar p-4 hidden"> | |
| <h2 class="text-lg font-semibold mb-4 flex items-center"> | |
| <i class="fas fa-layer-group mr-2 text-emerald-600"></i> Layout | |
| </h | |
| </html> |