Initial commit

This commit is contained in:
Niles Rogoff 2016-06-26 13:45:51 -04:00
commit 2e46aab9bd
5 changed files with 442 additions and 0 deletions

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
all:
python3 generate.py > index.html

BIN
background.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

121
generate.py Normal file
View File

@ -0,0 +1,121 @@
def rjs(f, z):
result = []
result.append("if (" + str(ord(f[1].upper())) + " == x && z == '"+z+"') {")
result.append("document.getElementById(z+'" + f[1] + "').style.color = '#CC0000';")
if type(f[2]) == str:
result.append("window.location = '" + f[2] + "';")
else:
result.append("z = z + '"+f[1]+"';")
result.append("var x = document.getElementsByClassName(z);")
result.append("for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }")
result.append("var x = document.getElementById(z);")
result.append("x.onclick = function() { key({keyCode: 27}) }")
result.append("}")
if type(f[2]) != str:
for l in f[2]:
result.append(rjs(l, z + f[1]))
return "\n".join(result)
def rjs2(f, z):
result = []
if type(f[2]) != str:
result.append("if (z == '"+z+"') {")
result.append("document.getElementById(z+'" + f[1] + "').onclick = function() { key({keyCode:" + str(ord(f[1].upper())) + " }) };")
result.append("}")
for l in f[2]:
result.append(rjs2(l, z + f[1]))
return "\n".join(result)
def rhtml(f, z):
result = []
href = []
if type(f[2]) == str:
href = ["href='"+f[2]+"'"]
if len(z) > 0:
href = ["style='display: none;'"]
result.append(''.join(["<a class='"+z+"' id='",z,f[1],"' ",*href," onclick='key({keyCode:"+str(ord(f[1].upper()))+"})'>", f[0], "</a>"]))
if type(f[2]) != str:
result.append("<span style='position: absolute; left: 200px; top: 0px;'>")
for l in f[2]:
result.append(rhtml(l, z + f[1]))
result.append("</span>")
result.append("<br />")
return "\n".join(result)
l = [
["/r/", "r", [
["/all", "a", "https://reddit.com/r/all"]
, ["/top", "t", "https://reddit.com/r/all/top?t=1h"]
, ["/new", "n", "https://reddit.com/r/FreeGamesOnSteam/new"]
, ["/shithole","s", "https://reddit.com/r/freegamesonsteam"]
]]
, ["/chan/", "c", [
["/ck", "k", "https://4chan.org/ck"]
, ["/pro", "p", "http://desuchan.moe/pro/"]
, ["/tech/", "t", [
["/laintech", "l" , "https://lainchan.org/tech/catalog.html"]
, ["/desutech", "d", "http://desuchan.moe/tech/"]
, ["/g", "g", "https://4chan.org/g"]
, ["/silicon", "s", "https://sushigirl.us/silicon/catalog.html"]
]]
, ["/music/", "m", [
["/mu", "m", "http://aurorachan.net/mu/"]
, ["/tunes", "t", "https://sushigirl.us/tunes/catalog.html"]
]]
, ["/transport", "n", "http://boards.4chan.org/n"]
, ["/news", "z", "http://boards.4chan.org/news"]
, ["/off_topic/", "o", [
["/ot", "o", "https://uboachan.net/ot/catalog.html"]
, ["/lounge", "l", "https://sushigirl.us/lounge/catalog.html"]
]]
, ["/cyb", "c", "https://lainchan.org/cyb/catalog.html"]
, ["/lit", "l", "https://lainchan.org/lit/catalog.html"]
, ["", "p", "https://lainchan.org/%CE%BB/catalog.html"]
, ["/art", "x", "https://lainchan.org/art/catalog.html"]
]]
, ["/vola", "v", "https://volafile.io/r/kUFzLJ"]
, ["/tube/", "t", [
["/0", "0", "https://www.youtube.com/playlist?list=PLIKcw9O7i0KR4Q-pC-7MLb_DoRmzYOCUw"]
, ["/1", "1", "https://www.youtube.com/playlist?list=PLIKcw9O7i0KRZ43r5UVGNraUgvyPaUMBU"]
, ["/2", "2", "https://www.youtube.com/playlist?list=PLIKcw9O7i0KQO4aHOqypivLefSFKq2vp1"]
, ["/3", "3", "https://www.youtube.com/playlist?list=PLIKcw9O7i0KSeW6AmMmg3D4etDs5YeX8q"]
]]
#, ["/mail", "g", "https://gmail.com"] # Fixed tab
]
master = ["""<!doctype html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<script>
var z = "";
function key(event) {
event = event || window.event;
console.log(event.keyCode);
if (event.keyCode == 27) {
if (z.length == 0) {
return;
}
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'none'; }
document.getElementById(z).style.color = '#eeeeee';
z = z.substring(0, z.length - 1);
"""]
for f in l:
master.append(rjs2(f, ""))
master.append("""
return;
}
var x = event.which || event.keyCode;
""")
for f in l:
master.append(rjs(f, ""))
master.append("""
}
document.onkeydown = key;
</script></head>""")
master.append("""<body class="hasGoogleVoiceExt"><div id="content">""")
for f in l:
master.append(rhtml(f, ""))
master.append("""</div></body></html>""")
master = "\n".join(master)
print(master)

293
index.html Normal file
View File

@ -0,0 +1,293 @@
<!doctype html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<script>
var z = "";
function key(event) {
event = event || window.event;
console.log(event.keyCode);
if (event.keyCode == 27) {
if (z.length == 0) {
return;
}
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'none'; }
document.getElementById(z).style.color = '#eeeeee';
z = z.substring(0, z.length - 1);
if (z == '') {
document.getElementById(z+'r').onclick = function() { key({keyCode:82 }) };
}
if (z == '') {
document.getElementById(z+'c').onclick = function() { key({keyCode:67 }) };
}
if (z == 'c') {
document.getElementById(z+'t').onclick = function() { key({keyCode:84 }) };
}
if (z == 'c') {
document.getElementById(z+'m').onclick = function() { key({keyCode:77 }) };
}
if (z == 'c') {
document.getElementById(z+'o').onclick = function() { key({keyCode:79 }) };
}
if (z == '') {
document.getElementById(z+'t').onclick = function() { key({keyCode:84 }) };
}
return;
}
var x = event.which || event.keyCode;
if (82 == x && z == '') {
document.getElementById(z+'r').style.color = '#CC0000';
z = z + 'r';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (65 == x && z == 'r') {
document.getElementById(z+'a').style.color = '#CC0000';
window.location = 'https://reddit.com/r/all';
}
if (84 == x && z == 'r') {
document.getElementById(z+'t').style.color = '#CC0000';
window.location = 'https://reddit.com/r/all/top?t=1h';
}
if (78 == x && z == 'r') {
document.getElementById(z+'n').style.color = '#CC0000';
window.location = 'https://reddit.com/r/FreeGamesOnSteam/new';
}
if (83 == x && z == 'r') {
document.getElementById(z+'s').style.color = '#CC0000';
window.location = 'https://reddit.com/r/freegamesonsteam';
}
if (67 == x && z == '') {
document.getElementById(z+'c').style.color = '#CC0000';
z = z + 'c';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (75 == x && z == 'c') {
document.getElementById(z+'k').style.color = '#CC0000';
window.location = 'https://4chan.org/ck';
}
if (80 == x && z == 'c') {
document.getElementById(z+'p').style.color = '#CC0000';
window.location = 'http://desuchan.moe/pro/';
}
if (84 == x && z == 'c') {
document.getElementById(z+'t').style.color = '#CC0000';
z = z + 't';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (76 == x && z == 'ct') {
document.getElementById(z+'l').style.color = '#CC0000';
window.location = 'https://lainchan.org/tech/catalog.html';
}
if (68 == x && z == 'ct') {
document.getElementById(z+'d').style.color = '#CC0000';
window.location = 'http://desuchan.moe/tech/';
}
if (71 == x && z == 'ct') {
document.getElementById(z+'g').style.color = '#CC0000';
window.location = 'https://4chan.org/g';
}
if (83 == x && z == 'ct') {
document.getElementById(z+'s').style.color = '#CC0000';
window.location = 'https://sushigirl.us/silicon/catalog.html';
}
if (77 == x && z == 'c') {
document.getElementById(z+'m').style.color = '#CC0000';
z = z + 'm';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (77 == x && z == 'cm') {
document.getElementById(z+'m').style.color = '#CC0000';
window.location = 'http://aurorachan.net/mu/';
}
if (84 == x && z == 'cm') {
document.getElementById(z+'t').style.color = '#CC0000';
window.location = 'https://sushigirl.us/tunes/catalog.html';
}
if (78 == x && z == 'c') {
document.getElementById(z+'n').style.color = '#CC0000';
window.location = 'http://boards.4chan.org/n';
}
if (90 == x && z == 'c') {
document.getElementById(z+'z').style.color = '#CC0000';
window.location = 'http://boards.4chan.org/news';
}
if (79 == x && z == 'c') {
document.getElementById(z+'o').style.color = '#CC0000';
z = z + 'o';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (79 == x && z == 'co') {
document.getElementById(z+'o').style.color = '#CC0000';
window.location = 'https://uboachan.net/ot/catalog.html';
}
if (76 == x && z == 'co') {
document.getElementById(z+'l').style.color = '#CC0000';
window.location = 'https://sushigirl.us/lounge/catalog.html';
}
if (67 == x && z == 'c') {
document.getElementById(z+'c').style.color = '#CC0000';
window.location = 'https://lainchan.org/cyb/catalog.html';
}
if (76 == x && z == 'c') {
document.getElementById(z+'l').style.color = '#CC0000';
window.location = 'https://lainchan.org/lit/catalog.html';
}
if (80 == x && z == 'c') {
document.getElementById(z+'p').style.color = '#CC0000';
window.location = 'https://lainchan.org/%CE%BB/catalog.html';
}
if (88 == x && z == 'c') {
document.getElementById(z+'x').style.color = '#CC0000';
window.location = 'https://lainchan.org/art/catalog.html';
}
if (86 == x && z == '') {
document.getElementById(z+'v').style.color = '#CC0000';
window.location = 'https://volafile.io/r/kUFzLJ';
}
if (84 == x && z == '') {
document.getElementById(z+'t').style.color = '#CC0000';
z = z + 't';
var x = document.getElementsByClassName(z);
for (var i = 0; i < x.length; i++) { x[i].style.display = 'inline-block'; }
var x = document.getElementById(z);
x.onclick = function() { key({keyCode: 27}) }
}
if (48 == x && z == 't') {
document.getElementById(z+'0').style.color = '#CC0000';
window.location = 'https://www.youtube.com/playlist?list=PLIKcw9O7i0KR4Q-pC-7MLb_DoRmzYOCUw';
}
if (49 == x && z == 't') {
document.getElementById(z+'1').style.color = '#CC0000';
window.location = 'https://www.youtube.com/playlist?list=PLIKcw9O7i0KRZ43r5UVGNraUgvyPaUMBU';
}
if (50 == x && z == 't') {
document.getElementById(z+'2').style.color = '#CC0000';
window.location = 'https://www.youtube.com/playlist?list=PLIKcw9O7i0KQO4aHOqypivLefSFKq2vp1';
}
if (51 == x && z == 't') {
document.getElementById(z+'3').style.color = '#CC0000';
window.location = 'https://www.youtube.com/playlist?list=PLIKcw9O7i0KSeW6AmMmg3D4etDs5YeX8q';
}
}
document.onkeydown = key;
</script></head>
<body class="hasGoogleVoiceExt"><div id="content">
<a class='' id='r' onclick='key({keyCode:82})'>/r/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='r' id='ra' style='display: none;' onclick='key({keyCode:65})'>/all</a>
<br />
<a class='r' id='rt' style='display: none;' onclick='key({keyCode:84})'>/top</a>
<br />
<a class='r' id='rn' style='display: none;' onclick='key({keyCode:78})'>/new</a>
<br />
<a class='r' id='rs' style='display: none;' onclick='key({keyCode:83})'>/shithole</a>
<br />
</span>
<br />
<a class='' id='c' onclick='key({keyCode:67})'>/chan/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='c' id='ck' style='display: none;' onclick='key({keyCode:75})'>/ck</a>
<br />
<a class='c' id='cp' style='display: none;' onclick='key({keyCode:80})'>/pro</a>
<br />
<a class='c' id='ct' style='display: none;' onclick='key({keyCode:84})'>/tech/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='ct' id='ctl' style='display: none;' onclick='key({keyCode:76})'>/laintech</a>
<br />
<a class='ct' id='ctd' style='display: none;' onclick='key({keyCode:68})'>/desutech</a>
<br />
<a class='ct' id='ctg' style='display: none;' onclick='key({keyCode:71})'>/g</a>
<br />
<a class='ct' id='cts' style='display: none;' onclick='key({keyCode:83})'>/silicon</a>
<br />
</span>
<br />
<a class='c' id='cm' style='display: none;' onclick='key({keyCode:77})'>/music/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='cm' id='cmm' style='display: none;' onclick='key({keyCode:77})'>/mu</a>
<br />
<a class='cm' id='cmt' style='display: none;' onclick='key({keyCode:84})'>/tunes</a>
<br />
</span>
<br />
<a class='c' id='cn' style='display: none;' onclick='key({keyCode:78})'>/transport</a>
<br />
<a class='c' id='cz' style='display: none;' onclick='key({keyCode:90})'>/news</a>
<br />
<a class='c' id='co' style='display: none;' onclick='key({keyCode:79})'>/off_topic/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='co' id='coo' style='display: none;' onclick='key({keyCode:79})'>/ot</a>
<br />
<a class='co' id='col' style='display: none;' onclick='key({keyCode:76})'>/lounge</a>
<br />
</span>
<br />
<a class='c' id='cc' style='display: none;' onclick='key({keyCode:67})'>/cyb</a>
<br />
<a class='c' id='cl' style='display: none;' onclick='key({keyCode:76})'>/lit</a>
<br />
<a class='c' id='cp' style='display: none;' onclick='key({keyCode:80})'></a>
<br />
<a class='c' id='cx' style='display: none;' onclick='key({keyCode:88})'>/art</a>
<br />
</span>
<br />
<a class='' id='v' href='https://volafile.io/r/kUFzLJ' onclick='key({keyCode:86})'>/vola</a>
<br />
<a class='' id='t' onclick='key({keyCode:84})'>/tube/</a>
<span style='position: absolute; left: 200px; top: 0px;'>
<a class='t' id='t0' style='display: none;' onclick='key({keyCode:48})'>/0</a>
<br />
<a class='t' id='t1' style='display: none;' onclick='key({keyCode:49})'>/1</a>
<br />
<a class='t' id='t2' style='display: none;' onclick='key({keyCode:50})'>/2</a>
<br />
<a class='t' id='t3' style='display: none;' onclick='key({keyCode:51})'>/3</a>
<br />
</span>
<br />
</div></body></html>

26
style.css Normal file
View File

@ -0,0 +1,26 @@
body {
font-family:helvetica;
background:url("background.png") no-repeat center center fixed;
}
#content {
width:90%;
margin-left:auto;
margin-right:auto;
top:50px;
font-family: "Helvetica", Helvetica, sans-serif;
height:90%;
/*color: #595959;*/
color: #eeeeee;
position:relative;
top:50px;
transition: color .5s ease-in-out;
}
a {
font-size: 24px;
/*color: #595959;*/
color: #eeeeee;
text-decoration: none;
}
a:hover {
text-decoration:underline;;
}