Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / menu.js
diff options
context:
space:
mode:
Commit53c352887fdb3e0345e97c2760d8f7985a1bfc48 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-28 13:01:49 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-28 13:01:49 +0300
Files4ca4700916a35a216a96ac7c347a5ad1b33a4ef2 /Year 2/Computer Graphics with WebGL/Project/menu.js
uni-projects-53c352887fdb3e0345e97c2760d8f7985a1bfc48.tar
uni-projects-53c352887fdb3e0345e97c2760d8f7985a1bfc48.tar.gz
uni-projects-53c352887fdb3e0345e97c2760d8f7985a1bfc48.zip
Parent8861a3e72f28f1757954c7f20ebeb469980f573a (diff)
[WGL/P] Added a lot of comments and reworked formatting of certain code
1 files changed, 4 insertions, 2 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/menu.js6
diff --git a/Year 2/Computer Graphics with WebGL/Project/menu.js b/Year 2/Computer Graphics with WebGL/Project/menu.js
index 10cac05..6a86f1e 100644
--- a/Year 2/Computer Graphics with WebGL/Project/menu.js
+++ b/Year 2/Computer Graphics with WebGL/Project/menu.js
@@ -1,3 +1,6 @@
+/* Logic for all controls in the sidebar */
+
+// Since we have gl context, initialise whatever needs it
function initMenu() {
initLevels();
debugChange.call(debugModeCB);
@@ -8,7 +11,7 @@ function initMenu() {
const levelSelect = document.getElementById('level-select');
const levelDesc = document.getElementById('level-description');
-
+// Add levels to dropdown box
function initLevels() {
for (var i = 0; i < levels.length; i++) {
var elem = document.createElement('option');
@@ -18,7 +21,6 @@ function initLevels() {
}
levelChange.call(levelSelect);
}
-
function levelChange() {
levelDesc.innerText = levels[this.value].description;
levels[this.value].load();