rework old pubnix pr

This commit is contained in:
2022-08-17 21:08:10 +03:00
parent d642ddb563
commit 8088c7f8ea
10 changed files with 188 additions and 48 deletions

View File

@@ -0,0 +1,19 @@
<script>
import HCaptcha from "svelte-hcaptcha";
import { Note } from "$lib/Form";
let submit = false;
let showSubmitButton = () => {
submit = !submit;
};
</script>
<Note content="The submit button will be visible when you complete the Captcha." icon="i-fa6-solid:circle-info" />
<HCaptcha
sitekey="67e84266-980c-4050-8a39-142a91928fe8"
on:success={showSubmitButton}
/>
{#if submit}
<input type="submit" value="Submit" class="form-button" />
{/if}

19
src/lib/Form/Note.svelte Normal file
View File

@@ -0,0 +1,19 @@
<script lang="ts">
export let content: string;
export let icon: string;
</script>
<div class="note">
{#if icon}
<div class={icon} />
{/if}
<b>{content}</b>
</div>
<style>
.note {
display: flex;
align-items: center;
gap: 4px;
}
</style>

2
src/lib/Form/index.ts Normal file
View File

@@ -0,0 +1,2 @@
export { default as Note } from "./Note.svelte";
export { default as Captcha } from "./Captcha.svelte";