mirror of
https://github.com/chrislgarry/Apollo-11.git
synced 2025-02-13 16:24:37 +00:00
feat: add browser for easier viewing of scans
Adds code with modifications from https://github.com/chrislgarry/Apollo-11/issues/690
This commit is contained in:
commit
318d830628
2 changed files with 100 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
yaYUL.exe
|
99
index.html
Normal file
99
index.html
Normal file
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>AGC scans viewer</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<script>
|
||||
const COMANCHE055_PAGES = 1751;
|
||||
const LUMINARY099_PAGES = 1743;
|
||||
|
||||
function changeDir() {
|
||||
showPage();
|
||||
}
|
||||
function showPrevious() {
|
||||
const newpage = parseInt(document.form.pagenum.value) - 1;
|
||||
if (newpage >= 1) {
|
||||
changePage(newpage);
|
||||
}
|
||||
}
|
||||
function showNext() {
|
||||
const newpage = parseInt(document.form.pagenum.value) + 1;
|
||||
const directory = document.form.directory.value;
|
||||
if (
|
||||
(directory === "Comanche055" && newpage <= COMANCHE055_PAGES) ||
|
||||
(directory === "Luminary099" && newpage <= LUMINARY099_PAGES)
|
||||
) {
|
||||
changePage(newpage);
|
||||
}
|
||||
}
|
||||
function changePage(page) {
|
||||
document.form.pagenum.value = parseInt(page);
|
||||
showPage();
|
||||
}
|
||||
function showPage() {
|
||||
let page = parseInt(document.form.pagenum.value);
|
||||
const directory = document.form.directory.value;
|
||||
|
||||
if (page < 1) {
|
||||
document.form.pagenum.value = 1;
|
||||
page = 1;
|
||||
} else if (directory === "Comanche055" && page > COMANCHE055_PAGES) {
|
||||
document.form.pagenum.value = COMANCHE055_PAGES;
|
||||
page = COMANCHE055_PAGES;
|
||||
} else if (directory === "Luminary099" && page > LUMINARY099_PAGES) {
|
||||
document.form.pagenum.value = LUMINARY099_PAGES;
|
||||
page = LUMINARY099_PAGES;
|
||||
}
|
||||
|
||||
formattedPage = page.toString().padStart(4, "0");
|
||||
|
||||
imageURL = `https://www.ibiblio.org/apollo/ScansForConversion/${directory}/${formattedPage}.jpg`;
|
||||
document.image.src = imageURL;
|
||||
document.body.style.cursor = "progress";
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
margin: 1rem;
|
||||
}
|
||||
form {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
img {
|
||||
min-width: 100vw;
|
||||
height: auto;
|
||||
}
|
||||
select,
|
||||
input {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onLoad="showPage()">
|
||||
<form name="form" onSubmit="return false">
|
||||
<select name="directory" onChange="changeDir()">
|
||||
<option>Comanche055</option>
|
||||
<option>Luminary099</option>
|
||||
</select>
|
||||
<input type="button" onClick="showPrevious()" value="Previous Page" />
|
||||
<input
|
||||
type="text"
|
||||
name="pagenum"
|
||||
onChange="changePage(this.value)"
|
||||
size="5"
|
||||
maxlength="4"
|
||||
value="1"
|
||||
/>
|
||||
<input type="button" onClick="showNext()" value="Next Page" />
|
||||
</form>
|
||||
<img
|
||||
name="image"
|
||||
onLoad="this.title=this.src;document.body.style.cursor='default'"
|
||||
width="1314"
|
||||
height="1000"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue