mirror of
https://github.com/RussellChamp/tpw-roller.git
synced 2026-10-28 00:22:36 +00:00
touch all the things
This commit is contained in:
1 parent
b82a976e1a
commit
c896a4b9d9
19 files changed
+1935
-81
No files matched your search
@@ -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>
|
||||
Reference in new issue
Block a user