commit 66612c01ec1d2119353fa8c1d8012358ae0daacc Author: Tyler Hallada Date: Thu Nov 30 16:07:27 2017 -0500 Add site to git repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69916f6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +server.log +map diff --git a/css/styles.css b/css/styles.css new file mode 100644 index 0000000..d043ab3 --- /dev/null +++ b/css/styles.css @@ -0,0 +1,79 @@ +body { + max-width: 650px; + margin: 0 auto; + padding: 10px; + background-color: floralwhite; + color: #1B1B1B; + font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; +} + +img { + width: 98%; + max-width: 500px; + margin: 0 auto; + display: block; + border: 1px solid grey; + border-radius: 3px; +} + +ol li code { + font-size: large; +} + +.label { + font-weight: bold; +} + +.small-text { + font-size: small; +} + +.monospace { + font-family: monospace; +} + +.inline { + display: inline-block; +} + +#server-status { + display: none; + padding: 10px; + margin: 10px; + border: 1px solid darkgrey; + max-width: 600px; +} + +#server-status-error { + padding: 10px; + margin: 10px; + border: 1px solid darkgrey; + max-width: 600px; +} + +#status-online { + display: none; + color: darkgreen; +} + +#status-offline { + color: darkred; +} + +#server-status div { + margin-bottom: 2px; +} + +#map-link { + display: block; + text-align: center; +} + +#server-log { + padding: 10px; + margin: 10px; + border: 1px solid darkgrey; + max-width: 1000px; + max-height: 600px; + overflow: scroll; +} diff --git a/img/bridge.jpg b/img/bridge.jpg new file mode 100755 index 0000000..81f09dc Binary files /dev/null and b/img/bridge.jpg differ diff --git a/img/map.jpg b/img/map.jpg new file mode 100755 index 0000000..da0b617 Binary files /dev/null and b/img/map.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..287cf2a --- /dev/null +++ b/index.html @@ -0,0 +1,93 @@ + + + Panic Shack - Minecraft Server + + + + + + +

Panic Shack - Minecraft Server

+ Screenshot from the Minecraft server of a bridge over a lake in a jungle biome + +

Server Status

+
+ Loading... +
+
+
+ Status:  + Online + Offline +
+
+ +
+
+ Players:  + / +
+
+
+ Host:  + panic-shack.hallada.net  +
+
+ Port:  + 25565 +
+
+
+
+ Version:  +   +
+
+ Protocol:  + +
+
+
+ Last Online:  + +
+
+ Last Updated:  + +
+
+ +

How to Connect

+
    +
  1. Launch Minecraft (version 1.12.2)
  2. +
  3. Go to "Multiplayer"
  4. +
  5. Click "Add Server"
  6. +
  7. Enter Panic Shack for the "Server Name"
  8. +
  9. Enter panic-shack.hallada.net for the "Server Address"
  10. +
  11. Click "Done"
  12. +
  13. You should now see the server in the list and be able to join it!
  14. +
+ +

Server Map

+ + Screenshot from the in-browser map of the server centered on the lake and bridge + View the server map + +

+ Map is updated every Sunday around 3 am EST. +

+ +

Server Log

+

+        
+        

Updated every 10 seconds.

+ + + + + + + diff --git a/js/getLog.js b/js/getLog.js new file mode 100644 index 0000000..1b347af --- /dev/null +++ b/js/getLog.js @@ -0,0 +1,21 @@ +var output = document.getElementById('server-log'); + +function reqListener() { + var autoScroll = document.getElementById('auto-scroll'); + output.textContent = xhr.responseText; + if (autoScroll.checked) { + output.scrollTop = output.scrollHeight; + } +} + +var xhr = new XMLHttpRequest(); +xhr.addEventListener('load', reqListener); +xhr.open('GET', '/server.log'); +xhr.send(); + +setInterval(function() { + xhr = new XMLHttpRequest(); + xhr.addEventListener('load', reqListener); + xhr.open('GET', '/server.log'); + xhr.send(); +}, 10000); diff --git a/js/getStatus.js b/js/getStatus.js new file mode 100644 index 0000000..411f2bf --- /dev/null +++ b/js/getStatus.js @@ -0,0 +1,29 @@ +MinecraftAPI.getServerStatus('panic-shack.hallada.net', { + port: 25565 +}, function (err, status) { + var serverError = document.getElementById('server-status-error'); + var serverStatus = document.getElementById('server-status'); + + if (err) { + serverError.style.color = 'red'; + return serverError.textContent = 'Error loading server status'; + } else { + serverError.style.display = 'none'; + } + + serverStatus.style.display = 'block'; + + if (status.online == true) { + document.getElementById('status-online').style.display = 'inline-block'; + document.getElementById('status-offline').style.display = 'none'; + } + + document.getElementById('status-motd').textContent = status.motd; + document.getElementById('status-players-now').textContent = status.players.now; + document.getElementById('status-players-max').textContent = status.players.max; + document.getElementById('status-server-name').textContent = status.server.name; + document.getElementById('info-server-name').textContent = status.server.name; + document.getElementById('status-server-protocol').textContent = status.server.protocol; + document.getElementById('status-last-online').textContent = moment.unix(parseInt(status.last_online, 10)).fromNow(); + document.getElementById('status-last-updated').textContent = moment.unix(parseInt(status.last_updated, 10)).fromNow(); +});