mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 21:18:01 +02:00
closes #137, improve a11y
This commit is contained in:
parent
6133a796fc
commit
acdadc6c89
9 changed files with 153 additions and 137 deletions
|
@ -33,27 +33,24 @@ async function getCharts() {
|
|||
id.value = json.options.all.find(i => i.title == json.options.default).id;
|
||||
|
||||
for (const country of json.options.all) {
|
||||
const countryLocaleId = `countries.${country.id}`;
|
||||
const locId = `countries.${country.id}`,
|
||||
cc = t(locId);
|
||||
|
||||
if (t(countryLocaleId) !== countryLocaleId) {
|
||||
country.title = t(countryLocaleId);
|
||||
}
|
||||
if (cc !== locId) country.title = cc;
|
||||
}
|
||||
|
||||
data.options = json.options.all.sort((a, b) => {
|
||||
return a.title.localeCompare(b.title);
|
||||
});
|
||||
data.options = [];
|
||||
for (const _ of Array(2)) data.options.push(json.options.all.shift());
|
||||
data.options.push(
|
||||
...json.options.all.sort((a, b) => a.title.localeCompare(b.title)),
|
||||
);
|
||||
|
||||
data.songs = json.trending;
|
||||
data.artists = json.artists;
|
||||
}
|
||||
|
||||
watch(id, () => {
|
||||
getCharts();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getCharts();
|
||||
});
|
||||
watch(id, getCharts);
|
||||
onMounted(getCharts);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue