Completed contact form and improved styling on cards

This commit is contained in:
Luke Else 2023-09-29 14:41:37 +01:00
parent 7bd03be127
commit cbdc81c4ce
5 changed files with 47 additions and 34 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ node_modules
!.env.example !.env.example
vite.config.js.timestamp-* vite.config.js.timestamp-*
vite.config.ts.timestamp-* vite.config.ts.timestamp-*
.vscode

15
.vscode/settings.json vendored
View File

@ -1,15 +0,0 @@
{
"spellright.language": [
"en"
],
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
],
"spellright.parserByClass": {
"svelte": {
"parser": "plain"
}
}
}

View File

@ -15,7 +15,7 @@
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
flex: 2 1 20%; flex: 2 1 20%;
min-width: 10em; min-width: 8em;
padding: .5em 2.5em 2em 2.5em; padding: .5em 2.5em 2em 2.5em;
background: var(--bg-grad); background: var(--bg-grad);
border-radius: .5em; border-radius: .5em;
@ -44,7 +44,8 @@
.card .card-footer :global(div){ .card .card-footer :global(div){
margin-bottom: 1em; margin-bottom: 1em;
display: flex; display: flex;
gap: 1.5em; gap: 1em;
max-width: 100%;
justify-content: space-between; justify-content: space-between;
} }
</style> </style>

View File

@ -78,7 +78,6 @@
/* Skills Cards CSS */ /* Skills Cards CSS */
.skills-container { .skills-container {
max-width: 90%; max-width: 90%;
padding: 0em 2em;
margin: auto; margin: auto;
} }
@ -88,7 +87,6 @@
flex-direction: row; flex-direction: row;
gap: 3em 3em; gap: 3em 3em;
padding: 3em 1em 2em 0em; padding: 3em 1em 2em 0em;
list-style: none;
transition: all 0.2s; transition: all 0.2s;
} }

View File

@ -1,25 +1,38 @@
<script lang="ts"> <script lang="ts">
import Card from '../../Card.svelte'; import Card from '../../Card.svelte';
import { Toast, ToastType } from "$lib/toast";
import { addToast } from "$lib/store";
import { page } from '$app/stores';
const sent = $page.url.searchParams.get('sent');
if (sent == "true") {
addToast(new Toast("Thank you! Your E-Mail has been sent. I will reply as soon as possible!", ToastType.Success, true, 5000));
}
if (sent == "false") {
addToast(new Toast("Sorry, your E-Mail could not be sent... Please try again later!", ToastType.Error, true, 5000));
}
</script> </script>
<style> <style>
form { form {
display: flex; display: flex;
flex: 2 1 20%; flex-wrap: wrap;
flex: 2 1;
align-items: center; align-items: center;
margin: 1em; margin: 1em;
gap: 1em 3em; gap: 1em 3em;
} }
input, textarea { input, textarea {
padding: 1em; padding: 1em 0em 1em 1em;
background-color: var(--bg-grad); background-color: var(--bg-grad);
border: 0; border: 0;
outline: 0; outline: 0;
border-radius: 8px; border-radius: 8px;
resize: none; resize: none;
min-width: 100%; min-width: 100%;
transition: all 0.2s; transition: all 0.15s;
&:focus, &:hover{ &:focus, &:hover{
box-shadow: .2em .2em .2em var(--red); box-shadow: .2em .2em .2em var(--red);
@ -30,12 +43,22 @@
min-height: 10em; min-height: 10em;
} }
.container { .container {
display: flex; display: flex;
flex-direction: column; flex: 2 1 5rem;
gap: 1em 1em; flex-direction: column;
width: 100%; gap: 1em 1em;
} width: 100%;
}
.button {
color: var(--fg);
background-color: var(--bg-2);
box-shadow: .1em .1em .1em var(--purple);
}
.button:hover {
box-shadow: .3em .3em .3em var(--green);
}
</style> </style>
<Card> <Card>
@ -43,15 +66,20 @@
<h2>Contact</h2> <h2>Contact</h2>
</div> </div>
<div slot="content"> <div slot="content">
<form> <form action="https://api.staticforms.xyz/submit" method="post">
<div class="container"> <div class="container">
<input type="text" id="input-name" placeholder="Name"> <input type="hidden" name="accessKey" value="fbb5ec04-506b-448a-a445-a2e47579a966">
<input type="email" id="input-email" placeholder="Email address"> <input type="text" name="name" placeholder="Name" required>
<input type="text" id="input-subject" placeholder="Subject"> <input type="text" name="email" placeholder="Email address" required>
<input type="hidden" name="replyTo" value="@">
<input type="text" name="subject" placeholder="Subject" required>
<input type="text" name="honeypot" style="display: none;">
</div> </div>
<div class="container"> <div class="container">
<textarea name="message" id="input-message" placeholder="Message"></textarea> <textarea name="message" id="message" placeholder="Message" required></textarea>
</div> </div>
<input class="button" type="submit" value="Send" />
<input type="hidden" name="redirectTo" value="https://luke-else.co.uk/contact?sent=true">
</form> </form>
</div> </div>
<div slot="footer"> <div slot="footer">