mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 21:41:57 +00:00
Unified look of contact form with rest of site
This commit is contained in:
13
package.json
13
package.json
@@ -13,16 +13,17 @@
|
|||||||
"@sveltejs/kit": "^2.15.2",
|
"@sveltejs/kit": "^2.15.2",
|
||||||
"@sveltejs/package": "^2.3.7",
|
"@sveltejs/package": "^2.3.7",
|
||||||
"@sveltejs/vite-plugin-svelte": "^4.0.4",
|
"@sveltejs/vite-plugin-svelte": "^4.0.4",
|
||||||
|
"autoprefixer": "^10.4.20",
|
||||||
|
"globals": "^15.14.0",
|
||||||
|
"publint": "^0.2.12",
|
||||||
|
"sass": "^1.83.1",
|
||||||
"svelte": "^5.17.3",
|
"svelte": "^5.17.3",
|
||||||
"svelte-preprocess": "^5.1.4",
|
"svelte-preprocess": "^5.1.4",
|
||||||
"sass": "^1.83.1",
|
|
||||||
"autoprefixer": "^10.4.20",
|
|
||||||
"publint": "^0.2.12",
|
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.7.3",
|
|
||||||
"terser": "^5.37.0",
|
"terser": "^5.37.0",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"typescript": "^5.7.3",
|
||||||
"vite": "^5.4.11"
|
"vite": "^5.4.11",
|
||||||
|
"vite-plugin-compression": "^0.5.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tailwindcss/forms": "^0.5.10",
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Send, Loader2 } from "lucide-svelte";
|
import { Send, Loader2 } from "lucide-svelte";
|
||||||
|
import "$lib/styles/ContactForm.scss";
|
||||||
|
|
||||||
let formData = {
|
let formData = {
|
||||||
name: "",
|
name: "",
|
||||||
@@ -58,42 +59,27 @@
|
|||||||
|
|
||||||
{#if submitted}
|
{#if submitted}
|
||||||
<div class="form-container {$$props.class}">
|
<div class="form-container {$$props.class}">
|
||||||
<div class="text-center success-message">
|
<div class="success-message">
|
||||||
<h2 class="text-2xl font-semibold text-green-600 mb-4">
|
<h1 class="text-green-600 mb-4">Thank You!</h1>
|
||||||
Thank You!
|
<h2>Your message has been sent successfully.</h2>
|
||||||
</h2>
|
|
||||||
<p class="text-gray-600 mb-4">
|
|
||||||
Your message has been sent successfully.
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
on:click={() => (submitted = false)}
|
|
||||||
class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors"
|
|
||||||
>
|
|
||||||
Send Another Message
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="form-container {$$props.class}">
|
<div class="form-container {$$props.class}">
|
||||||
<h2 class="text-2xl font-semibold text-gray-800 mb-6">Contact Form</h2>
|
<h1 class="text-6xl mb-4">Contact Form</h1>
|
||||||
|
|
||||||
<form on:submit={handleSubmit} class="space-y-4">
|
<form on:submit={handleSubmit} class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label for="name"> Name </label>
|
||||||
for="name"
|
|
||||||
class="block text-sm font-medium text-gray-700 mb-1"
|
|
||||||
>
|
|
||||||
Name
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="name"
|
id="name"
|
||||||
name="name"
|
name="name"
|
||||||
|
placeholder="Carl Deckard"
|
||||||
bind:value={formData.name}
|
bind:value={formData.name}
|
||||||
on:input={handleInput}
|
on:input={handleInput}
|
||||||
class="w-full px-3 py-2 border rounded-md {errors.name
|
class="w-full text-lg px-3 py-2 rounded-md border-[1px] border-solid border-gray-300 hover:border-blue-500 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
? 'error'
|
class:border-red-500={errors.name}
|
||||||
: 'border-gray-300'}"
|
|
||||||
/>
|
/>
|
||||||
{#if errors.name}
|
{#if errors.name}
|
||||||
<p class="mt-1 text-sm text-red-500">{errors.name}</p>
|
<p class="mt-1 text-sm text-red-500">{errors.name}</p>
|
||||||
@@ -101,21 +87,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label for="email"> Email </label>
|
||||||
for="email"
|
|
||||||
class="block text-sm font-medium text-gray-700 mb-1"
|
|
||||||
>
|
|
||||||
Email
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="text"
|
||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
|
placeholder="example@university.edu"
|
||||||
bind:value={formData.email}
|
bind:value={formData.email}
|
||||||
on:input={handleInput}
|
on:input={handleInput}
|
||||||
class="w-full px-3 py-2 border rounded-md {errors.email
|
class="w-full text-lg px-3 py-2 rounded-md border-[1px] border-solid border-gray-300 hover:border-blue-500 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
? 'error'
|
class:border-red-500={errors.email}
|
||||||
: 'border-gray-300'}"
|
|
||||||
/>
|
/>
|
||||||
{#if errors.email}
|
{#if errors.email}
|
||||||
<p class="mt-1 text-sm text-red-500">{errors.email}</p>
|
<p class="mt-1 text-sm text-red-500">{errors.email}</p>
|
||||||
@@ -123,21 +104,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label for="subject"> Subject </label>
|
||||||
for="subject"
|
|
||||||
class="block text-sm font-medium text-gray-700 mb-1"
|
|
||||||
>
|
|
||||||
Subject
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="subject"
|
id="subject"
|
||||||
name="subject"
|
name="subject"
|
||||||
|
placeholder="I want to discuss AM"
|
||||||
bind:value={formData.subject}
|
bind:value={formData.subject}
|
||||||
on:input={handleInput}
|
on:input={handleInput}
|
||||||
class="w-full px-3 py-2 border rounded-md {errors.subject
|
class="w-full text-lg px-3 py-2 rounded-md border-[1px] border-solid border-gray-300 hover:border-blue-500 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
? 'error'
|
class:border-red-500={errors.subject}
|
||||||
: 'border-gray-300'}"
|
|
||||||
/>
|
/>
|
||||||
{#if errors.subject}
|
{#if errors.subject}
|
||||||
<p class="mt-1 text-sm text-red-500">{errors.subject}</p>
|
<p class="mt-1 text-sm text-red-500">{errors.subject}</p>
|
||||||
@@ -145,22 +121,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label for="message"> Message </label>
|
||||||
for="message"
|
|
||||||
class="block text-sm font-medium text-gray-700 mb-1"
|
|
||||||
>
|
|
||||||
Message
|
|
||||||
</label>
|
|
||||||
<textarea
|
<textarea
|
||||||
id="message"
|
id="message"
|
||||||
name="message"
|
name="message"
|
||||||
|
placeholder="Enter your question or message"
|
||||||
bind:value={formData.message}
|
bind:value={formData.message}
|
||||||
on:input={handleInput}
|
on:input={handleInput}
|
||||||
rows={4}
|
rows={8}
|
||||||
class="w-full px-3 py-2 border rounded-md {errors.message
|
class="w-full text-lg px-3 py-2 rounded-md border-[1px] border-solid border-gray-300 hover:border-blue-500 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
? 'error'
|
class:border-red-500={errors.message}
|
||||||
: 'border-gray-300'}"
|
></textarea>
|
||||||
/>
|
|
||||||
{#if errors.message}
|
{#if errors.message}
|
||||||
<p class="mt-1 text-sm text-red-500">{errors.message}</p>
|
<p class="mt-1 text-sm text-red-500">{errors.message}</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.submit-button {
|
.submit-button {
|
||||||
width: 100%;
|
width: auto;
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
background-color: #2563eb;
|
background-color: var(--background);
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 0.375rem;
|
border-radius: 0.375rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
transition: background-color 0.2s ease;
|
transition: background-color 0.2s ease;
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
&:hover:not(:disabled) {
|
||||||
background-color: #1d4ed8;
|
background-color: var(--cpalettemedium);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ h1 {
|
|||||||
padding-bottom: 18px;
|
padding-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2,
|
||||||
|
label {
|
||||||
font-family: "Assistant";
|
font-family: "Assistant";
|
||||||
color: #828282;
|
color: #828282;
|
||||||
font-size: 32pt;
|
font-size: 32pt;
|
||||||
@@ -41,6 +42,10 @@ h2 {
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-family: "Assistant";
|
font-family: "Assistant";
|
||||||
font-size: 24pt;
|
font-size: 24pt;
|
||||||
|
|||||||
@@ -46,3 +46,13 @@
|
|||||||
max-width: var(--contact-img-size);
|
max-width: var(--contact-img-size);
|
||||||
max-height: var(--contact-img-size);
|
max-height: var(--contact-img-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (orientation: landscape) and (min-width: 1200px) {
|
||||||
|
.contact-form-column {
|
||||||
|
width: 67%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infscr-row-reverse {
|
||||||
|
width: 33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,11 +2,19 @@ import forms from '@tailwindcss/forms';
|
|||||||
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
content: ['./src/**/*.{html,js,svelte,ts}'],
|
content: ['./src/**/*.{html,js,svelte,ts}'],
|
||||||
|
|
||||||
theme: {
|
theme: {
|
||||||
extend: {}
|
extend: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [forms]
|
plugins: [forms],
|
||||||
|
|
||||||
|
theme: {
|
||||||
|
fontFamily: {
|
||||||
|
sans: ["Assistant", "sans-serif"],
|
||||||
|
serif: ["Martel", "serif"],
|
||||||
|
mono: ["Consolas", "monospace"],
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user