From 6049f42582d6bbbd936a3273a87f1069a5769d1c Mon Sep 17 00:00:00 2001 From: Random <28494085+Random06457@users.noreply.github.com> Date: Wed, 27 May 2020 01:11:41 +0200 Subject: [PATCH] add progress page --- index.html | 71 +++++++++++++++++++++++++++------------------------ progress.css | 0 progress.html | 28 ++++++++++++++++++++ progress.js | 39 ++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 34 deletions(-) create mode 100644 progress.css create mode 100644 progress.html create mode 100644 progress.js diff --git a/index.html b/index.html index bffd22e..fbebfd3 100644 --- a/index.html +++ b/index.html @@ -1,34 +1,37 @@ - - - - - -Z64 - - -
-
- -
-
-

Zelda 64 Reverse Engineering

-

Join the discussion!

-

Discord: discord.zelda64.dev

- -

Development

-

Github: github.com/zeldaret

-

OOT Trello: trello.com/b/qUqnUkWY/ocarina-of-time-decompilation

-

MM Trello: https://trello.com/b/ruxw9n6m/majoras-mask-decompilation

- -

Resources

-

Hex to float converter

-

Gfx Decompilation Guide

-

OoT Debug Source Code Structure

-CloudModding Wiki - -
-
- - + + + + + + + Z64 + + + +
+
+ +
+
+

Zelda 64 Reverse Engineering

+

Join the discussion!

+

Discord: discord.zelda64.dev

+ +

Development

+

Github: github.com/zeldaret

+

OOT Trello: trello.com/b/qUqnUkWY/ocarina-of-time-decompilation

+

MM Trello: https://trello.com/b/ruxw9n6m/majoras-mask-decompilation

+ +

Resources

+

Hex to float converter

+

Gfx Decompilation Guide

+

OoT Debug Source Code Structure

+ CloudModding Wiki + +
+
+ + + \ No newline at end of file diff --git a/progress.css b/progress.css new file mode 100644 index 0000000..e69de29 diff --git a/progress.html b/progress.html new file mode 100644 index 0000000..75dcbb0 --- /dev/null +++ b/progress.html @@ -0,0 +1,28 @@ + + + + + + + + Z64 + + + +
+
+ +
+
+

Current Progress

+

Last Change:

+
+

Total:

+

Boot:

+

Code:

+

Overlays:

+
+
+ + + diff --git a/progress.js b/progress.js new file mode 100644 index 0000000..69b355b --- /dev/null +++ b/progress.js @@ -0,0 +1,39 @@ +var url = "https://zelda64.dev/reports/progress.json"; + +function getJSON(file, callback) { + var req = new XMLHttpRequest(); + req.overrideMimeType("application/json"); + req.open("GET", file, true); + req.onreadystatechange = function() { + if (req.readyState === 4 && req.status == "200") { + callback(req.responseText); + } + } + req.send(null); +} + +function setText(classname, value) +{ + var elem = document.getElementsByClassName(classname); + if (elem.length == 1) + { + console.log(value); + elem[0].innerText = value; + } +} + +window.onload = function() { + + getJSON(url, function(text){ + var json = JSON.parse(text); + var progress = JSON.parse(json); + var timestamp = Object.keys(progress.reports)[0]; + var date = new Date(timestamp.split(".")[0] *1000); + setText("last_change", date); + + var keys = Object.keys(progress.reports[timestamp]); + keys.forEach(e => { + setText(e, progress.reports[timestamp][e] + "%"); + }); + }); +};