-
Notifications
You must be signed in to change notification settings - Fork 1
/
404.html
50 lines (50 loc) · 2.87 KB
/
404.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
<link href="main.css" rel="stylesheet">
<title class="title">Color El Goonish Shive</title>
<div class="data">
<noscript>You need Javascript enabled to view Color El Goonish Shive.</noscript>
<header>
<nav>
<h1 class="title">Color El Goonish Shive</h1>
<a href="https://egscomics.com" class="topmenu">El Goonish Shive</a><br>
<a href="https://github.com/mincerafter42/color-egs" class="topmenu">Color EGS on Github</a><br>
<a href="/" class="topmenu">Color EGS index page</a><br>
</nav>
</header>
<img id="comic" onclick='comicNumber++;displayComic(comicNumber)' style="clear:both;display:block;cursor:pointer">
<br>
<nav>
<button id="previous" class="comicButton" type="button" onclick='comicNumber--;displayComic(comicNumber)'>Previous</button>
<button id="next" class="comicButton" type="button" onclick='comicNumber++;displayComic(comicNumber)'>Next</button>
<span><label for="comicJump">Go to comic</label> <input type="number" id="comicJump" min=1 max=99999> <button type="button" onclick='if (document.getElementById("comicJump").value>0) {comicNumber=Number(document.getElementById("comicJump").value);displayComic(comicNumber)}'>Go</button></span>
<br><br>
<button class="comicButton" type="button" onclick='window.open(comicURL(comicNumber))'>View this comic on egscomics.com</button>
</nav>
<div style="clear:both;margin-top:20px">See a problem or a solution with the coloring? Check if it's on <a href="https://github.com/mincerafter42/color-egs/issues">the Github issues page.</a></div>
</div>
<script src="coloredOriginally.js"></script>
<script src="comicURLFromIndex.js"></script>
<script>
function addLeadingZeros(NUMBER,LENGTH) { //function that adds leading zeros to make a number LENGTH digits long
var i=String(NUMBER);
while (i.length<LENGTH) {i="0"+i}
return i;
}
function displayComic(comicNumber,noPushState) {
if (comicNumber>0) { //only show the comic if the comic number is actually a number
document.getElementById("comic").src=alreadyColored[comicNumber]?"https://egscomics.com/comics/"+alreadyColored[comicNumber]:"colored/"+addLeadingZeros(comicNumber,5)+".png"; //if a colored version is on the egscomics.com website, display it, otherwise, display the local colored version
for (var i=0;i<2;i++) { //there are two elements showing the title
document.getElementsByClassName("title")[i].innerText="Color El Goonish Shive #"+comicNumber; //adds comic number to page title
}
if (comicNumber==1) { //disables the Previous button if this is comic #1, else enables it
document.getElementById("previous").disabled=1;
} else {
document.getElementById("previous").removeAttribute("disabled");
}
if (noPushState!=true) { //(leave this part last for debugging, as it doesn't work in local files)
window.history.pushState({comicNumber:comicNumber},"","./"+comicNumber); //adds comic to history
}
}
}
var comicNumber=Math.round(Number(window.location.pathname.slice(1)))||1;
displayComic(comicNumber,true);
</script>