forked from MapComplete/MapComplete
Chore: formatting
This commit is contained in:
parent
6c3c67af56
commit
286578bfc7
58 changed files with 2199 additions and 1915 deletions
|
|
@ -1,32 +1,33 @@
|
|||
<script lang="ts">
|
||||
|
||||
import nmd from "nano-markdown";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import WalkthroughStep from "./WalkthroughStep.svelte";
|
||||
import FromHtml from "../Base/FromHtml.svelte";
|
||||
import nmd from "nano-markdown"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import WalkthroughStep from "./WalkthroughStep.svelte"
|
||||
import FromHtml from "../Base/FromHtml.svelte"
|
||||
|
||||
/**
|
||||
* Markdown
|
||||
*/
|
||||
export let pages: string[];
|
||||
export let pages: string[]
|
||||
|
||||
let currentPage: number = 0;
|
||||
let currentPage: number = 0
|
||||
|
||||
const dispatch = createEventDispatcher<{ done }>();
|
||||
const dispatch = createEventDispatcher<{ done }>()
|
||||
|
||||
function step(incr: number) {
|
||||
if (incr > 0 && currentPage + 1 === pages.length) {
|
||||
dispatch("done");
|
||||
dispatch("done")
|
||||
currentPage = 0
|
||||
return
|
||||
}
|
||||
currentPage = Math.min(Math.max(0, currentPage + incr), pages.length);
|
||||
currentPage = Math.min(Math.max(0, currentPage + incr), pages.length)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<WalkthroughStep on:back={() => step(-1)} on:next={() => step(1)} isFirst={currentPage === 0} islast={currentPage + 1 === pages.length}>
|
||||
<WalkthroughStep
|
||||
on:back={() => step(-1)}
|
||||
on:next={() => step(1)}
|
||||
isFirst={currentPage === 0}
|
||||
islast={currentPage + 1 === pages.length}
|
||||
>
|
||||
<FromHtml src={nmd(pages[currentPage])} />
|
||||
</WalkthroughStep>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,24 @@
|
|||
<script lang="ts">
|
||||
import BackButton from "../Base/BackButton.svelte"
|
||||
import NextButton from "../Base/NextButton.svelte"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
|
||||
import BackButton from "../Base/BackButton.svelte";
|
||||
import NextButton from "../Base/NextButton.svelte";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
|
||||
const dispatch = createEventDispatcher<{ back, next }>();
|
||||
export let islast = false;
|
||||
const dispatch = createEventDispatcher<{ back; next }>()
|
||||
export let islast = false
|
||||
export let isFirst = false
|
||||
</script>
|
||||
|
||||
|
||||
<div class="flex flex-col h-full w-full justify-between">
|
||||
|
||||
<div class="flex h-full w-full flex-col justify-between">
|
||||
<div class="overflow-y-auto">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<div class="flex w-full">
|
||||
{#if !isFirst}
|
||||
<BackButton clss="w-full" on:click={() => dispatch("back")}>
|
||||
Back
|
||||
</BackButton>
|
||||
{:else}
|
||||
<div class="w-full"/>
|
||||
{/if}
|
||||
<BackButton clss="w-full" on:click={() => dispatch("back")}>Back</BackButton>
|
||||
{:else}
|
||||
<div class="w-full" />
|
||||
{/if}
|
||||
<NextButton clss="primary w-full" on:click={() => dispatch("next")}>
|
||||
{#if islast}
|
||||
Finish
|
||||
|
|
@ -32,5 +27,4 @@
|
|||
{/if}
|
||||
</NextButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue