Skip to content

Commit

Permalink
chore: ran yarn format
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamscached committed Apr 9, 2024
1 parent 1d46dbf commit e2985ae
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
9 changes: 8 additions & 1 deletion src/components/Message.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<script lang="ts">
import { Icon, InformationCircle, ExclamationTriangle, ExclamationCircle, CheckCircle, QuestionMarkCircle } from "svelte-hero-icons";
import {
Icon,
InformationCircle,
ExclamationTriangle,
ExclamationCircle,
CheckCircle,
QuestionMarkCircle
} from "svelte-hero-icons";
export let title: string = "";
export let text: string = "";
Expand Down
13 changes: 10 additions & 3 deletions src/components/NameInput.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<script lang="ts">
export let placeholder: string = "Enter your name";
export let maxlength: number = 20;
export let placeholder: string = "Enter your name";
export let maxlength: number = 20;
</script>

<input on:input type="text" {placeholder} {maxlength} autocapitalize="words" class="text-2xl border-2 border-neutral-300 rounded-md p-3 italic">
<input
on:input
type="text"
{placeholder}
{maxlength}
autocapitalize="words"
class="rounded-md border-2 border-neutral-300 p-3 text-2xl italic"
/>
2 changes: 1 addition & 1 deletion src/lib/curses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ export function checkName(name: string, regExps: Record<string, RegExp[]>): [str
.filter((it) => it[1]);
if (found.length === 0) return null;
return found[0] as [string, RegExp];
}
}
36 changes: 29 additions & 7 deletions src/routes/curses/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,46 @@
{#if matchKey === undefined || name?.length === 0}
<Message title="Enter your name" text="To check a name, type it in the box below." type="neutral" />
{:else if !matchKey}
<Message title="This name is okay" text="Not bad, but nothing too special either. A good choice." type="neutral" />
<Message
title="This name is okay"
text="Not bad, but nothing too special either. A good choice."
type="neutral"
/>
{:else if matchKey === "playerGood"}
<Message title="This name is good!" text="If you name yourself like that, Monika will like it." type="good" />
<Message
title="This name is good!"
text="If you name yourself like that, Monika will like it."
type="good"
/>
{:else if matchKey === "monikaGood"}
<Message title="This name is good!" text="If you give your Monika this name, she will like it." type="good" />
<Message
title="This name is good!"
text="If you give your Monika this name, she will like it."
type="good"
/>
{:else if matchKey === "awkward"}
<Message title="This name is... awkward." text="If you try to name yourself or your Monika like that, she will not like it." type="warning" />
<Message
title="This name is... awkward."
text="If you try to name yourself or your Monika like that, she will not like it."
type="warning"
/>
{:else if matchKey === "bad"}
<Message title="This name is terrible!" text="If you try to name yourself or your Monika like that, she will be furious!" type="error" />
<Message
title="This name is terrible!"
text="If you try to name yourself or your Monika like that, she will be furious!"
type="error"
/>
{/if}
</div>
</div>
<div class="flex flex-col place-items-center gap-2">
<div class="mb-3">
<NameInput on:input={onNameInput}/>
<NameInput on:input={onNameInput} />
</div>
{#if matchRule}
<p class="text-center">Matched rule: <span class="font-mono bg-neutral-200 rounded-md py-0.5 px-1">{matchRule.toString()}</span></p>
<p class="text-center">
Matched rule: <span class="rounded-md bg-neutral-200 px-1 py-0.5 font-mono">{matchRule.toString()}</span>
</p>
{/if}
</div>
{/await}
Expand Down

0 comments on commit e2985ae

Please sign in to comment.