Skip to content
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
clones
venv
__pycache__/
*.pyc
Comment thread
m-aciek marked this conversation as resolved.
17 changes: 17 additions & 0 deletions templates/index.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,22 @@
updateProgressBarVisibility();

window.addEventListener('resize', updateProgressBarVisibility);

(function () {
const userLangs = Array.from(navigator.languages || []).map(lang => lang.toLowerCase());
const row = document.querySelector('.row');
if (!row || !userLangs.length) return;

for (const lang of [...userLangs].reverse()) {
const langBase = lang.split('-')[0];
const card = row.querySelector(`[id="${lang}"]`) || row.querySelector(`[id="${langBase}"]`);
if (card) {
const col = card.closest('.col-12');
if (col && col.parentElement === row) {
row.prepend(col);
}
}
}
})();
</script>
{% endblock %}
Loading