add quest log aesthetic.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-01-17 16:12:32 +01:00
parent 1d3c8dee73
commit d3a6487dc8
17 changed files with 319 additions and 26 deletions
@@ -0,0 +1,21 @@
<script lang="ts">
import type { TaskResult } from "../models/task";
import Progress from "./Progress.svelte";
interface ProjectLike {
tasks?: TaskResult[]
}
export let project: ProjectLike;
let progressAmount: number;
let progressTarget: number;
$: progressAmount = (project.tasks||[]).map(t => t.active
? Math.min(t.completedAmount, t.itemAmount) * t.item.groupWeight
: t.itemAmount * t.item.groupWeight
).reduce((n,m) => n+m, 0);
$: progressTarget = Math.max((project.tasks||[]).map(t => t.itemAmount * t.item.groupWeight).reduce((n,m) => n+m, 0), 1);
</script>
<Progress thin green count={progressAmount} target={progressTarget} />