diff --git a/TODO.txt b/TODO.txt index 8517217..48c8162 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,4 @@ -Add Steadings tables Change steadings and mounts to not show English names by default -Make everything look nicer -Maybe put roller button in a left nav bar and the results in the middle? -Add a copy-to-clipboard option +Make everything look more nicer +get the roll sound working on all reroll events Add a 3d dice rolling visualizer \ No newline at end of file diff --git a/src/App.svelte b/src/App.svelte index f815295..6d7bc9c 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -17,6 +17,7 @@ import Footer from "./components/Footer.svelte"; import MultiCard from "./components/MultiCard.svelte"; import { RollCard } from "./types/RollCard"; + import type { RerolledEvent } from "./types/RerolledEvent"; let rollThemBones = new Audio("https://soundbible.com/mp3/Shake And Roll Dice-SoundBible.com-591494296.mp3"); let playSounds = localStorage?.getItem("playSounds") != "false"; @@ -52,6 +53,11 @@ } } + function rerolled(event: CustomEvent) { + // console.log("rerolled card value", event.detail); + playAudio(); + } + function remove(event: CustomEvent) { cards = cards.filter((c) => c.timestamp != event.detail.timestamp); } @@ -94,7 +100,7 @@

Results:

{#each cards as card} - + {/each} diff --git a/src/components/CardTitleButtons.svelte b/src/components/CardTitleButtons.svelte new file mode 100644 index 0000000..04862aa --- /dev/null +++ b/src/components/CardTitleButtons.svelte @@ -0,0 +1,67 @@ + + +
+
+ {#if showCopy} +
+ +
+ {/if} + {#if showReroll} +
+ + Reroll Item +
+ {/if} + {#if showRemove} + + Remove Item + {/if} +
+
+ + diff --git a/src/components/CreatureCard.svelte b/src/components/CreatureCard.svelte index ddbc94d..e91bddf 100644 --- a/src/components/CreatureCard.svelte +++ b/src/components/CreatureCard.svelte @@ -1,30 +1,24 @@
- {capitalize(detail.type)} - +
+
+ Detail: {capitalize(detail.type)} +
+ +
{detail.description} - {timestamp} + {#if timestamp} + {timestamp} + {/if}
diff --git a/src/components/DiscoveryCard.svelte b/src/components/DiscoveryCard.svelte index 0b5a44d..12d2f8b 100644 --- a/src/components/DiscoveryCard.svelte +++ b/src/components/DiscoveryCard.svelte @@ -1,39 +1,76 @@
- {capitalize(discovery.category)} - - {#if discovery.subcategory !== ""} - ({discovery.subcategory}){/if}: {capitalize(discovery.description)} - - +
+
+ Discovery: + {capitalize(discovery.category)} + +
+ +
+

+ Type{#if discovery.subcategory !== ""} {capitalize(discovery.subcategory)}{/if}: {capitalize( + discovery.description + )} + +

+ {#if discovery.category == "creature"} - + - {:else if discovery.category == "steading"} + {:else if discovery.category == "structure" && discovery.steading} - + - {:else} + {:else if hasDetails} Details:
    @@ -44,7 +81,7 @@ {#if discovery.aspect}
  • Aspect: {discovery.aspect.description}
  • {/if} {#if discovery.creature}
  • Produced/Inhabited By: {discovery.creature.description} - +
  • {/if} {#if discovery.element}
  • Element: {discovery.element.description}
  • {/if} {#if discovery.magicType}
  • @@ -64,7 +101,9 @@ - {timestamp} + {#if timestamp} + {timestamp} + {/if}
@@ -72,6 +111,10 @@ main { text-align: left; } + .title { + display: flex; + justify-content: space-between; + } ul { margin-left: 2em; } diff --git a/src/components/DungeonCard.svelte b/src/components/DungeonCard.svelte index b95cfab..37b55b9 100644 --- a/src/components/DungeonCard.svelte +++ b/src/components/DungeonCard.svelte @@ -1,12 +1,25 @@
- {follower.name} ({follower.gender}) + +
+
+ Follower: {follower.name} ({follower.gender}) +
+ +
+
@@ -88,7 +109,9 @@ - {timestamp} + {#if timestamp} + {timestamp} + {/if}
@@ -96,6 +119,10 @@ main { text-align: left; } + .title { + display: flex; + justify-content: space-between; + } p { margin-left: 1em; } diff --git a/src/components/KingdomCard.svelte b/src/components/KingdomCard.svelte index d9c0577..8bd4390 100644 --- a/src/components/KingdomCard.svelte +++ b/src/components/KingdomCard.svelte @@ -1,12 +1,25 @@ @@ -14,18 +27,32 @@ - {capitalize(item.category)} from {item.kingdom.description} +
+
+ {capitalize(item.category)} from {item.kingdom.description} +
+ +
- + Name: {item.description} - {timestamp} + {#if timestamp} + {timestamp} + {/if}
diff --git a/src/components/MultiCard.svelte b/src/components/MultiCard.svelte index 2d8b942..c97b946 100644 --- a/src/components/MultiCard.svelte +++ b/src/components/MultiCard.svelte @@ -14,10 +14,15 @@ import SteadingCard from "./SteadingCard.svelte"; import type { RollCard } from "../types/RollCard"; + import type { RerolledEvent } from "../types/RerolledEvent"; const dispatch = createEventDispatcher(); export let card: RollCard; + function rerolled(event: CustomEvent) { + // pass along the event + dispatch("rerolled", event.detail); + } function remove() { dispatch("remove", card); } @@ -25,27 +30,27 @@
{#if card.type == "creature"} - + {:else if card.type == "danger"} - + {:else if card.type == "detail"} - + {:else if card.type == "discovery"} - + {:else if card.type == "dungeon"} - + {:else if card.type == "follower"} - + {:else if card.type == "kingdom"} - + {:else if card.type == "npc"} - + {:else if card.type == "place"} - + {:else if card.type == "region"} - + {:else if card.type == "steading"} - + {:else}

Card type not supported: {card.type}

{/if} diff --git a/src/components/NpcCard.svelte b/src/components/NpcCard.svelte index 609a667..991bfe4 100644 --- a/src/components/NpcCard.svelte +++ b/src/components/NpcCard.svelte @@ -1,15 +1,51 @@
- {npc.getDescription()} + +
+
+ NPC: {npc.getDescription()} +
+ +
@@ -22,21 +58,24 @@
  • They are a(n) {npc.context.alignment.description} {npc.context.description} with - {npc.trait.category} ({npc.context.trait.description}) + {npc.traits[0]?.category} ({npc.context.trait.description}) encountered in a(n) {npc.context.category} setting while they are {npc.context.activity.description}
- - Follower Stats: -
    -
  • {npc.follower.name}
  • -
-
+
- {timestamp} + {#if timestamp} + {timestamp} + {/if}
@@ -44,6 +83,10 @@ main { text-align: left; } + .title { + display: flex; + justify-content: space-between; + } ul { margin-left: 2em; } diff --git a/src/components/PlaceCard.svelte b/src/components/PlaceCard.svelte index 11604fc..d223e51 100644 --- a/src/components/PlaceCard.svelte +++ b/src/components/PlaceCard.svelte @@ -1,24 +1,52 @@
- Place + +
+
Place
+ +
+
- {place} + Name: {place} - {timestamp} + {#if timestamp} + {timestamp} + {/if}
diff --git a/src/components/RegionCard.svelte b/src/components/RegionCard.svelte index 2117600..d3e8fa2 100644 --- a/src/components/RegionCard.svelte +++ b/src/components/RegionCard.svelte @@ -1,24 +1,52 @@
- Region + +
+
Region
+ +
+
- {region} + Name: {region} - {timestamp} + {#if timestamp} + {timestamp} + {/if}
diff --git a/src/components/SteadingCard.svelte b/src/components/SteadingCard.svelte index 7a0879b..ad36217 100644 --- a/src/components/SteadingCard.svelte +++ b/src/components/SteadingCard.svelte @@ -1,32 +1,48 @@
- {capitalize(steading.category)} - +
+
Steading: {capitalize(steading.category)}
+ +
-

Built by:

- +

Built by:

+
-

Tags

+

Tags

    {#each steading.tags as tag}
  • {tag}
  • @@ -34,7 +50,7 @@
-

{capitalize(steading.condition)}:

+

{capitalize(steading.condition)}:

{capitalize(steading.benefit.description)} :

@@ -55,7 +71,9 @@
- {timestamp} + {#if timestamp} + {timestamp} + {/if}
@@ -63,6 +81,10 @@ main { text-align: left; } + .title { + display: flex; + justify-content: space-between; + } ul { margin-left: 2em; } diff --git a/src/components/SteadingRoller.svelte b/src/components/SteadingRoller.svelte index d6b3179..2303b2d 100644 --- a/src/components/SteadingRoller.svelte +++ b/src/components/SteadingRoller.svelte @@ -1,29 +1,18 @@
- - - - - {#each rollResults as { steading, timestamp }} - - {/each} +