-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
142 lines (136 loc) · 4.56 KB
/
index.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!doctype html>
<html>
<head>
<title>
Standards
</title>
<base target="_blank">
<script src="https://epicenterprograms.github.io/standards/behavior/general.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.6.1/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.6.1/firebase-firestore.js"></script>
<script src="https://epicenterprograms.github.io/standards/behavior/firebaseinit.js"></script>
<script src="https://epicenterprograms.github.io/standards/behavior/storage.js"></script>
<script>
var S = Standards.general;
var M = Standards.storage;
S.onLoad(function () {
let contents = [
["cracking.mp3", "testing.mp3"], // audio
["firebaseinit.js", "game.js", "general.js", "navigation.js", "presentation.js", "storage.js"], // behavior
["black circle.ico", "blue circle.ico", "cyan circle.ico", "green circle.ico", "magenta circle.ico", "no icon.ico", "purple circle.ico", "red circle.ico", "yellow circle.ico"], // favicons
["Bad Duck.ttf", "Braille.ttf"], // fonts
["christmas.css", "foundation.css", "fourthofjuly.css", "game.css", "halloween.css", "presentation.css", "thanksgiving.css"], // formatting
["star.svg"] // icons
];
let maxIndex = 0;
S.forEach(contents, function (folder) {
if (folder.length - 1 > maxIndex) {
maxIndex = folder.length - 1;
}
});
S.forEach(maxIndex + 1, function (_, index) {
let row = S.getId("repositoryContents").insertRow(-1);
S.forEach(contents, function (folder, column) {
let file = document.createElement("td");
let link = "";
if (folder[index]) {
link = "<a href='https://epicenterprograms.github.io/standards/"
+ S.getId("repositoryContents").getElementsByTagName("th")[column + 1].textContent
+ folder[index]
+ "'>"
+ folder[index]
+ "</a>";
}
file.innerHTML = link;
row.appendChild(file);
});
});
let holidayStyling = document.createElement("link");
holidayStyling.rel = "stylesheet";
holidayStyling.href = "https://epicenterprograms.github.io/standards/formatting/";
switch (new Date().getMonth() + 1) {
case 7:
holidayStyling.href += "fourthofjuly.css";
document.head.appendChild(holidayStyling);
break;
case 10:
holidayStyling.href += "halloween.css";
document.head.appendChild(holidayStyling);
break;
case 11:
holidayStyling.href += "thanksgiving.css";
document.head.appendChild(holidayStyling);
break;
case 12:
holidayStyling.href += "christmas.css";
document.head.appendChild(holidayStyling);
break;
}
});
S.listen("showAdmins", "click", function () {
S.makeDialog(M.server.recall("/admin/permissions/full").join("<br>"), "Done");
});
S.listen("showUsers", "click", function () {
S.makeDialog(M.server.list("/users", { shallowKeyList: true }).join("<br>"), "Done");
});
firebase.auth().onAuthStateChanged(function (person) {
if (person && M.server.recall("/admin/permissions/full").includes(person.uid)) { // if an administrative user signed in
S.getId("adminControls").style.display = "block";
} else {
S.getId("adminControls").style.display = "none";
}
});
</script>
<link rel="stylesheet" href="https://epicenterprograms.github.io/standards/formatting/foundation.css">
<style>
#adminControls {
display: none;
}
</style>
</head>
<body>
<h1 class="main-title">
Standards
</h1>
<div class="user-section">
<button id="signIn">
Log in
</button>
<button id="signUp">
Register
</button>
<button id="userSettings">
Settings
</button>
<button id="signOut">
Log out
</button>
</div>
<main>
<section>
This website hosts the standards I use elsewhere. The GitHub repository for this site can be found <a href="https://github.com/EpicenterPrograms/standards">here</a>. The most useful standards to link to are the script reference at general.js and the style sheet reference at foundation.css. The contents of this repository are summarized below.
</section>
<table id="repositoryContents">
<tr>
<th colspan="6">https://epicenterprograms.github.io/standards/</th>
</tr>
<tr>
<th>audio/</th>
<th>behavior/</th>
<th>favicons/</th>
<th>fonts/</th>
<th>formatting/</th>
<th>icons/</th>
</tr>
</table>
<div id="adminControls">
<button id="showAdmins">
Show users
</button>
<button id="showUsers">
Show users
</button>
</div>
</main>
</body>
</html>