touch all the things

This commit is contained in:
RussellChamp committed 2021-07-25 22:48:37 -04:00
1 parent b82a976e1a
commit c896a4b9d9
19 files changed
+1935 -81

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
<script lang="ts">
import * as _ from "lodash";
import { format as formatDate } from "date-fns";
import { Creature, rollCreature } from "./creatures";
export let rollResults: { value: Creature; timestamp: string }[] = [];
function roll(event: Event) {
let value = rollCreature();
console.log("creature", value);
rollResults = [{ value, timestamp: formatDate(new Date(), "P kk:mm:ss") }, ...rollResults];
}
</script>
<main>
<h2>Random Creatures</h2>
<button type="button" class="btn btn-primary" on:click={roll}>Roll Creature</button>
{#each rollResults as result}
<h4>{result.timestamp}: {result.value.description}</h4>
{/each}
</main>
<style>
</style>