<div class="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-12 px-4">
<div class="max-w-md mx-auto bg-white rounded-xl shadow-lg p-8">
<h2 class="text-2xl font-bold text-gray-900 mb-2">Get in Touch</h2>
<p class="text-gray-600 mb-6">Fill out the form below and we'll get back to you soon.</p>
<form class="space-y-6">
<!-- Name -->
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">
Full Name
</label>
<input
type="text"
id="name"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="John Doe"
/>
</div>
<!-- Email -->
<div>
<label for="email" class="block text-sm font-medium text-gray-700 mb-2">
Email Address
</label>
<input
type="email"
id="email"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="john@example.com"
/>
</div>
<!-- Subject -->
<div>
<label for="subject" class="block text-sm font-medium text-gray-700 mb-2">
Subject
</label>
<select
id="subject"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
>
<option>General Inquiry</option>
<option>Technical Support</option>
<option>Sales Question</option>
<option>Partnership</option>
</select>
</div>
<!-- Message -->
<div>
<label for="message" class="block text-sm font-medium text-gray-700 mb-2">
Message
</label>
<textarea
id="message"
rows="4"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition resize-none"
placeholder="Tell us more about your inquiry..."
></textarea>
</div>
<!-- Checkbox -->
<div class="flex items-start">
<input
type="checkbox"
id="terms"
class="w-4 h-4 mt-1 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
/>
<label for="terms" class="ml-2 text-sm text-gray-600">
I agree to the <a href="#" class="text-blue-600 hover:underline">Terms and Conditions</a>
</label>
</div>
<!-- Submit Button -->
<button
type="submit"
class="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition"
>
Send Message
</button>
</form>
<!-- Alternative Contact -->
<div class="mt-6 pt-6 border-t border-gray-200">
<p class="text-sm text-gray-600 text-center">
Or email us directly at
<a href="mailto:contact@example.com" class="text-blue-600 hover:underline">
contact@example.com
</a>
</p>
</div>
</div>
</div>
import { useState } from 'react';
export default function ContactForm() {
const [formData, setFormData] = useState({
name: '',
email: '',
subject: 'General Inquiry',
message: '',
terms: false
});
const handleSubmit = (e) => {
e.preventDefault();
console.log('Form submitted:', formData);
};
const handleChange = (e) => {
const { name, value, type, checked } = e.target;
setFormData(prev => ({
...prev,
[name]: type === 'checkbox' ? checked : value
}));
};
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-12 px-4">
<div className="max-w-md mx-auto bg-white rounded-xl shadow-lg p-8">
<h2 className="text-2xl font-bold text-gray-900 mb-2">Get in Touch</h2>
<p className="text-gray-600 mb-6">Fill out the form below and we'll get back to you soon.</p>
<form onSubmit={handleSubmit} className="space-y-6">
{/* Name */}
<div>
<label htmlFor="name" className="block text-sm font-medium text-gray-700 mb-2">
Full Name
</label>
<input
type="text"
id="name"
name="name"
value={formData.name}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="John Doe"
/>
</div>
{/* Email */}
<div>
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-2">
Email Address
</label>
<input
type="email"
id="email"
name="email"
value={formData.email}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="john@example.com"
/>
</div>
{/* Subject */}
<div>
<label htmlFor="subject" className="block text-sm font-medium text-gray-700 mb-2">
Subject
</label>
<select
id="subject"
name="subject"
value={formData.subject}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
>
<option>General Inquiry</option>
<option>Technical Support</option>
<option>Sales Question</option>
<option>Partnership</option>
</select>
</div>
{/* Message */}
<div>
<label htmlFor="message" className="block text-sm font-medium text-gray-700 mb-2">
Message
</label>
<textarea
id="message"
name="message"
rows={4}
value={formData.message}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition resize-none"
placeholder="Tell us more about your inquiry..."
/>
</div>
{/* Checkbox */}
<div className="flex items-start">
<input
type="checkbox"
id="terms"
name="terms"
checked={formData.terms}
onChange={handleChange}
className="w-4 h-4 mt-1 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
/>
<label htmlFor="terms" className="ml-2 text-sm text-gray-600">
I agree to the <a href="#" className="text-blue-600 hover:underline">Terms and Conditions</a>
</label>
</div>
{/* Submit Button */}
<button
type="submit"
className="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition"
>
Send Message
</button>
</form>
{/* Alternative Contact */}
<div className="mt-6 pt-6 border-t border-gray-200">
<p className="text-sm text-gray-600 text-center">
Or email us directly at
<a href="mailto:contact@example.com" className="text-blue-600 hover:underline ml-1">
contact@example.com
</a>
</p>
</div>
</div>
</div>
);
}
<template>
<div class="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-12 px-4">
<div class="max-w-md mx-auto bg-white rounded-xl shadow-lg p-8">
<h2 class="text-2xl font-bold text-gray-900 mb-2">Get in Touch</h2>
<p class="text-gray-600 mb-6">Fill out the form below and we'll get back to you soon.</p>
<form @submit.prevent="handleSubmit" class="space-y-6">
<!-- Name -->
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">
Full Name
</label>
<input
v-model="formData.name"
type="text"
id="name"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="John Doe"
/>
</div>
<!-- Email -->
<div>
<label for="email" class="block text-sm font-medium text-gray-700 mb-2">
Email Address
</label>
<input
v-model="formData.email"
type="email"
id="email"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
placeholder="john@example.com"
/>
</div>
<!-- Subject -->
<div>
<label for="subject" class="block text-sm font-medium text-gray-700 mb-2">
Subject
</label>
<select
v-model="formData.subject"
id="subject"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
>
<option>General Inquiry</option>
<option>Technical Support</option>
<option>Sales Question</option>
<option>Partnership</option>
</select>
</div>
<!-- Message -->
<div>
<label for="message" class="block text-sm font-medium text-gray-700 mb-2">
Message
</label>
<textarea
v-model="formData.message"
id="message"
rows="4"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition resize-none"
placeholder="Tell us more about your inquiry..."
/>
</div>
<!-- Checkbox -->
<div class="flex items-start">
<input
v-model="formData.terms"
type="checkbox"
id="terms"
class="w-4 h-4 mt-1 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
/>
<label for="terms" class="ml-2 text-sm text-gray-600">
I agree to the <a href="#" class="text-blue-600 hover:underline">Terms and Conditions</a>
</label>
</div>
<!-- Submit Button -->
<button
type="submit"
class="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-semibold hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition"
>
Send Message
</button>
</form>
<!-- Alternative Contact -->
<div class="mt-6 pt-6 border-t border-gray-200">
<p class="text-sm text-gray-600 text-center">
Or email us directly at
<a href="mailto:contact@example.com" class="text-blue-600 hover:underline">
contact@example.com
</a>
</p>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
const formData = ref({
name: '',
email: '',
subject: 'General Inquiry',
message: '',
terms: false
});
const handleSubmit = () => {
console.log('Form submitted:', formData.value);
};
</script>