First usable stage

This commit is contained in:
2021-05-22 18:43:31 +02:00
commit b618ee182b
36 changed files with 2251 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="/style/sakura.css">
<title>{info.filename}</title>
</head>
<body>
<h1>{info.filename}</h1>
{#if !info.filename is '/'}
<a href="{info.directUrl}/..">back</a>
<span style="float:right;">
<a href="{info.viewUrl}/">viewer</a>
</span>
{/if}
<hr />
<table style="table-layout: fixed; text-align: center">
{#each info.content}
{#if count.mod(3) == 1}
<tr>
{/if}
<td>
{#if it.thumbnailUrl}
{#if it.type is 'file'}
{#if it.viewUrl}
<a href="{it.viewUrl}">
{#else}
<a href="{it.publicApiUrl}">
{/if}
{#else}
<a href="{it.directUrl}">
{/if}<img src="{it.thumbnailUrl}" loading="lazy" /></a><br />
{/if}
{#if it.type is 'file'}
<a href="{it.publicApiUrl}">
{#else}
<a href="{it.directUrl}">
{/if}{it.filename}</a>
</td>
{#if count.mod(3) == 0}
</tr>
{/if}
{/each}
</table>
<hr />
</body>
</html>

View File

@@ -0,0 +1,67 @@
<!doctype html>
<html style="height: 100%">
<head>
<meta charset="utf-8" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="/style/sakura.css" />
<title>{info.filename}</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/detect_swipe/2.1.1/jquery.detect_swipe.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/epubjs/dist/epub.min.js"></script>
</head>
<body style="max-width: 100%; padding: 0px; display: flex; flex-flow: column; height: 100%;">
<div style="flex: 0 1 auto;margin: 13px 13px 0px 13px;">
<table style="table-layout: fixed;">
<tr>
<td style="text-align: left; padding-top: 0; padding-bottom: 0;"><a href="{info.directUrl}/..">back</a></td>
<td style="text-align: right; padding-top: 0; padding-bottom: 0;"><a href="#" onclick="rendition.prev()">&lt;</a> <a href="#" onclick="rendition.next()">&gt;</a></td>
</tr>
</table>
<hr />
</div>
<div id="epub" style="flex: 1 0 auto; margin: 0px 13px 0px 13px;"></div>
<div style="flex: 0 1 auto; margin: 0px 13px 13px 13px;">
<hr />
</div>
<script>
var book = ePub("{info.directUrl}");
var rendition = book.renderTo("epub", { method: "default", width: "100%", height: "100%", minSpreadWidth: "1000" });
function setEvents(doc) {
doc.addEventListener("keyup", function(e){
if ((e.keyCode || e.which) == 37) {
rendition.prev();
}
if ((e.keyCode || e.which) == 39) {
rendition.next();
}
}, false);
doc.addEventListener("wheel", function(e) {
if (e.deltaY < 0) {
rendition.prev();
} else {
rendition.next();
}
}, false);
$(doc).on("swipeleft", function(event) {
rendition.next();
});
$(doc).on("swiperight", function(event) {
rendition.prev();
});
$(doc).on("swipeup", function(event) {
rendition.prev();
});
$(doc).on("swipedown", function(event) {
rendition.next();
});
}
rendition.on("rendered", (e0,i) => {
setEvents(i.document);
});
setEvents(document);
rendition.display();
</script>
</body>
</html>

View File

@@ -0,0 +1,22 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="/style/sakura.css" />
<title>{info.filename}</title>
</head>
<body>
<table style="table-layout: fixed;">
<tr>
<td style="text-align: left; padding-top: 0; padding-bottom: 0;"><a href="{info.directUrl}/..">back</a></td>
<td style="text-align: center; padding-top: 0; padding-bottom: 0;">{currpage}/{totpage}</td>
<td style="text-align: right; padding-top: 0; padding-bottom: 0;">{#if currpage > 1}<a href="{prevuri}">&lt;</a> {/if}{#if currpage < totpage}<a href="{nexturi}">&gt;</a>{/if}</td>
</tr>
</table>
<hr />
{#if currpage < totpage}<a href="{nexturi}">{/if}<img style="position: absolute; left: 50%; transform: translate(-50%, 0);" src="{image}" />{#if currpage < totpage}</a>{/if}
<hr />
</body>
</html>