-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
executable file
·573 lines (563 loc) · 29.6 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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
<!DOCTYPE html>
<html class="" hidden>
<head>
<title>Clovre - Local Manga & Webtoon Reader Web App</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Local Manga & Webtoon Reader with Anilist.co integration" />
<meta name="author" content="rehhouari" />
<meta name="generator" content="Clovre" />
<meta name="google-site-verification" content="7qFE3Un3sByZ98nydg7qKZoaH8nXG-ipksQvNkui53w" />
<link rel="canonical" href="https://clovre.pigeonivy.com" />
<!-- Social meta tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="rehhouari" />
<meta name="twitter:title" content="Clovre - Local Manga Reader Web App" />
<meta name="twitter:description" content="Local manga & webtoon reading web app with Anilist integration." />
<meta name="twitter:image" content="https://clovre.pigeonivy.com/images/twimage.png" />
<meta property="og:title" content="Clovre - Local Manga Reader Web App">
<meta property="og:site_name" content="Clovre">
<meta property="og:url" content="https://clovre.pigeonivy.com" itemprop="thumbnailUrl">
<meta property="og:description" content="Local manga & webtoon reading web app with Anilist integration.">
<meta property="og:type" content="website">
<meta property="og:image" content="https://clovre.pigeonivy.com/images/ogimage.png">
<!-- PWA -->
<link rel="manifest" href="/manifest.webmanifest" />
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/pwacompat.min.js" crossorigin="anonymous"></script>
<!-- Favicons -->
<link rel="icon" href="/images/icons/favicon-32x32.png" sizes="32x32" type="image/png" />
<link rel="icon" href="/images/icons/favicon-16x16.png" sizes="16x16" type="image/png" />
<link rel="icon" href="/images/icons/favicon.ico" />
<meta name="theme-color" content="#4A5462" />
<!-- Inter Font -->
<link rel="stylesheet" type="text/css" href="https://rsms.me/inter/inter.css" />
<style>
html {
font-family: 'Inter-var', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "PT Sans", "Open Sans", "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
/*font-feature-settings: "cv02", "cv03", "cv04", "cv05", "cv08", "cv09", "cv10", "cv11", "calt", "kern";*/
}
[x-cloak] {
display: none
}
.no-focus-outline a:focus,
.no-focus-outline select:focus,
.no-focus-outline input:focus,
.no-focus-outline button:focus {
outline: none !important;
}
</style>
<script defer type="module">
import { setup, disconnect } from 'https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/twind/shim.js'
setup({
darkMode: 'class'
})
import main from '/js/components/main.js'
import Alpine from 'https://unpkg.com/[email protected]/dist/module.esm.js'
import persist from 'https://unpkg.com/@alpinejs/[email protected]/dist/module.esm.js'
import focus from 'https://unpkg.com/@alpinejs/[email protected]/dist/module.esm.js'
import intersect from 'https://unpkg.com/@alpinejs/[email protected]/dist/module.esm.js'
// allow focus outline when tabbing
document.body.addEventListener('keyup', (e) => (e.key === 'Tab') &&
document.documentElement.classList.remove('no-focus-outline'))
Alpine.data('main', main)
Alpine.plugin(persist)
Alpine.plugin(focus)
Alpine.plugin(intersect)
window.Alpine = Alpine
Alpine.start()
</script>
</head>
<body
class="text-center bg-gray-400 text-gray-800 dark:(text-gray-600 bg-gray-900 p-0 transition-colors duration-300) no-focus-outline">
<div class="relative min-h-screen max-h-screen flex select-none" x-data="main()" @popstate.window.prevent="escape"
@keydown.document.shift.d.prevent="toggle('darkMode')" @keydown.document.escape="escape"
@keydown.document.ctrl.k.prevent="focusInput()"
x-effect="document.querySelector('html').classList.toggle('dark', darkMode)"
@keydown.document.shift.m="toggle('muteAudio')" @keydown.document.shift.space.stop="toggle('openMenu')"
x-effect="if(loading) window.blur()" @keydown.document="if (loading) { event.stopPropagation() }"
@keydown.document.shift.f="toggle('offlineMode')" @keydown.document.shift.t="toggle('test')">
<!-- modal -->
<div class="absolute flex w-full h-screen max-w-full bg-black bg-opacity-50 z-10 lg:(px-40) transition-colors duration-300"
x-transition x-show="openMenu && !loading" hidden>
<div class="w-full overflow-y-auto bg-white text-black dark:bg-gray-800 dark:text-white h-[70%] transition-colors duration-300 shadow-xl px-2 pt-4 lg:rounded-lg self-center items-center justify-center flex flex-col space-y-4 inset-x-0 mx-auto"
@click.away="openMenu = false; menuTab = 0" x-cloak>
<!-- about -->
<div class="">
<div class="space-y-4">
<h1 class="text-center text-5xl font-black">Clovre</h1>
<p class="text-sm">Local Manga & Webtoon Reader</p>
</div>
</div>
<!-- settings -->
<div class="flex flex-col flex-grow space-y-6" x-trap="openMenu && !loading">
<div class="flex">
<hr class="border-0 border-b-1 my-2 mx-auto">
<div class="flex items-center justify-evenly space-x-4">
<button class="text-2xl mt-2 font-bold opacity-60 transition-opacity"
:class="{'opacity-100': menuTab==0}" @click="menuTab=0">Anilist</button>
<button class="text-2xl mt-2 font-bold opacity-60 transition-opacity"
:class="{'opacity-100': menuTab==1}" @click="menuTab=1">Shortcuts</button>
<button class="text-2xl mt-2 font-bold opacity-60 transition-opacity"
:class="{'opacity-100': menuTab==2}" @click="menuTab=2">About</button>
</div>
<hr class="border-0 border-b-1 my-2 mx-auto">
</div>
<div class="flex max-h-96 select-text">
<!-- shortcuts tab -->
<div class="flex flex-col space-y-2 overflow-y-auto mb-4" x-show="menuTab==1">
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<span class="font-bold">shift+space</span>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Show this window. (also in lower right corner)</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<span class="font-bold">escape</span>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Go back or close menu</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<label class="space-x-4"><input type="checkbox" class="" x-model="darkMode"
aria-label="Toggle dark mode"><span class="font-bold">shift+d</span></label>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Toggle dark mode</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<label class="space-x-4"><input type="checkbox" class="" x-model="muteAudio"
aria-label="Mute sound"><span class="font-bold">shift+m</span></label>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Mute sound</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<label class="space-x-4"><input type="checkbox" class=""
x-model="chaptersOrderDescending" :aria-label="orderButtonLabel()"><span
class="font-bold">shift+v</span></label>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left" x-text="'Chapters ' + orderButtonLabel()"></p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<label class="space-x-4"><input type="checkbox" class="" x-model="offlineMode"
aria-label="Toggle offline mode"><span
class="font-bold">shift+f</span></label>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Toggle offline mode (ie. do not fetch covers on load)
</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<span class="font-bold">shift+k</span>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">Focus search input</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<span class="font-bold">left & right</span>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">* Go to previous or next chapter respectively</p>
</div>
</div>
<div
class="flex flex-col bg-gray-200 dark:bg-gray-600 rounded-md p-2 transition-colors duration-100">
<div class="justify-start space-x-2 flex flex-row items-center">
<span class="font-bold">0 to 3</span>
</div>
<div class="justify-end flex-grow">
<p class="text-base text-left">* Set page width. Current:
<span x-show="pageSize == 0">Default</span>
<span x-show="pageSize == 1">Small</span>
<span x-show="pageSize == 2">Medium</span>
<span x-show="pageSize == 3">Fullscreen</span>
</p>
</div>
</div>
<p class="text-xs">*: these shortcuts only work when reading a chapter.</p>
</div>
<!-- about tab -->
<div class="flex flex-col space-y-2 flex-grow items-center overflow-y-auto" x-show="menuTab==2">
<div class="text-sm mx-4 lg:mx-16 text-left pb-4 border-b-1 space-y-2">
<p>A web up with a clean interface & Anilist integration to read your downloaded
manga comfortably.</p>
<h2 class="text-xl mt-2">Folder Structure:</h2>
<p>Open the folder that have your mangas, make sure they're not under extra
subdirectories:</p>
<pre class="text-xs p-1 bg-gray-200 rounded-lg text-black">
Mangas (drop this)/
├── Manga 1/
│ ├── Chapter 1/
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ..
│ └── Chapter 2/
│ ├── page-0.png
│ ├── page-1.png
│ └── ..
└── Manga 2/
├── c-4/
│ ├── image-1.jpg
│ ├── image-2.jpg
│ └── ...
└── c-5/
├── 0001.jpg
└── 0002.jpg
</pre>
</div>
<div class="">
<p class="w-80 max-w-full my-4">Made by <a href="https://twitter.com/rehhouari"
class="font-bold text-lg">@rehhouari</a>. <a
href="https://github.com/rehhouari/clovre" class="underline">GitHub</a></p>
</div>
</div>
<!-- anilist tab -->
<div class="flex flex-col space-y-2 h-48 flex-grow" x-show="menuTab==0">
<template x-if='accessToken'>
<div class="flex flex-col space-y-2">
<p class="">Welcome, <a x-text="username" class="font-bold underline"
:href="'https://anilist.co/user/'+username" target="_blank">weeb</a></p>
<button @click="logout"
class="p-2 rounded-lg font-bold bg-gray-200 dark:(bg-gray-400 text-white) transition-colors duration-300 shadow-sm hover:shadow-lg cursor-pointer">
Logout
</button>
<button @click="refreshData"
class="p-2 rounded-lg font-bold bg-gray-200 dark:(bg-gray-400 text-white) transition-colors duration-300 shadow-sm hover:shadow-lg cursor-pointer"
x-show="loaded">
Refresh Local Data
</button>
</div>
</template>
<template x-if='!accessToken'>
<a :href="authUrl" @click="login" target="_blank"
class="p-2 rounded-lg font-bold bg-gray-200 dark:(bg-gray-400 text-white) transition-colors duration-300 shadow-sm hover:shadow-lg cursor-pointer">
Login with Anilist
</a>
</template>
</div>
</div>
</div>
</div>
</div>
<!-- Menu button -->
<div class="fixed bottom-0 right-0 pb-2 pr-2 group">
<button @click="toggle('openMenu')"
class="bg-white text-current dark:bg-gray-800 dark:text-white focus:(bg-white text-current dark:bg-gray-800 dark:text-white) p-4 m-4 rounded-lg font-bold shadow-sm hover:shadow-lg cursor-pointer"
aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
<!-- loading screen -->
<template x-if="loading">
<div class="cursor-wait flex max-h-full w-full overflow-y-hidden">
<template x-if="loading =='login'">
<div
class="mx-auto text-current bg-gray-200 dark:bg-gray-400 dark:text-white shadow-lg p-4 lg:m-4 lg:rounded-xl flex flex-row flex-grow items-center">
<p class="dark:text-gray-800 text-2xl font-bold flex-grow">Waiting for token...</p>
</div>
</template>
<template x-if="loading == 'mangas'">
<div
class="flex flex-col space-y-2 max-h-full overflow-hidden dark:bg-gray-600 z-50 bg-gray-200 p-2 lg:p-4 lg:m-4 lg:rounded-xl">
<div class="w-full flex flex-grow h-10 max-h-10 rounded-lg bg-white dark:bg-gray-400"><br><br>
</div>
<div
class="flex space-y-4 overflow-y-hidden justify-evenly space-x-4 sm:justify-start flex-wrap">
<template x-for="i in 10">
<div
class="flex flex-col w-36 max-h-60 bg-white dark:bg-gray-400 my-2 p-1 rounded-lg box-content">
<div class="max-w-full w-36 h-48 bg-gray-400 text-gray-200 dark:(bg-gray-300 text-current) flex items-center rounded-t-lg"
aria-hidden="true" focusable="false">
</div>
<p
class="text-sm font-bold m-1 dark:text-white self-center items-topx flex items-center overflow-hidden h-10">
</p>
</div>
</template>
</div>
</div>
</template>
<template x-if="loading == 'manga'">
<div
class="flex flex-col space-y-2 w-screen overflow-y-hidden dark:bg-gray-600 bg-gray-200 p-2 lg:p-4 lg:m-4 lg:rounded-xl ">
<div class="flex flex-row md:space-x-2 ">
<div class="hidden md:(flex flex-grow-0 flex-col self-end)">
<div
class="max-w-full w-36 h-52 bg-gray-400 dark:bg-gray-200 flex items-center rounded-lg">
<p class="w-full"></p>
</div>
</div>
<div class="flex flex-col flex-grow md:flex-shrink">
<div class="self-top flex-grow flex flex-col space-y-2">
<p
class="text-4xl md:text-6xl m-1 rounded-lg bg-gray-400 dark:bg-gray-100 self-top text-left">
</p>
</div>
<div class="flex flex-row space-x-2 mt-2">
<div class="p-6 flex-grow rounded-lg bg-gray-300"></div>
</div>
</div>
</div>
<div class="max-w-full w-full flex flex-grow flex-col space-y-4 overflow-y-hidden">
<template x-for="i in 8">
<div class="bg-white dark:bg-gray-400 py-2.5 flex-grow rounded-lg cursor-pointer">
<p class="min-w-full w-full"> </p>
</div>
</template>
</div>
</div>
</template>
<template x-if="loading == 'chapter'">
<div class="mx-auto pb-2 overflow-y-hidden">
<div class="mx-auto">
<div style="width:600px" class="bg-gray-200 max-w-full h-screen mx-auto"
:class="imageSize(false)"></div>
</div>
</div>
</template>
</div>
</template>
<!-- directory open screen-->
<template x-if="!loaded && !loading">
<button
class="mx-auto text-current bg-gray-200 dark:(bg-gray-400 text-white) transition-colors duration-300 w-full max-w-full shadow-lg p-4 lg:(m-4 rounded-xl) flex flex-row items-center"
@drop.prevent="dropMangasDirectory" @dragover.prevent="dragover = true" @dragleave="dragover = false"
@click="openMangasDir">
<p class="dark:text-gray-800 text-2xl font-bold flex-grow transition-colors duration-300"><span
x-show="!dragover">Click to open a folder that contain your mangas or drag and drop
it.</span><span x-show="dragover">Drop directory</span></p>
</button>
</template>
<!-- manga selection -->
<template x-if="loaded && selectedManga == null && !loading">
<div
class="flex flex-col space-y-2 flex-grow dark:bg-gray-600 transition-colors duration-300 bg-gray-200 p-2 lg:p-4 lg:m-4 lg:rounded-xl shadow-sm">
<div class="flex flex-row space-x-2">
<input type="search"
class="p-2 w-full flex-grow rounded-lg font-bold bg-white dark:(bg-gray-400 text-white placeholder-gray-200) transition-colors duration-300 shadow-sm focus:shadow-lg"
placeholder="Search Mangas" x-model="searchMangas" autofocus aria-label="Search Mangas"
x-ref="searchMangas" @keydown.escape.stop="blur()">
<select x-model="mangaStatusFilter"
class="h-10 p-2 bg-white dark:(bg-gray-400 text-white placeholder-gray-200) transition-colors duration-200 font-bold rounded-lg shadow-sm enabled:hover:shadow-lg enabled:cursor-pointer disabled:cursor-not-allowed"
title="Filter by Status">
<option value="any">Any</option>
<option value="CURRENT">Reading</option>
<option value="PLANNING">Planning to</option>
<option value="COMPLETED">Completed </option>
<option value="DROPPED">Dropped</option>
<option value="PAUSED">Paused</option>
<option value="REPEATING">Repeating</option>
<option value="null">Unlisted</option>
</select>
</div>
<div
class="flex space-y-4 overflow-y-auto justify-evenly space-x-4 sm:justify-start flex-wrap flex-grow">
<template x-for="manga in getMangas()" :key="manga.id">
<button
class="flex flex-col w-36 max-h-60 bg-white dark:bg-gray-400 transition-colors duration-300 p-1 rounded-lg shadow-sm hover:shadow-lg cursor-pointer box-content transition duration-100 ease-in transform hover:(scale-105) focus:(scale-105)"
x-data="{loadedImage: false}" @click=selectManga(manga.name) aria-label="manga.name">
<img :src="manga.coverImage" class="max-w-full rounded-t-lg h-48 mx-auto w-36"
x-show="loadedImage && manga.coverImage" @load="loadedImage=true"
:alt="manga.name + ' Cover Art'" />
<div class="max-w-full w-36 h-48 bg-gray-400 text-gray-200 dark:(bg-gray-300 text-current) transition-colors duration-300 flex items-center rounded-t-lg"
x-show="!loadedImage || !manga.coverImage" aria-hidden="true" focusable="false">
<p x-text="manga.name" class="w-full font-bold"></p>
</div>
<p class="text-sm font-bold m-1 dark:text-white self-center transition-colors duration-300 items-topx flex items-center overflow-hidden h-10"
:title="manga.name"><span x-text="manga.name.substr(0, 24)"></span></p>
</button>
</template>
</div>
</div>
</template>
<!-- chapter selection & manga details -->
<template x-if="loaded && selectedManga && selectedChapter==null && !loading">
<div class="flex flex-col space-y-2 flex-grow dark:bg-gray-600 transition-colors duration-300 bg-gray-200 p-2 lg:p-4 lg:m-4 lg:rounded-xl shadow-sm"
@keyup.document.shift.v="toggle('chaptersOrderDescending')">
<div class="flex flex-row md:space-x-2 ">
<div class="hidden md:(flex flex-grow-0 flex-col self-end)">
<img :src="selectedMangaData.coverImage" class="max-w-full w-40 rounded-lg "
x-show="selectedMangaData.coverImage" />
<div class="max-w-full w-36 h-48 bg-gray-400 text-gray-200 dark:(bg-gray-300 text-current) transition-colors duration-300 flex items-center rounded-lg"
x-show="!selectedMangaData.coverImage">
<p x-text="selectedMangaData.name" class="w-full font-bold"></p>
</div>
</div>
<div class="flex flex-col flex-grow md:flex-shrink">
<div class="self-top flex-grow flex flex-col space-y-2">
<p class="text-2xl md:text-4xl font-black m-1 flex-grow dark:text-gray-100 transition-colors duration-300 self-top text-left select-text"
:class="{'text-4xl md:text-6xl':selectedMangaData.name.length < 30}"
x-text="selectedMangaData.name"></p>
<div class="flex flex-col space-y-2 md:(flex-row space-y-0 space-x-2 items-end)"
x-show="selectedMangaData.coverImage">
<a :href="`https://anilist.co/manga/${selectedMangaData.id}`" target="_blank"
class="font-bold bg-gray-800 rounded-lg shadow-sm hover:shadow-lg cursor-pointer w-full md:w-10 flex items-center"
aria-label="Open in Anilist.co" title="Open in Anilist.co">
<img src="/images/anilist-icon.svg" class="mx-2 md:mx-0 w-10 inline-block"
focusable="false" aria-hidden></img>
<span class="md:hidden justify-start font-semibold flex-grow text-white">Open in
Anilist</span>
</a>
<button
class="bg-blue-500 rounded-lg text-white p-1 flex flex-row items-center shadow-sm enabled:hover:shadow-lg disabled:cursor-not-allowed"
title="Refresh Data" @click="refreshManga(selectedMangaData)"
:disabled="!window.navigator.onLine">
<svg xmlns="http://www.w3.org/2000/svg" class="mx-2 md:mx-0 h-8 w-8" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15">
</path>
</svg>
<span class="md:hidden justify-start font-semibold flex-grow">Refresh Data</span>
</button>
<template x-if="accessToken">
<div class="flex flex-col space-y-2 md:(flex-row space-y-0 space-x-2)">
<button
class="bg-red-500 rounded-lg text-white p-1 flex flex-row items-center shadow-sm enabled:hover:shadow-lg disabled:cursor-not-allowed"
@click="favoriteToggle()"
:class="{'children:fill-current': selectedMangaData.favorited}"
:disabled="!window.navigator.onLine || !accessToken"
title="Toggle Favorite">
<svg xmlns="http://www.w3.org/2000/svg" class="mx-2 md:mx-0 h-8 w-8"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z">
</path>
</svg>
<span class="md:hidden justify-start font-semibold flex-grow"
x-text="selectedMangaData.favorited?'Unfavorite':'Favorite'"></span>
</button>
<div
class="flex bg-white dark:(bg-gray-400 text-white placeholder-gray-200) transition-colors duration-300 rounded-lg shadow-sm enabled:hover:shadow-lg overflow-hidden items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 ml-4 md:ml-2"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
</svg>
<select x-effect="$el.selectedIndex = selectedMangaData.status.index"
class="h-10 p-2 mx-2 flex-grow bg-white dark:(bg-gray-400 text-white placeholder-gray-200) transition-colors duration-200 font-bold cursor-pointer disabled:cursor-not-allowed"
:disabled="!window.navigator.onLine || !accessToken"
@change="setStatus($el.selectedOptions[0].value)" title="Set Status">
<option :disabled="selectedMangaData.status.satus == $el.value"
value="null">Unlisted</option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="CURRENT">Reading</option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="PLANNING">Planning to</option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="COMPLETED">Completed </option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="DROPPED">Dropped</option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="PAUSED">Paused</option>
<option :disabled="selectedMangaData.status.satus == $el.value"
value="REPEATING">Repeating</option>
</select>
</div>
<div
class="bg-white shadow-sm focus:shadow-lg rounded-lg font-bold bg-white dark:(bg-gray-400 text-white placeholder-gray-200) overflow-hidden transition-colors duration-300 shadow-sm flex items-center">
<input type="number" min="0" :max="selectedMangaData.chapters??9999"
x-effect="$el.value = selectedMangaData.status.progress"
class="font-bold py-2 px-4 md:px-2 bg-transparent flex-grow disabled:cursor-not-allowed"
placeholder="" aria-label="Progress" @keydown.escape.stop="blur()"
@input="setProgress($el.value)"
:disabled="!window.navigator.onLine || !accessToken">
<div class="inline border-l-2 h-full"></div>
<span class="font-bold mx-2 opacity-80"><span
x-text="selectedMangaData.chapters"
x-show="selectedMangaData.chapters"></span><span
x-show="!selectedMangaData.chapters"
class="text-2xl">∞</span></span>
</div>
</div>
</template>
</div>
</div>
<div class="flex flex-row space-x-2 mt-2">
<input type="search"
class="w-full p-2 rounded-lg font-bold bg-white dark:(bg-gray-400 text-white placeholder-gray-200) transition-colors duration-300 shadow-sm focus:shadow-lg"
placeholder="Search Chapters" x-model="searchChapters" aria-label="Search Mangas"
x-ref="searchChapters" @keydown.escape.stop="blur()">
<button @click="toggle('chaptersOrderDescending')"
class="p-2 rounded-lg font-bold bg-white dark:(bg-gray-400 text-white) transition-colors duration-300 shadow-sm hover:shadow-lg cursor-pointer"
:aria-label="orderButtonLabel()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor" x-show="!chaptersOrderDescending" aria-hidden="true"
focusable="false">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor" x-show="chaptersOrderDescending" aria-hidden="true"
focusable="false">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4" />
</svg>
</button>
</div>
</div>
</div>
<div class="max-w-full w-full flex flex-grow flex-col space-y-4 overflow-y-auto">
<template x-for="(chapter, index) in getChapters()" :key="index">
<button
class="bg-white dark:(bg-gray-400 text-white) transition-colors duration-300 py-2 rounded-lg shadow-sm hover:shadow-md cursor-pointer font-bold text-xl"
x-text="chapter" @click=selectChapter(chapter)></button>
</template>
</div>
</div>
</template>
<!-- reading screen -->
<template x-if="selectedChapter!=null && loaded && selectedManga && !loading">
<div class="mx-auto inline-block overflow-y-auto pb-2" @keydown.document.left="previousChapter()"
@keydown.document.right="nextChapter()" @keydown.document.1="setPageWidth(1)"
@keydown.document.2="setPageWidth(2)" @keydown.document.3="setPageWidth(3)"
@keydown.document.0="setPageWidth(0)">
<template x-for="(page, index) in pages.sizes" :key="index">
<div class="mx-auto" x-data="{load: (index == 0 && !clickToLoad)}"
x-init="if (load) loadedImages++">
<img class="select-auto max-w-full mx-auto !cursor-default" :class="imageSize(!load)"
x-intersect.leave="clickToLoad || loadedImages <= 1 ? false: load = false; loadedImages--"
x-effect="load && pages.images[index]!=null ? $el.src = pages.images[index] : $el.src = ''" />
<div :style="skeletonSize(page)" class="bg-gray-200 max-w-full mx-auto"
@click="clickToLoad? load = true:false" :class="imageSize(load)"
x-intersect.enter="clickToLoad ? false: load = true; loadedImages++"
:title="clickToLoad?'Click To Load Image':''"></div>
</div>
</template>
</div>
</template>
<button id="" x-show="showUpdateBar && !selectedChapter"
@click="newWorker.postMessage({ action: 'skipWaiting' });"
class="absolute bg-gray-400 dark:bg-gray-200 dark:text-gray-600 p-4 w-full shadow-md text-white font-semibold bottom-0 mx-auto">A
new version of this app is available. Click to update.</button>
</div>
</body>
</html>