commit 2e46aab9bdaac6b9b60a1d7ac8ccce2accf1fefa Author: Niles Rogoff Date: Sun Jun 26 13:45:51 2016 -0400 Initial commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..20a1744 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +all: + python3 generate.py > index.html diff --git a/background.png b/background.png new file mode 100755 index 0000000..e01b951 Binary files /dev/null and b/background.png differ diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..241e01d --- /dev/null +++ b/generate.py @@ -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(["", f[0], ""])) + if type(f[2]) != str: + result.append("") + for l in f[2]: + result.append(rhtml(l, z + f[1])) + result.append("") + result.append("
") + 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 = [""" + + +""") +master.append("""
""") +for f in l: + master.append(rhtml(f, "")) +master.append("""
""") +master = "\n".join(master) +print(master) diff --git a/index.html b/index.html new file mode 100644 index 0000000..2a9de48 --- /dev/null +++ b/index.html @@ -0,0 +1,293 @@ + + + + +
+/r/ + + +
+ +
+ +
+ +
+
+
+/chan/ + + +
+ +
+ + + +
+ +
+ +
+ +
+
+
+ + + +
+ +
+
+
+ +
+ +
+ + + +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+/vola +
+/tube/ + + +
+ +
+ +
+ +
+
+
+
diff --git a/style.css b/style.css new file mode 100644 index 0000000..d22439e --- /dev/null +++ b/style.css @@ -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;; +}