113 lines
2.6 KiB
Svelte
113 lines
2.6 KiB
Svelte
<script lang="ts" context="module">
|
|
import type { LoadInput } from "@sveltejs/kit/types/internal";
|
|
|
|
export async function load({ url, fetch }: LoadInput ) {
|
|
const res = await fetch("indexdata.json");
|
|
|
|
if (res.ok) {
|
|
return {
|
|
props: {
|
|
...await res.json(),
|
|
}
|
|
};
|
|
}
|
|
|
|
return {
|
|
status: res.status,
|
|
error: `Failed: ${res.status}`
|
|
};
|
|
}
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import ItemLink from "$lib/components/frontpage/ItemLink.svelte";
|
|
import ScopeLink from "$lib/components/frontpage/ScopeLink.svelte";
|
|
import RequirementLink from "$lib/components/frontpage/RequirementLink.svelte";
|
|
import type { ScopeEntry } from "$lib/models/scope";
|
|
import type { StandaloneItem } from "$lib/models/item";
|
|
import type { StandaloneRequirement } from "$lib/models/project";
|
|
import type { StandaloneSprint } from "$lib/models/sprint";
|
|
import SprintLink from "$lib/components/frontpage/SprintLink.svelte";
|
|
import Header from "$lib/components/layout/Header.svelte";
|
|
export let scopes: ScopeEntry[] = [];
|
|
export let items: StandaloneItem[] = [];
|
|
export let requirements: StandaloneRequirement[] = [];
|
|
export let sprints: StandaloneSprint[] = [];
|
|
</script>
|
|
|
|
<Header fullwidth subtitle="Logging your stuff">Stufflog</Header>
|
|
|
|
<main>
|
|
<div class="column">
|
|
<div class="row">
|
|
<h2>Scopes</h2>
|
|
{#each scopes as scope (scope.id)}
|
|
<ScopeLink scope={scope} />
|
|
{/each}
|
|
</div>
|
|
<div class="row">
|
|
<h2>Today</h2>
|
|
<p>When you mark an item as aquired today, it will appear here.</p>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div class="row">
|
|
<h2>Suggestions</h2>
|
|
{#each items as item (item.id)}
|
|
<ItemLink item={item} />
|
|
{/each}
|
|
{#each requirements as requirement (requirement.id)}
|
|
<RequirementLink requirement={requirement} />
|
|
{/each}
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div class="row">
|
|
<h2>Sprints</h2>
|
|
{#each sprints as sprint (sprint.id)}
|
|
<SprintLink sprint={sprint} />
|
|
{/each}
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<style lang="scss">
|
|
p {
|
|
margin-top: 0.25em;
|
|
}
|
|
|
|
main {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-basis: 100%;
|
|
flex: 1;
|
|
|
|
width: 180ch;
|
|
max-width: 95%;
|
|
margin: auto;
|
|
|
|
@media screen and (max-width: 1000px) {
|
|
width: 100%;
|
|
flex-direction: column;
|
|
}
|
|
|
|
> div.column {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-basis: 50;
|
|
flex: 1;
|
|
|
|
> div.row {
|
|
margin: 0.5em 1ch;
|
|
padding: 0.5em 1ch;
|
|
|
|
> h2 {
|
|
font-size: 1.25em;
|
|
margin: 0;
|
|
margin-bottom: 0.25em;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|