mirror of
https://github.com/ProjectSegfault/website.git
synced 2025-05-31 14:12:04 +05:30
rework old pubnix pr
This commit is contained in:
19
src/lib/Form/Captcha.svelte
Normal file
19
src/lib/Form/Captcha.svelte
Normal 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
19
src/lib/Form/Note.svelte
Normal 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
2
src/lib/Form/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default as Note } from "./Note.svelte";
|
||||
export { default as Captcha } from "./Captcha.svelte";
|
||||
Reference in New Issue
Block a user