This commit is contained in:
Akis 2022-07-29 14:13:45 +03:00
parent 48eae47254
commit 8cfcdaec09
Signed by untrusted user: akis
GPG Key ID: 267BF5C6677944ED
2 changed files with 98 additions and 79 deletions

View File

@ -1,96 +1,114 @@
<script lang="ts">
import IconLock from '~icons/fa6-solid/lock';
import IconInfo from '~icons/fa6-solid/circle-info';
import HCaptcha from 'svelte-hcaptcha';
let submit = false;
import IconLock from "~icons/fa6-solid/lock";
import IconInfo from "~icons/fa6-solid/circle-info";
import HCaptcha from "svelte-hcaptcha";
let submit = false;
let showSubmitButton = () => {
submit = !submit;
}
let showSubmitButton = () => {
submit = !submit;
};
</script>
<form action="https://segfautilities.projectsegfau.lt/api/form" method="POST" id="contact-form">
<div class="note">
<IconLock />
<b>Your IP will be logged for anti-abuse measures.</b>
</div>
<div class="meta">
<input type="text" name="email" class="form-textbox" placeholder="Your email" required />
<select id="commentType" name="commentType" required class="button">
<option value="" selected disabled>Select a type of comment</option>
<option value="Feedback">Feedback</option>
<option value="Suggestion">Suggestion</option>
<option value="Question">Question</option>
<option value="Bug">Bug</option>
</select>
</div>
<textarea id="comment" name="message" rows="4" cols="25" required class="form-textbox" placeholder="Your message"></textarea>
<div class="note">
<IconInfo />
<b>The submit button will be visible when you complete the Captcha.</b>
</div>
<HCaptcha
sitekey=67e84266-980c-4050-8a39-142a91928fe8
theme=dark
on:success={showSubmitButton}
/>
{#if submit}
<input type="submit" value="Submit" class="button" />
{/if}
<form
action="https://segfautilities.projectsegfau.lt/api/form"
method="POST"
id="contact-form"
>
<div class="note">
<IconLock />
<b>Your IP will be logged for anti-abuse measures.</b>
</div>
<div class="meta">
<input
type="text"
name="email"
class="form-textbox"
placeholder="Your email"
required
/>
<select id="commentType" name="commentType" required class="button">
<option value="" selected disabled>Select a type of comment</option>
<option value="Feedback">Feedback</option>
<option value="Suggestion">Suggestion</option>
<option value="Question">Question</option>
<option value="Bug">Bug</option>
</select>
</div>
<textarea
id="comment"
name="message"
rows="4"
cols="25"
required
class="form-textbox"
placeholder="Your message"
/>
<div class="note">
<IconInfo />
<b>The submit button will be visible when you complete the Captcha.</b>
</div>
<HCaptcha
sitekey="67e84266-980c-4050-8a39-142a91928fe8"
theme="dark"
on:success={showSubmitButton}
/>
{#if submit}
<input type="submit" value="Submit" class="button" />
{/if}
</form>
<style>
form {
display: flex;
flex-direction: column;
gap: 1rem;
width: fit-content;
}
form {
display: flex;
flex-direction: column;
gap: 1rem;
width: fit-content;
}
.note {
display: flex;
align-items: center;
gap: 4px;
}
.note {
display: flex;
align-items: center;
gap: 4px;
}
.meta {
display: flex;
align-items: center;
flex-direction: row;
gap: 1rem;
}
.meta {
display: flex;
align-items: center;
flex-direction: row;
gap: 1rem;
}
.meta > * {
width: 50%;
}
.meta > * {
width: 50%;
}
@media screen and (max-width: 450px) {
.meta {
flex-direction: column;
align-items: flex-start;
justify-content: center;
}
@media screen and (max-width: 450px) {
.meta {
flex-direction: column;
align-items: flex-start;
justify-content: center;
}
.meta > * {
width: calc(100% - 1rem);
}
.meta > * {
width: calc(100% - 1rem);
}
.meta > *:nth-child(2) {
width: 100%;
}
}
.meta > *:nth-child(2) {
width: 100%;
}
}
.form-textbox {
background-color: var(--tertiary);
color: var(--text);
border-radius: 10px;
border: none;
padding: 0.5rem;
font-family: 'Comfortaa', sans-serif;
outline: none;
}
.form-textbox {
background-color: var(--tertiary);
color: var(--text);
border-radius: 10px;
border: none;
padding: 0.5rem;
font-family: "Comfortaa", sans-serif;
outline: none;
}
.button {
.button {
background-color: var(--tertiary);
border: none;
border-radius: 10px;
@ -107,4 +125,4 @@
transition: all 0.5s;
color: var(--secondary);
}
</style>
</style>

View File

@ -12,6 +12,7 @@ description: Do you want to contact us?
{ description }
## Contact Form
<ContactForm />
## Our email