From 7b7b1c5ad4dcfcd6b75d202deadf9dbf87d51d24 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Fri, 13 Jan 2023 12:51:02 -0500 Subject: [PATCH] misc work --- histoire.config.js | 3 +- src/histoire.setup.js | 1 + src/histoire.setup.svelte | 5 - src/lib/components/Battle.story.svelte | 25 ++++ src/lib/components/Battle.svelte | 124 +++++++++++++++ src/lib/components/Campaign.svelte | 64 ++++++++ src/lib/components/Campaign/Battle.svelte | 24 +++ src/lib/components/Campaigns.story.svelte | 12 ++ src/lib/components/Campaigns.svelte | 9 +- src/lib/store/api.js | 141 ++++++++++++++---- src/lib/store/genNextBattle.js | 2 +- src/routes/+layout.js | 1 - src/routes/campaign/[campaignId]/+page.svelte | 15 -- 13 files changed, 367 insertions(+), 59 deletions(-) create mode 100644 src/histoire.setup.js delete mode 100644 src/histoire.setup.svelte create mode 100644 src/lib/components/Battle.story.svelte create mode 100644 src/lib/components/Battle.svelte create mode 100644 src/lib/components/Campaign.svelte create mode 100644 src/lib/components/Campaign/Battle.svelte delete mode 100644 src/routes/+layout.js delete mode 100644 src/routes/campaign/[campaignId]/+page.svelte diff --git a/histoire.config.js b/histoire.config.js index f29a781..6072c46 100644 --- a/histoire.config.js +++ b/histoire.config.js @@ -2,5 +2,6 @@ import { defineConfig } from 'histoire'; import { HstSvelte } from '@histoire/plugin-svelte'; export default defineConfig({ - plugins: [HstSvelte()], + setupFile: '/src/histoire.setup.js', + plugins: [HstSvelte()], }); diff --git a/src/histoire.setup.js b/src/histoire.setup.js new file mode 100644 index 0000000..622f1a1 --- /dev/null +++ b/src/histoire.setup.js @@ -0,0 +1 @@ +//global?.__SVELTEKIT_APP_VERSION_POLL_INTERVAL__ = 1000; diff --git a/src/histoire.setup.svelte b/src/histoire.setup.svelte deleted file mode 100644 index 42c2b83..0000000 --- a/src/histoire.setup.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - -; // import 'material-dynamic-colors'; diff --git a/src/lib/components/Battle.story.svelte b/src/lib/components/Battle.story.svelte new file mode 100644 index 0000000..faea9da --- /dev/null +++ b/src/lib/components/Battle.story.svelte @@ -0,0 +1,25 @@ + + + + + + [s, s]))} + /> + + + + + diff --git a/src/lib/components/Battle.svelte b/src/lib/components/Battle.svelte new file mode 100644 index 0000000..3eda628 --- /dev/null +++ b/src/lib/components/Battle.svelte @@ -0,0 +1,124 @@ +
{$activeCampaign?.name}
+
Chapter {chapter}, battle {chapterBattle} -- {status}
+
+ {#if status === 'ongoing'} +
wave
+
{wave === 2 ? 'second' : 'first'}
+ {/if} +
city
+
{city}
+
scenario
+
{scenario}
+
character
+
{character}
+ +
difficulty
+
+
+ + event.setBattleDifficulty(params.battleId, value)} + /> +
+ + +
+
+ +{#if status === 'upcoming'} + +{:else if status === 'ongoing'} + + +{/if} + + + + diff --git a/src/lib/components/Campaign.svelte b/src/lib/components/Campaign.svelte new file mode 100644 index 0000000..c42002b --- /dev/null +++ b/src/lib/components/Campaign.svelte @@ -0,0 +1,64 @@ +
+ {#if $activeCampaign} +
{$activeCampaign.name}
+
Chapter 1
+ +
+ +
+
Chapter 2
+ +
+ +
+
Chapter 3
+ +
+ +
+
Chapter 4
+ +
+ +
+ +
+ +
+ +
+ +
+ {/if} +
+ + + + diff --git a/src/lib/components/Campaign/Battle.svelte b/src/lib/components/Campaign/Battle.svelte new file mode 100644 index 0000000..46794c8 --- /dev/null +++ b/src/lib/components/Campaign/Battle.svelte @@ -0,0 +1,24 @@ +
+

+ {#if notYet} + ??? + {:else} + + Battle of {city}, {status} + {/if} +

+
+ + + + diff --git a/src/lib/components/Campaigns.story.svelte b/src/lib/components/Campaigns.story.svelte index 44bd31c..a4f9799 100644 --- a/src/lib/components/Campaigns.story.svelte +++ b/src/lib/components/Campaigns.story.svelte @@ -5,9 +5,21 @@ diff --git a/src/lib/components/Campaigns.svelte b/src/lib/components/Campaigns.svelte index cc0565c..9ca81a9 100644 --- a/src/lib/components/Campaigns.svelte +++ b/src/lib/components/Campaigns.svelte @@ -4,12 +4,12 @@ - {#each campaigns as campaign (campaign.id)} + {#each $campaigns as campaign (campaign.id)}
south_america
- + {campaign.name}
@@ -50,10 +50,11 @@