diff --git a/update-status.py b/update-status.py
index 23cb4b8..335be1c 100644
--- a/update-status.py
+++ b/update-status.py
@@ -32,7 +32,7 @@ def new_state_and_log():
with open(log_path+'current-state.json', 'r') as fin:
prev = loads(fin.read())
- if cur['time'] - prev['period'][1] > 90:
+ if cur['time'] - prev['period'][1] > 110:
log(prev)
log({'period': [prev['period'][1], cur['time']], 'status': 'monitor-offline' })
return {'period': [cur['time'],cur['time']], 'status': cur['status'], 'players': cur['players']}
diff --git a/web/index.html b/web/index.html
index 4fbbc4a..0884593 100644
--- a/web/index.html
+++ b/web/index.html
@@ -6,12 +6,12 @@
xkcraftia status
-
+
- Server status
+ Server status
show last hour, 24 hours, 1 month, 4 months, 18 months:
@@ -19,7 +19,7 @@
- Map
+ Map
diff --git a/web/js/load-map.js b/web/js/load-map.js
deleted file mode 100644
index 1346a85..0000000
--- a/web/js/load-map.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// only load the map viewer when it's visible (and javascript is enabled)
-document.addEventListener('DOMContentLoaded', (event) => {
- const setMap = () => { document.querySelector('#map').src = 'map/' }
- const details = document.querySelector('details:last-child')
-
- // if is not supported (looking at you, Edge), the frame will be
- // visible by default, so just set the target immediately
- if ('open' in details)
- details.addEventListener('toggle', setMap, { once: true })
- else
- setMap()
-})
diff --git a/web/js/main.js b/web/js/main.js
new file mode 100644
index 0000000..7dfa595
--- /dev/null
+++ b/web/js/main.js
@@ -0,0 +1,26 @@
+document.addEventListener('DOMContentLoaded', (event) => {
+ // Only load the map viewer when it's visible (and javascript is enabled).
+ const setMap = () => { document.querySelector('#map').src = 'map/' }
+ const details = document.querySelector('details:last-child')
+
+ // If is not supported (looking at you, Edge), the frame will be
+ // visible by default, so just set the target immediately.
+ if ('open' in details)
+ details.addEventListener('toggle', setMap, { once: true })
+ else
+ setMap()
+
+
+ // For custom (dark) CSS themes, set the background to the inverse of
+ // the text colour.
+ const parseColour = (str) => str.match(/([0-9.]+)/g).map(parseFloat)
+ const dumpColour = (col) => `rgba(${col.join(',')})`
+ const textColour = parseColour(window.getComputedStyle(document.body).getPropertyValue('color'))
+ const invertedColour = [255-textColour[0], 255-textColour[1], 255-textColour[2], 0.8]
+ const sheet = document.styleSheets[0]
+ sheet.insertRule(`
+ details {
+ background-color: ${dumpColour(invertedColour)} !important;
+ }`
+ )
+})