-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
153 lines (141 loc) · 8.92 KB
/
index.html
File metadata and controls
153 lines (141 loc) · 8.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown Reader</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css" id="hljs-light">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" id="hljs-dark" disabled>
</head>
<body>
<a href="#main-content" class="skip-link">Skip to content</a>
<header class="toolbar" role="banner">
<div class="toolbar-left">
<h1 class="app-title">Markdown Reader</h1>
</div>
<div class="toolbar-center">
<span class="file-name" id="file-name" aria-live="polite">No file open</span>
</div>
<div class="toolbar-right">
<button type="button" class="btn btn-open" id="open-btn" aria-label="Open a Markdown file">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="12" y1="18" x2="12" y2="12"/>
<line x1="9" y1="15" x2="15" y2="15"/>
</svg>
Open File
</button>
<input type="file" id="file-input" accept=".md,.markdown,.mdown,.mkdn,.mkd,.txt" class="visually-hidden" aria-label="Select a Markdown file to open">
<div class="history-wrapper">
<button type="button" class="btn btn-history" id="history-btn" aria-expanded="false" aria-haspopup="true" aria-label="Recent files">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
Recent
</button>
<div class="history-dropdown" id="history-dropdown" role="menu" aria-label="Recently opened files" hidden>
<div class="history-header">
<span class="history-title">Recently Opened</span>
<button type="button" class="history-clear" id="history-clear" aria-label="Clear reading history">Clear</button>
</div>
<ul class="history-list" id="history-list" role="list">
</ul>
<p class="history-empty" id="history-empty" hidden>No recent files</p>
</div>
</div>
<div class="align-controls" role="group" aria-label="Content position">
<button type="button" class="btn btn-icon align-btn active" id="align-left" aria-label="Align content left" aria-pressed="true">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<line x1="3" y1="6" x2="16" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="18" y2="18"/>
</svg>
</button>
<button type="button" class="btn btn-icon align-btn" id="align-center" aria-label="Align content center" aria-pressed="false">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<line x1="4" y1="6" x2="20" y2="6"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="5" y1="18" x2="19" y2="18"/>
</svg>
</button>
<button type="button" class="btn btn-icon align-btn" id="align-right" aria-label="Align content right" aria-pressed="false">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<line x1="8" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="6" y1="18" x2="21" y2="18"/>
</svg>
</button>
</div>
<div class="font-size-controls" role="group" aria-label="Font size">
<button type="button" class="btn btn-icon" id="font-decrease" aria-label="Decrease font size">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button>
<span class="font-size-label" id="font-size-label" aria-live="polite">18px</span>
<button type="button" class="btn btn-icon" id="font-increase" aria-label="Increase font size">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button>
</div>
<button type="button" class="btn btn-icon" id="theme-toggle" aria-label="Toggle dark mode">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="icon-sun">
<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
</svg>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="icon-moon">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
</svg>
</button>
</div>
</header>
<main id="main-content">
<aside class="toc-sidebar" id="toc-sidebar" aria-label="Table of contents" hidden>
<nav class="toc-nav">
<div class="toc-header">
<span class="toc-title">Contents</span>
<button type="button" class="toc-close btn btn-icon" id="toc-close" aria-label="Close table of contents">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
<ul class="toc-list" id="toc-list" role="list"></ul>
</nav>
</aside>
<button type="button" class="toc-toggle" id="toc-toggle" aria-label="Toggle table of contents" hidden>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="3" y1="6" x2="15" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="18" y2="18"/>
</svg>
</button>
<div class="drop-zone" id="drop-zone" role="region" aria-label="File drop area">
<div class="welcome" id="welcome">
<div class="welcome-icon" aria-hidden="true">
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
<polyline points="10 9 9 9 8 9"/>
</svg>
</div>
<h2>Open a Markdown file to start reading</h2>
<p>Click <strong>Open File</strong> above or drag and drop a <code>.md</code> file here.</p>
<p class="hint">Supports .md, .markdown, and .txt files</p>
</div>
<article class="reader-content prose" id="reader-content" role="document" aria-label="Markdown content" tabindex="-1" hidden>
</article>
</div>
<div class="drop-overlay" id="drop-overlay" aria-hidden="true">
<div class="drop-overlay-content">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
<p>Drop your Markdown file here</p>
</div>
</div>
</main>
<div class="progress-bar" id="progress-bar" role="progressbar" aria-label="Reading progress" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<div class="progress-fill" id="progress-fill"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.1/marked.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.9/purify.min.js"></script>
<script src="app.js"></script>
</body>
</html>