You've already forked AstralRinth
forked from didirus/AstralRinth
Add "icon" class to generated icons
This commit is contained in:
@@ -49,6 +49,8 @@
|
|||||||
<a class={className} {href} {disabled} {title} {target} on:click>
|
<a class={className} {href} {disabled} {title} {target} on:click>
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
{:else if as === 'input'}
|
||||||
|
<input class={className} {value} {disabled} {title} on:click />
|
||||||
{:else}
|
{:else}
|
||||||
<svelte:element this={as} class={className} {disabled} {title} on:click>
|
<svelte:element this={as} class={className} {disabled} {title} on:click>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -42,13 +42,16 @@ export default function Generator(options) {
|
|||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (options.landingPage) await landingPage(API_URL);
|
|
||||||
if (options.projectColors) await projectColors(API_URL);
|
|
||||||
if (options.gameVersions) await gameVersions(API_URL);
|
|
||||||
if (options.tags) await tags(API_URL);
|
if (options.tags) await tags(API_URL);
|
||||||
|
if (options.landingPage) await landingPage(API_URL);
|
||||||
|
if (options.gameVersions) await gameVersions(API_URL);
|
||||||
|
if (options.projectColors) await projectColors(API_URL);
|
||||||
|
|
||||||
// Write new state
|
// Write new state
|
||||||
state.lastGenerated = new Date().toISOString();
|
state.lastGenerated = new Date().toISOString();
|
||||||
state.options = options;
|
state.options = options;
|
||||||
|
|
||||||
await fs.writeFile('./generated/state.json', JSON.stringify(state, null, 2));
|
await fs.writeFile('./generated/state.json', JSON.stringify(state, null, 2));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,10 +19,15 @@ export async function tags(API_URL) {
|
|||||||
]);
|
]);
|
||||||
progressBar.update(4);
|
progressBar.update(4);
|
||||||
|
|
||||||
|
const tagIconReducer = (a, v) => ({
|
||||||
|
...a,
|
||||||
|
[v.name]: v.icon.replace('<svg', '<svg class="icon"'),
|
||||||
|
});
|
||||||
|
|
||||||
// Create single object with icons
|
// Create single object with icons
|
||||||
const tagIcons = {
|
const tagIcons = {
|
||||||
...categories.reduce((a, v) => ({ ...a, [v.name]: v.icon }), {}),
|
...categories.reduce(tagIconReducer, {}),
|
||||||
...loaders.reduce((a, v) => ({ ...a, [v.name]: v.icon }), {}),
|
...loaders.reduce(tagIconReducer, {}),
|
||||||
};
|
};
|
||||||
progressBar.increment();
|
progressBar.increment();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user