This commit is contained in:
Dominic Ferrando
2025-09-20 11:42:06 -04:00
parent 12ab05cfee
commit 0555793bf3
3 changed files with 141 additions and 114 deletions
+33 -1
View File
@@ -1,7 +1,13 @@
<script lang="ts"> <script lang="ts">
import { page } from "$app/state";
import favicon from "$lib/assets/favicon.svg"; import favicon from "$lib/assets/favicon.svg";
import "../app.css"; import "../app.css";
const links = [
{ name: "Standards", path: "/standards" },
{ name: "Commerce", path: "/commerce" },
];
let { children } = $props(); let { children } = $props();
</script> </script>
@@ -9,4 +15,30 @@
<link rel="icon" href={favicon} /> <link rel="icon" href={favicon} />
</svelte:head> </svelte:head>
{@render children?.()} <div class="drawer lg:drawer-open">
<input id="sidebar" type="checkbox" class="drawer-toggle" />
<div class="drawer-content p-10 flex flex-col items-center justify-center">
{@render children?.()}
<label for="sidebar" class="btn btn-primary drawer-button lg:hidden">
Open drawer
</label>
</div>
<div class="drawer-side">
<label for="sidebar" aria-label="close sidebar" class="drawer-overlay"
></label>
<ul
class="menu menu-lg bg-base-200 text-base-content min-h-full w-72 p-4"
>
{#each links as link}
<li>
<a
class={{
"menu-active": page.url.pathname === link.path,
}}
href={link.path}>{link.name}</a
>
</li>
{/each}
</ul>
</div>
</div>
+6
View File
@@ -0,0 +1,6 @@
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = ({ }) => {
redirect(308, '/standards');
};
@@ -76,15 +76,9 @@
}; };
</script> </script>
<div class="container m-auto"> <section class="w-full flex justify-between gap-2 pt-10 items-center">
<section
class="w-full flex flex-col md:flex-row justify-between gap-2 pt-10"
>
<fieldset class="fieldset bg-base-200 p-6 max-w-lg"> <fieldset class="fieldset bg-base-200 p-6 max-w-lg">
<legend class="fieldset-legend text-lg font-semibold"> <legend class="fieldset-legend text-lg font-semibold"> Metrics </legend>
Metrics
</legend>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<label> <label>
<span class="label mb-1">Activity</span> <span class="label mb-1">Activity</span>
@@ -134,9 +128,7 @@
type="number" type="number"
min="0" min="0"
max="600" max="600"
placeholder={selected.metrics.age placeholder={selected.metrics.age ? "170" : "Requires age"}
? "170"
: "Requires age"}
bind:value={input.metrics.weight} bind:value={input.metrics.weight}
disabled={!selected.metrics.age} disabled={!selected.metrics.age}
/> />
@@ -149,16 +141,17 @@
Parameters Parameters
</legend> </legend>
<fieldset class="fieldset bg-base-250 p-3 max-w-xl"> <div class="flex gap-4">
<fieldset class="fieldset bg-base-300 p-3 max-w-xl">
<legend class="fieldset-legend text-sm font-semibold"> <legend class="fieldset-legend text-sm font-semibold">
General General
</legend> </legend>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div class="grid grid-cols-1 gap-4">
<label> <label>
<span class="label mb-1">Max level</span> <span class="label mb-1">Max level</span>
<input <input
class="input" class="input w-full"
type="number" type="number"
min="1" min="1"
max="100" max="100"
@@ -169,7 +162,7 @@
</div> </div>
</fieldset> </fieldset>
<fieldset class="fieldset bg-base-300 p-3 max-w-xl"> <fieldset class="fieldset bg-base-300 p-3 max-w-3xs">
<legend class="fieldset-legend text-sm font-semibold"> <legend class="fieldset-legend text-sm font-semibold">
Data Generation Data Generation
</legend> </legend>
@@ -178,7 +171,7 @@
<label> <label>
<span class="label mb-1">Weight modifier</span> <span class="label mb-1">Weight modifier</span>
<input <input
class="input" class="input w-full"
type="number" type="number"
min="0" min="0"
max="1" max="1"
@@ -190,7 +183,7 @@
<label> <label>
<span class="label mb-1">Weight skew</span> <span class="label mb-1">Weight skew</span>
<input <input
class="input" class="input w-full"
type="number" type="number"
min="0" min="0"
max="1" max="1"
@@ -202,7 +195,7 @@
<label> <label>
<span class="label mb-1">Age modifier</span> <span class="label mb-1">Age modifier</span>
<input <input
class="input" class="input w-full"
type="number" type="number"
min="0" min="0"
max="1" max="1"
@@ -213,19 +206,16 @@
</label> </label>
</div> </div>
</fieldset> </fieldset>
</div>
</fieldset> </fieldset>
</section> </section>
<div class="divider"></div> <div class="divider"></div>
<section> <section class="w-full">
<div> <div>
<h1 class="text-2xl font-bold mb-2.5">
{allStandards.byActivity(selected.activity).getMetadata().name}
</h1>
<div class="flex items-center"> <div class="flex items-center">
<h2 class="text-xl">{selected.metrics.gender}</h2> <p class="text-xs label">
<p class="text-xs label ml-2.5">
{#if allStandards {#if allStandards
.byActivity(selected.activity) .byActivity(selected.activity)
.getMetadata().generators.length} .getMetadata().generators.length}
@@ -251,8 +241,7 @@
{:else} {:else}
{@render standardsTable(selected.activity, selected.metrics)} {@render standardsTable(selected.activity, selected.metrics)}
{/if} {/if}
</section> </section>
</div>
{#snippet standardsTable(activity: Activity, metrics: Metrics)} {#snippet standardsTable(activity: Activity, metrics: Metrics)}
{#snippet standardsTableRow(standard: Standard)} {#snippet standardsTableRow(standard: Standard)}