Files
ReaderJS/index.html
T

190 lines
8.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ReaderJS — Universal Document Viewer</title>
<link rel="stylesheet" href="/src/style.css" />
<!-- WebODF is loaded on-demand by odf-renderer.js when an ODF file is opened -->
</head>
<body>
<div id="outerContainer">
<!-- Sidebar: thumbnails + outline -->
<div id="sidebarContainer">
<div id="sidebarToolbar">
<button id="thumbsBtn" class="sidebar-tab active" title="Page Thumbnails">
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
<rect x="2" y="2" width="9" height="9" rx="1"/>
<rect x="13" y="2" width="9" height="9" rx="1"/>
<rect x="2" y="13" width="9" height="9" rx="1"/>
<rect x="13" y="13" width="9" height="9" rx="1"/>
</svg>
</button>
<button id="outlineBtn" class="sidebar-tab" title="Document Outline">
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
<line x1="3" y1="6" x2="21" y2="6" stroke="currentColor" stroke-width="2"/>
<line x1="6" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2"/>
<line x1="6" y1="14" x2="21" y2="14" stroke="currentColor" stroke-width="2"/>
<line x1="3" y1="18" x2="21" y2="18" stroke="currentColor" stroke-width="2"/>
</svg>
</button>
</div>
<div id="sidebarContent">
<div id="thumbsContent"></div>
<div id="outlineContent" class="hidden"></div>
</div>
</div>
<!-- Main content -->
<div id="mainContainer">
<!-- Top toolbar -->
<div id="toolbarContainer">
<div id="toolbarLeft">
<button id="sidebarToggle" class="toolbar-btn" title="Toggle Sidebar">
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
<rect x="3" y="5" width="18" height="2"/>
<rect x="3" y="11" width="18" height="2"/>
<rect x="3" y="17" width="18" height="2"/>
</svg>
</button>
<div class="toolbar-separator"></div>
<button id="prevPage" class="toolbar-btn" title="Previous Page (←)" disabled>
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
</svg>
</button>
<div id="pageNumberGroup">
<input id="pageNumber" type="number" value="1" min="1" max="1" title="Current Page" />
<span class="page-sep">/</span>
<span id="totalPages">—</span>
</div>
<button id="nextPage" class="toolbar-btn" title="Next Page (→)" disabled>
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
</svg>
</button>
</div>
<div id="toolbarMiddle">
<button id="zoomOut" class="toolbar-btn" title="Zoom Out (Ctrl -)">
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
<path d="M7 9h5v1H7z"/>
</svg>
</button>
<select id="scaleSelect" title="Zoom">
<option value="auto">Auto</option>
<option value="page-fit">Page Fit</option>
<option value="page-width">Page Width</option>
<option value="0.5">50%</option>
<option value="0.75">75%</option>
<option value="1" selected>100%</option>
<option value="1.25">125%</option>
<option value="1.5">150%</option>
<option value="2">200%</option>
<option value="3">300%</option>
</select>
<button id="zoomIn" class="toolbar-btn" title="Zoom In (Ctrl +)">
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
<path d="M10 7H8v2H6v2h2v2h2v-2h2V9h-2z"/>
</svg>
</button>
</div>
<div id="toolbarRight">
<span id="formatBadge" class="hidden"></span>
<div class="toolbar-separator"></div>
<button id="printBtn" class="toolbar-btn" title="Print (Ctrl+P)">
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
<path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/>
</svg>
</button>
<label class="toolbar-btn" for="fileInput" title="Open File">
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
<path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"/>
</svg>
</label>
<input id="fileInput" type="file"
accept=".pdf,.odt,.ods,.odp,.odg,.odm,.odf,.rtf,.doc,.docx"
aria-label="Open document file" />
</div>
</div>
<!-- Loading bar -->
<div id="loadingBar" class="hidden">
<div id="loadingBarProgress"></div>
</div>
<!-- Error bar -->
<div id="errorBar" class="hidden" role="alert">
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="flex-shrink:0">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
</svg>
<span id="errorMsg"></span>
<button id="errorClose" aria-label="Dismiss">✕</button>
</div>
<!-- Viewer -->
<div id="viewerContainer">
<!-- Drop zone (shown when no file loaded) -->
<div id="dropzone">
<div id="dropzoneContent">
<div id="dropzoneIcon">
<svg viewBox="0 0 80 80" width="80" height="80" fill="none">
<rect x="10" y="5" width="45" height="60" rx="4" fill="#5a5a5a"/>
<rect x="14" y="12" width="37" height="3" rx="1.5" fill="#7a7a7a"/>
<rect x="14" y="19" width="30" height="3" rx="1.5" fill="#7a7a7a"/>
<rect x="14" y="26" width="34" height="3" rx="1.5" fill="#7a7a7a"/>
<rect x="14" y="33" width="20" height="3" rx="1.5" fill="#7a7a7a"/>
<circle cx="56" cy="56" r="20" fill="#474747"/>
<path d="M49 56l7 7 7-7M56 49v14" stroke="#90caf9" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<h2>Open a Document</h2>
<p>Drop a file here, or <label for="fileInput">browse</label></p>
<div class="format-tags">
<span class="format-tag tag-pdf">PDF</span>
<span class="format-tag tag-odf">ODT</span>
<span class="format-tag tag-odf">ODS</span>
<span class="format-tag tag-odf">ODP</span>
<span class="format-tag tag-rtf">RTF</span>
<span class="format-tag tag-doc">DOC</span>
<span class="format-tag tag-docx">DOCX</span>
</div>
<div class="powered-by">
Powered by
<a href="https://github.com/mozilla/pdf.js" target="_blank" rel="noopener">PDF.js</a>
· <a href="https://github.com/Alpaq92/JSDoc" target="_blank" rel="noopener">JSDoc</a>
· <a href="https://github.com/tbluemel/rtf.js" target="_blank" rel="noopener">RTF.js</a>
· <a href="https://github.com/mwilliamson/mammoth.js" target="_blank" rel="noopener">mammoth.js</a>
</div>
</div>
</div>
<!-- Document render target -->
<div id="docContainer" class="hidden"></div>
</div><!-- /viewerContainer -->
</div><!-- /mainContainer -->
</div><!-- /outerContainer -->
<!-- Print layer: populated by PDF renderer before window.print() -->
<div id="printLayer" aria-hidden="true"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>