Skip to content

Commit e286ec5

Browse files
committed
Add a way to fold the apworld tables
1 parent 4e3c0c2 commit e286ec5

File tree

5 files changed

+42
-10
lines changed

5 files changed

+42
-10
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/base.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/sass/base.sass

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,3 +760,13 @@ dialog::backdrop
760760
body:has(dialog[open])
761761
overflow: hidden
762762
scrollbar-gutter: stable
763+
764+
.clickable
765+
cursor: pointer
766+
767+
.hidden-table
768+
display: none
769+
margin-bottom: 10em
770+
771+
.visible-table
772+
display: table

templates/apworlds.html

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
{% block menu %}
44
{% endblock %}
55

6-
{% macro apworlds_table(apworlds) %}
7-
8-
<table class="styled yamls">
6+
{% macro apworlds_table(apworlds, id) %}
7+
<table class="styled yamls" id="{{id}}">
98
<thead>
109
<tr>
1110
<td>World</td>
@@ -59,13 +58,36 @@
5958

6059
{% endif %}
6160
</table>
62-
<h6><a href="{{ index.common.archipelago_repo }}">Official apworlds</a></h6>
63-
{% call apworlds_table(supported_apworlds) %}
64-
<h6>Unofficial apworlds <i class="fa fa-warning" title="Those are unsupported apworlds, please always be careful when generating with them"></i></h6>
65-
{% call apworlds_table(unsupported_apworlds) %}
61+
<h6 style="margin-bottom: 1em;"><a href="{{ index.common.archipelago_repo }}">Official apworlds ({{index.common.archipelago_version}})</a> <span id="official-visibility" class="clickable">(Hide)</span></h6>
62+
{% call apworlds_table(supported_apworlds, "official") %}
63+
64+
<h6 style="margin-bottom: 1em;">Unofficial apworlds <i class="fa fa-warning" title="Those are unsupported apworlds, please always be careful when generating with them"></i> <span id="unsupported-visibility" class="clickable">(Hide)</span></h6>
65+
{% call apworlds_table(unsupported_apworlds, "unsupported") %}
6666
{%endblock%}
6767

6868
{% block scripts %}
69+
<script>
70+
function setupHideableTable(spanId, tableId) {
71+
const span = document.getElementById(spanId);
72+
const table = document.getElementById(tableId);
73+
74+
span.onclick = () => {
75+
if (table.className.includes("hidden-table")) {
76+
span.innerText = "(Hide)";
77+
table.className = "styled yamls visible-table";
78+
} else {
79+
span.innerText = "(Show)";
80+
table.className = "styled yamls hidden-table";
81+
}
82+
}
83+
}
84+
85+
setupHideableTable("official-visibility", "official");
86+
setupHideableTable("unsupported-visibility", "unsupported");
87+
88+
const officialSpan = document.getElementById("official-visibility").click()
89+
</script>
90+
6991
{% endblock %}
7092

7193
{% block styles %}

0 commit comments

Comments
 (0)