diff --git a/favicon.xcf b/favicon.xcf new file mode 100644 index 0000000..d3bb65b Binary files /dev/null and b/favicon.xcf differ diff --git a/web/css/style.css b/web/css/style.css new file mode 100644 index 0000000..40d03f2 --- /dev/null +++ b/web/css/style.css @@ -0,0 +1,43 @@ +html { + height: 100vh; +} + +body { + margin: 0; + background-image: url('../img/bg-winter.jpg'); + background-position: center; + background-size: cover; +} + +details { + margin: 0.5em; + padding: 0.5em; + border-radius: 0.5em; + background: rgba(255,255,255,0.8); +} + +summary h2 { + display: inline; + font-size: 1.2em; +} + +summary a { + float: right; +} + +summary a img { + height: 1.2em; +} + +iframe { + width: 100%; + border: 0; +} + +#status { + height: 220px; +} + +#map { + height: 80vh; +} diff --git a/svg.css b/web/css/svg.css similarity index 62% rename from svg.css rename to web/css/svg.css index 94907d9..61ca680 100644 --- a/svg.css +++ b/web/css/svg.css @@ -1,10 +1,9 @@ -.overflow { - overflow-x: auto; - max-width: 100%; +body { + margin: 0; + padding: 0; } #graph { - background-color: #EEE; transform: scaleY(-1); } @@ -16,7 +15,7 @@ line { stroke: black; - stroke-width: 0.4; + stroke-width: 0.8; } line.error { @@ -24,5 +23,5 @@ line.error { } line:hover { - stroke-width: 0.6; + stroke-width: 1.0; } diff --git a/web/img/bg-winter.jpg b/web/img/bg-winter.jpg new file mode 100644 index 0000000..72ceea5 Binary files /dev/null and b/web/img/bg-winter.jpg differ diff --git a/web/img/favicon.png b/web/img/favicon.png new file mode 100644 index 0000000..56eebad Binary files /dev/null and b/web/img/favicon.png differ diff --git a/web/img/feather-external-link.svg b/web/img/feather-external-link.svg new file mode 100644 index 0000000..6236df3 --- /dev/null +++ b/web/img/feather-external-link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..4fbbc4a --- /dev/null +++ b/web/index.html @@ -0,0 +1,29 @@ + + + + + + xkcraftia status + + + + + +
+ +

Server status

+ open +
+ show last hour, 24 hours, 1 month, 4 months, 18 months: + +
+
+ +

Map

+ open +
+ + +
+ + diff --git a/web/js/load-map.js b/web/js/load-map.js new file mode 100644 index 0000000..1346a85 --- /dev/null +++ b/web/js/load-map.js @@ -0,0 +1,12 @@ +// 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/svg-click.js b/web/js/svg-click.js new file mode 100644 index 0000000..b9a1f4f --- /dev/null +++ b/web/js/svg-click.js @@ -0,0 +1,9 @@ +// add a simple click event to the SVG for browsers that don't allow you to hover +document.addEventListener('DOMContentLoaded', (event) => { + document.querySelector('svg').addEventListener('click', (event) => { + const maybeTitle = event.target.firstChild + + if (maybeTitle instanceof SVGTitleElement) + alert(maybeTitle.textContent) + }) +})