-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
414 lines (400 loc) · 13.8 KB
/
index.html
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="google" content="notranslate" />
<title>PrivatePDF - edit PDFs in the browser</title>
<style>
:root {
--toolbar-height: 65px;
}
body {
background-color: #87898b;
margin: 0;
padding: 0;
font-family: sans-serif;
}
#flex-container {
display: flex;
}
#toolbar-inner {
padding: 10px;
display: flex;
align-items: center;
}
#pages {
display: flex;
min-width: 210px;
max-height: calc(100vh - var(--toolbar-height) - 30px);
overflow-y: auto;
flex-direction: column;
align-items: center;
padding: 15px 0;
}
#content {
max-height: calc(100vh - var(--toolbar-height));
overflow-y: auto;
display: flex;
width: 100%;
}
#pages .thumbnail-list-label {
text-align: center;
padding-top: 10px;
line-height: 1;
}
#pages .thumbnail-list-container {
padding: 25px 25px 12px;
align-items: center;
display: flex;
flex-direction: column;
}
.thumbnail-list-container-selected {
background-color: #74bff5c7;
border-radius: 10px;
}
#pageContainer {
margin-left: auto;
margin-right: auto;
}
#pageContainer .page:first-child {
margin-top: 25px;
}
#pageContainer .page:last-child {
margin-bottom: 25px;
}
#pageContainer .page:not(:first-child) {
margin-top: 50px;
}
#overlayContainer {
position: absolute;
top: 0;
left: 0;
z-index: 100;
}
#content-inner {
position: relative;
margin-left: auto;
margin-right: auto;
}
#content .draggable {
position: absolute;
}
#overlayContainer input[type="number"]::-webkit-inner-spin-button,
#overlayContainer input[type="number"]::-webkit-outer-spin-button {
opacity: 1;
}
#overlayContainer input {
font-size: 13px;
font-family: Helvetica;
}
#overlayContainer input[type="text"] {
padding: 0px;
margin: 0px;
border-radius: 5px;
}
#overlayContainer .text-options input[type="number"] {
width: 36px;
border-radius: 5px;
border: 1px solid #ccc;
}
#overlayContainer .draggable {
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 17px;
}
#overlayContainer .draggable.focused {
background-color: #74bff5;
}
#overlayContainer .draggable.unfocused {
background-color: transparent;
}
#overlayContainer .draggable.focused .text-options {
display: flex;
}
#overlayContainer .draggable.unfocused .text-options {
display: none;
}
#overlayContainer .draggable.unfocused input[type="text"] {
background-color: lightyellow;
border: 1px #e2e2ce7d solid;
}
#overlayContainer .draggable.focused input[type="text"] {
background-color: white;
border: 1px solid #ccc;
}
#overlayContainer .draggable input[type="color"] {
background: #fff;
width: 24px;
border-radius: 5px;
height: 24px;
border: 1px solid #ccc;
}
#overlayContainer .img-container {
display: flex;
align-items: center;
}
#overlayContainer .options-delete {
cursor: pointer;
background: url("img/icon_delete.png");
width: 20px;
height: 20px;
padding: 0;
margin: 0;
border: 0;
}
#overlayContainer .drag-handle {
cursor: move;
}
#pages .thumbnail-list-canvas {
max-width: 96px;
}
#toolbar input[type="file"] label {
background-color: indigo;
color: white;
padding: 0.5rem;
font-family: sans-serif;
border-radius: 0.3rem;
cursor: pointer;
margin-top: 1rem;
}
#toolbar .separator {
width: 20px;
display: inline-block;
}
#toolbar button {
margin: 0 4px 0 1px;
border: 1px solid #ccc;
background: none;
cursor: pointer;
padding: 2px 4px;
border-radius: 5px;
}
#toolbar button:disabled,
#toolbar input[type="text"]:disabled {
opacity: 50%;
cursor: default;
}
#toolbar button image {
vertical-align: middle;
}
.draggable .separator {
width: 10px;
display: inline-block;
}
#nav-bar #current-page {
width: 25px;
border-radius: 5px;
background: none;
border: 1px solid #ccc;
margin-right: 5px;
}
#nav-bar #total-pages {
margin: 0 5px;
}
#nav-bar {
display: flex;
flex-direction: row;
align-items: center;
}
#empty-state {
display: flex;
align-items: center;
justify-content: center;
}
#empty-state-inner {
background: #f9f9f9;
padding: 15px;
border-radius: 15px;
}
#top-bar {
display: flex;
justify-content: space-between;
height: var(--toolbar-height);
background-color: #f9f9f9;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.1);
z-index: 10;
position: relative;
}
#socials {
display: flex;
align-items: center;
flex-direction: row;
padding: 10px;
}
#socials a {
padding: 5px;
}
#socials a img {
display: block;
}
</style>
<link rel="stylesheet" href="dist/pdf_viewer.css" />
</head>
<body>
<div id="top-bar">
<div id="toolbar">
<div id="toolbar-inner">
<input
type="file"
accept=".pdf"
id="pdf-file-input"
name="pdf_file"
hidden
/>
<button
id="pdf-file"
onclick="document.getElementById('pdf-file-input').click()"
title="Choose a PDF file"
>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M463.897-250.051h33.847v-198.128l89.333 89.846 24.103-24.18L480-512.564 349.641-381.692l23.667 23.59 90.589-90.077v198.128ZM258.461-120q-24.577 0-41.519-16.942Q200-153.884 200-178.461v-603.078q0-24.577 16.942-41.519Q233.884-840 258.461-840h327.847L760-666.308v487.847q0 24.577-16.942 41.519Q726.116-120 701.539-120H258.461Zm310.924-530.359v-155.795H258.461q-9.231 0-16.923 7.692-7.692 7.692-7.692 16.923v603.078q0 9.231 7.692 16.923 7.692 7.692 16.923 7.692h443.078q9.231 0 16.923-7.692 7.692-7.692 7.692-16.923v-471.898H569.385ZM233.846-806.154v155.795-155.795 652.308-652.308Z"
/>
</svg>
</button>
<button id="save" title="Save the PDF to disk" disabled>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M480-334.82 340.564-474.257l24.256-23.897 98.257 97.744V-760h33.846v359.59l98.257-97.744 24.256 23.897L480-334.82ZM258.461-200q-24.577 0-41.519-16.942Q200-233.884 200-258.461v-104.052h33.846v104.052q0 9.231 7.692 16.923 7.692 7.692 16.923 7.692h443.078q9.231 0 16.923-7.692 7.692-7.692 7.692-16.923v-104.052H760v104.052q0 24.577-16.942 41.519Q726.116-200 701.539-200H258.461Z"
/>
</svg>
</button>
<div class="separator"></div>
<button id="insert-text" title="Insert text" disabled>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M463.077-320v-286.154h-120V-640h273.846v33.846h-120V-320h-33.846ZM95.384-95.384V-256.36h64.462v-447.282H95.384v-160.975H256.36v64.462h447.282v-64.462h160.975v160.975h-64.462v447.282h64.462v160.975H703.641v-64.462H256.359v64.462H95.384Zm160.975-98.308h447.282v-62.667h62.667v-447.282h-62.667v-62.667H256.359v62.667h-62.667v447.282h62.667v62.667ZM129.23-737.487h93.283v-93.283H129.23v93.283Zm608.257 0h93.283v-93.283h-93.283v93.283Zm0 608.257h93.283v-93.283h-93.283v93.283Zm-608.257 0h93.283v-93.283H129.23v93.283Zm93.283-608.257Zm514.974 0Zm0 514.974Zm-514.974 0Z"
/>
</svg>
</button>
<input
type="file"
accept="image/png, image/jpeg"
id="insert-image-input"
name="insert-image"
hidden
/>
<button
id="insert-image"
onclick="document.getElementById('insert-image-input').click()"
title="Insert image"
disabled
>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M218.461-160q-24.577 0-41.519-16.942Q160-193.884 160-218.461v-523.078q0-24.577 16.942-41.519Q193.884-800 218.461-800h523.078q24.577 0 41.519 16.942Q800-766.116 800-741.539v523.078q0 24.577-16.942 41.519Q766.116-160 741.539-160H218.461Zm0-33.846h523.078q9.231 0 16.923-7.692 7.692-7.692 7.692-16.923v-523.078q0-9.231-7.692-16.923-7.692-7.692-16.923-7.692H218.461q-9.231 0-16.923 7.692-7.692 7.692-7.692 16.923v523.078q0 9.231 7.692 16.923 7.692 7.692 16.923 7.692Zm80.41-105.179h369.078L555.333-448.667l-108 135.539-70.974-86.718-77.488 100.821ZM193.846-193.846v-572.308 572.308Z"
/>
</svg>
</button>
<div class="separator"></div>
<div id="nav-bar">
<button id="previous" title="Go to the previous page" disabled>
<svg
xmlns="http://www.w3.org/2000/svg"
height="20"
viewBox="0 -960 960 960"
width="20"
>
<path
d="M576-267.692 363.692-480 576-692.308 599.308-669l-189 189 189 189L576-267.692Z"
/>
</svg>
</button>
<input type="text" id="current-page" value="1" disabled /> /
<span id="total-pages"></span>
<button id="next" title="Go to the next page" disabled>
<svg
xmlns="http://www.w3.org/2000/svg"
height="20"
viewBox="0 -960 960 960"
width="20"
>
<path
d="m549.692-480-189-189L384-692.308 596.308-480 384-267.692 360.692-291l189-189Z"
/>
</svg>
</button>
</div>
<div class="separator"></div>
<button
id="rotate-counterclockwise"
title="Rotate counter-clockwise"
disabled
>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M512.667-120q-46.486 0-91.538-12.897-45.053-12.898-83.54-38.642l23.744-24.564q34.744 22.026 72.539 32.142 37.795 10.115 78.795 10.115 118.795 0 201.91-83.115 83.116-83.116 83.116-201.911 0-118.282-83.116-201.654-83.115-83.372-201.91-83.372h-63.334l87.436 87.436-24.41 27.642-132-132.001 132-131.487 24.41 27.641-87.436 86.923h63.334q132.205 0 225.538 93.303 93.334 93.302 93.334 225.463 0 65.824-25.039 123.863-25.038 58.038-68.538 101.538t-101.509 68.539Q578.444-120 512.667-120ZM266.205-263.077 88.461-440.821l177.744-177.23 177.231 177.23-177.231 177.744Zm0-47.025 129.077-129.077-129.077-129.077-129.077 129.077 129.077 129.077Zm0-129.077Z"
/>
</svg>
</button>
<button id="rotate-clockwise" title="Rotate clockwise" disabled>
<svg
xmlns="http://www.w3.org/2000/svg"
height="32"
viewBox="0 -960 960 960"
width="32"
>
<path
d="M447.333-120q-65.777 0-123.786-25.038-58.009-25.039-101.509-68.539T153.5-315.063q-25.039-57.987-25.039-123.74 0-132.018 93.334-225.479 93.333-93.462 225.538-93.462h63.334l-87.436-86.923 24.41-27.641 132 131.487-132 132.001-24.41-27.642 87.436-87.436h-63.334q-118.795 0-201.91 83.372-83.116 83.372-83.116 201.654 0 118.795 83.116 201.911 83.115 83.115 201.91 83.115 41 0 78.795-10.115 37.796-10.116 72.539-32.142l23.744 24.564q-38.487 25.744-83.54 38.642Q493.819-120 447.333-120Zm246.462-143.077L516.564-440.821l177.231-177.23 177.744 177.23-177.744 177.744Zm0-47.025 129.077-129.077-129.077-129.077-129.077 129.077 129.077 129.077Zm0-129.077Z"
/>
</svg>
</button>
</div>
</div>
<div id="socials">
<a
href="https://github.com/photown/private-pdf"
target="_blank"
title="View source code on GitHub"
>
<img src="img/github.png" />
</a>
</div>
</div>
<div id="flex-container">
<div id="pages"></div>
<div id="content">
<div id="content-inner">
<div id="pageContainer" class="pdfViewer singlePageView"></div>
<div id="overlayContainer"></div>
</div>
</div>
</div>
<div id="empty-state">
<div id="empty-state-inner">
<a href="#" onclick="document.getElementById('pdf-file-input').click()"
>Pick a PDF file to modify.</a
>
Don't worry, it doesn't get uploaded anywhere - it all runs in your
browser!
</div>
</div>
<script src="dist/bundle.js" type="module"></script>
</body>
</html>