diff --git a/src/lib/Others/GridCatalog.svelte b/src/lib/Others/GridCatalog.svelte index 42a723fc..3f5c226c 100644 --- a/src/lib/Others/GridCatalog.svelte +++ b/src/lib/Others/GridCatalog.svelte @@ -12,6 +12,27 @@ selectedCharID.set(index) endGrid() } + + function formatChars(search:string){ + let charas:{ + image:string + index:number + type:string + }[] = [] + + for(let i=0;i<$DataBase.characters.length;i++){ + const c = $DataBase.characters[i] + if(c.name.replace(/ /g,"").toLocaleLowerCase().includes(search.toLocaleLowerCase().replace(/ /g,""))){ + charas.push({ + image: c.image, + index: i, + type: c.type + }) + } + } + return charas + + }