Skip to content

Commit 96acef2

Browse files
Zach 'Phar' ParksJames McIntosh
authored andcommitted
WebHost: Remove styleController.js and replace functionality with HTML/CSS. (ArchipelagoMW#4852)
* ensure footer stays at bottom of page without JS * Remove some other usages.
1 parent 2ba08f4 commit 96acef2

File tree

13 files changed

+30
-73
lines changed

13 files changed

+30
-73
lines changed

WebHostLib/static/assets/gameInfo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ window.addEventListener('load', () => {
2323
showdown.setOption('strikethrough', true);
2424
showdown.setOption('literalMidWordUnderscores', true);
2525
gameInfo.innerHTML += (new showdown.Converter()).makeHtml(results);
26-
adjustHeaderWidth();
2726

2827
// Reset the id of all header divs to something nicer
2928
for (const header of document.querySelectorAll('h1, h2, h3, h4, h5, h6')) {

WebHostLib/static/assets/hostGame.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ window.addEventListener('load', () => {
66
document.getElementById('file-input').addEventListener('change', () => {
77
document.getElementById('host-game-form').submit();
88
});
9-
10-
adjustFooterHeight();
119
});

WebHostLib/static/assets/styleController.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

WebHostLib/static/assets/tutorial.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ window.addEventListener('load', () => {
2525
showdown.setOption('literalMidWordUnderscores', true);
2626
showdown.setOption('disableForced4SpacesIndentedSublists', true);
2727
tutorialWrapper.innerHTML += (new showdown.Converter()).makeHtml(results);
28-
adjustHeaderWidth();
2928

3029
const title = document.querySelector('h1')
3130
if (title) {

WebHostLib/static/styles/globalStyles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ html{
3636

3737
body{
3838
margin: 0;
39+
display: flex;
40+
flex-direction: column;
41+
min-height: calc(100vh - 110px);
42+
}
43+
44+
main {
45+
flex-grow: 1;
3946
}
4047

4148
a{

WebHostLib/templates/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends 'pageWrapper.html' %}
22
{% import "macros.html" as macros %}
3+
{% set show_footer = True %}
34

45
{% block head %}
56
<title>Page Not Found (404)</title>
@@ -13,5 +14,4 @@ <h1>This page is out of logic!</h1>
1314
The page you're looking for doesn&apos;t exist.<br />
1415
<a href="/">Click here to return to safety.</a>
1516
</div>
16-
{% include 'islandFooter.html' %}
1717
{% endblock %}

WebHostLib/templates/hostGame.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends 'pageWrapper.html' %}
2+
{% set show_footer = True %}
23

34
{% block head %}
45
<title>Upload Multidata</title>
@@ -27,6 +28,4 @@ <h1>Host Game</h1>
2728
</div>
2829
</div>
2930
</div>
30-
31-
{% include 'islandFooter.html' %}
3231
{% endblock %}

WebHostLib/templates/landing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends 'pageWrapper.html' %}
2+
{% set show_footer = True %}
23

34
{% block head %}
45
<title>Archipelago</title>
@@ -57,5 +58,4 @@ <h4>multiworld multi-game randomizer</h4>
5758
</div>
5859
</div>
5960
</div>
60-
{% include 'islandFooter.html' %}
6161
{% endblock %}

WebHostLib/templates/pageWrapper.html

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,29 @@
55
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/tooltip.css") }}" />
66
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/cookieNotice.css") }}" />
77
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/globalStyles.css") }}" />
8-
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/styleController.js") }}"></script>
98
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/cookieNotice.js") }}"></script>
109
{% block head %}
1110
<title>Archipelago</title>
1211
{% endblock %}
1312
</head>
1413
<body>
14+
<main>
15+
{% with messages = get_flashed_messages() %}
16+
{% if messages %}
17+
<div>
18+
{% for message in messages | unique %}
19+
<div class="user-message">{{ message }}</div>
20+
{% endfor %}
21+
</div>
22+
{% endif %}
23+
{% endwith %}
1524

16-
{% with messages = get_flashed_messages() %}
17-
{% if messages %}
18-
<div>
19-
{% for message in messages | unique %}
20-
<div class="user-message">{{ message }}</div>
21-
{% endfor %}
22-
</div>
23-
{% endif %}
24-
{% endwith %}
25-
26-
{% block body %}
27-
{% endblock %}
25+
{% block body %}
26+
{% endblock %}
27+
</main>
2828

29+
{% if show_footer %}
30+
{% include "islandFooter.html" %}
31+
{% endif %}
2932
</body>
3033
</html>

WebHostLib/templates/seedError.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends 'pageWrapper.html' %}
22
{% import "macros.html" as macros %}
3+
{% set show_footer = True %}
34

45
{% block head %}
56
<title>Generation failed, please retry.</title>
@@ -15,5 +16,4 @@ <h2>please retry</h2>
1516
{{ seed_error }}
1617
</div>
1718
</div>
18-
{% include 'islandFooter.html' %}
1919
{% endblock %}

0 commit comments

Comments
 (0)