Skip to content

Commit 3b4de28

Browse files
committed
Randomise case studies
1 parent 73db558 commit 3b4de28

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

case-studies.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lux: "Case Studies"
2121
{% include css/components.feature-list.css %}
2222
</style>
2323

24-
<ul class="feature-list">
24+
<ul class="feature-list" id="jsCaseStudiesList">
2525

2626
<li class="feature-list__item">
2727
<a href="iso-org/" class="feature-list__link" style="background-color: #e30010;">
@@ -142,3 +142,18 @@ lux: "Case Studies"
142142
{% endcomment %}
143143

144144
</ul>
145+
146+
<script>
147+
(() => {
148+
const list = document.getElementById('jsCaseStudiesList');
149+
const listItems = Array.from(list.children);
150+
151+
for (let i = listItems.length - 1; i > 0; i--) {
152+
const j = Math.floor(Math.random() * (i + 1));
153+
[listItems[i], listItems[j]] = [listItems[j], listItems[i]];
154+
}
155+
156+
list.innerHTML = '';
157+
list.append(...listItems);
158+
})();
159+
</script>

0 commit comments

Comments
 (0)