mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-01-05 18:26:56 +01:00
Add comissions location to achievement page
This commit is contained in:
parent
63b0430d5d
commit
f706a41a5b
15 changed files with 39 additions and 20 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -63,7 +63,12 @@
|
|||
}));
|
||||
let versionFilter = [];
|
||||
|
||||
const types = [{ label: $t('achievement.commissions'), value: 'commissions' }];
|
||||
const types = [
|
||||
{ label: $t('achievement.commissions'), value: 'commissions' },
|
||||
{ label: $t('fishing.mondstadt'), value: 'mondstadt' },
|
||||
{ label: $t('fishing.liyue'), value: 'liyue' },
|
||||
{ label: $t('fishing.inazuma'), value: 'inazuma' },
|
||||
];
|
||||
let typeFilter = [];
|
||||
|
||||
function parseCategories() {
|
||||
|
@ -176,7 +181,15 @@
|
|||
const filterVersion = versionFilter.length > 0;
|
||||
const filteredVersion = versionFilter.map((e) => e.value);
|
||||
|
||||
const filterComission = typeFilter.map((e) => e.value).includes('commissions');
|
||||
let filterComission = [];
|
||||
for (const e of typeFilter) {
|
||||
if (e.value === 'commissions') {
|
||||
filterComission = ['mondstadt', 'liyue', 'inazuma'];
|
||||
break;
|
||||
}
|
||||
|
||||
filterComission.push(e.value);
|
||||
}
|
||||
|
||||
const filterName = nameFilter !== '';
|
||||
const query = nameFilter.toLowerCase();
|
||||
|
@ -190,12 +203,12 @@
|
|||
.filter((e) => {
|
||||
if (Array.isArray(e)) {
|
||||
if (filterVersion && !filteredVersion.includes(e[0].ver)) return false;
|
||||
if (filterComission && !e[0].commissions) return false;
|
||||
if (filterComission.length > 0 && !filterComission.includes(e[0].commissions)) return false;
|
||||
if (filterName && !e[0].name.toLowerCase().includes(query)) return false;
|
||||
return true;
|
||||
} else {
|
||||
if (filterVersion && !filteredVersion.includes(e.ver)) return false;
|
||||
if (filterComission && !e.commissions) return false;
|
||||
if (filterComission.length > 0 && !filterComission.includes(e.commissions)) return false;
|
||||
if (filterName && !e.name.toLowerCase().includes(query)) return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -428,10 +441,13 @@
|
|||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{it.ver}
|
||||
</span>
|
||||
{#if it.commissions}
|
||||
{#if it.commissions !== undefined}
|
||||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{$t('achievement.commissions')}
|
||||
</span>
|
||||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{$t(`fishing.${it.commissions}`)}
|
||||
</span>
|
||||
{/if}
|
||||
</p>
|
||||
<p class="text-gray-400">{it.desc}</p>
|
||||
|
@ -459,10 +475,13 @@
|
|||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{el.ver}
|
||||
</span>
|
||||
{#if el.commissions}
|
||||
{#if el.commissions !== undefined}
|
||||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{$t('achievement.commissions')}
|
||||
</span>
|
||||
<span class="ml-1 rounded-xl bg-background px-2 text-gray-400 text-sm font-normal select-none">
|
||||
{$t(`fishing.${el.commissions}`)}
|
||||
</span>
|
||||
{/if}
|
||||
</p>
|
||||
<p class="text-gray-400">{el.desc}</p>
|
||||
|
|
|
@ -7,7 +7,7 @@ const IMAGE_CACHE = `cacheimg${IMAGE_CACHE_VER}`;
|
|||
|
||||
const IMAGE_URL = `${self.location.origin}/images/`;
|
||||
|
||||
const changelog = ['Update timeline', 'Adjust character detail page'];
|
||||
const changelog = ['Add commissions location to achievement tracker', 'Adjust character detail page'];
|
||||
|
||||
const channel = new BroadcastChannel('paimonmoe-sw');
|
||||
|
||||
|
|
Loading…
Reference in a new issue