give me a modern glassmorphich booking form for an event styling services website
- User
give me a modern glassmorphich booking form for an event styling services website
- Assistant
give me a modern glassmorphich booking form for an event styling services website
Creating a modern glassmorphic booking form involves using HTML and CSS to achieve the frosted glass effect characteristic of glassmorphism. Below is a comprehensive example that you can integrate into your event styling services website. This example includes responsive design, smooth UI elements, and clear form fields to enhance user experience.
Create an HTML file (e.g., index.html) and include the following structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Event Styling Booking Form</title>
<link rel="stylesheet" href="styles.css"> <!-- Link to your CSS file -->
<!-- Google Fonts for better typography -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>
<div class="background">
<!-- You can set a background image or color here -->
</div>
<div class="container">
<form class="booking-form">
<h2>Book Your Event Styling</h2>
<div class="input-group">
<label for="name">Full Name</label>
<input type="text" id="name" name="name" placeholder="Your Name" required>
</div>
<div class="input-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="you@example.com" required>
</div>
<div class="input-group">
<label for="event-date">Event Date</label>
<input type="date" id="event-date" name="event-date" required>
</div>
<div class="input-group">
<label for="services">Select Services</label>
<select id="services" name="services" required>
<option value="" disabled selected>Select a service</option>
<option value="decor">Decorations</option>
<option value="lighting">Lighting</option>
<option value="floral">Floral Arrangements</option>
<option value="entertainment">Entertainment</option>
</select>
</div>
<div class="input-group">
<label for="message">Additional Details</label>
<textarea id="message" name="message" rows="4" placeholder="Any specific requests?"></textarea>
</div>
<button type="submit">Submit Booking</button>
</form>
</div>
</body>
</html>
Create a CSS file (e.g., styles.css) and add the following styles:
/* Importing Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, html {
height: 100%;
font-family: 'Roboto', sans-serif;
}
/* Background Styling */
.background {
background: url('your-background-image.jpg') no-repeat center center fixed;
background-size: cover;
filter: brightness(0.7);
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
}
/* Container to center the form */
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
padding: 20px;
}
/* Glassmorphic Form Styling */
.booking-form {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 15px;
border: 1px solid rgba(255, 255, 255, 0.3);
padding: 30px;
width: 100%;
max-width: 400px;
color: #fff;
}
.booking-form h2 {
text-align: center;
margin-bottom: 20px;
font-weight: 500;
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-size: 0.9rem;
}
.input-group input,
.input-group select,
.input-group textarea {
width: 100%;
padding: 10px 15px;
border: none;
border-radius: 8px;
background: rgba(255, 255, 255, 0.3);
color: #fff;
font-size: 0.9rem;
outline: none;
transition: background 0.3s ease;
}
.input-group input::placeholder,
.input-group select::placeholder,
.input-group textarea::placeholder {
color: #eee;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
background: rgba(255, 255, 255, 0.4);
}
button {
width: 100%;
padding: 12px;
border: none;
border-radius: 8px;
background: rgba(255, 255, 255, 0.3);
color: #fff;
font-size: 1rem;
cursor: pointer;
transition: background 0.3s ease;
backdrop-filter: blur(5px);
}
button:hover {
background: rgba(255, 255, 255, 0.5);
}
/* Responsive Design */
@media (max-width: 500px) {
.booking-form {
padding: 20px;
}
}
Background:
.background div sets a full-screen background image. Replace 'your-background-image.jpg' with your desired image or use a solid color by modifying the background property.Glassmorphism Effect:
booking-form class uses rgba with low opacity and backdrop-filter: blur() to create the frosted glass effect.Typography:
Form Fields:
Buttons & Interactions:
Responsiveness:
Customization Tips:
rgba values for different background and form colors to match your brand.transform or opacity) for more dynamic interactions.To make the form functional, you might want to handle form submissions. Below is a simple example using JavaScript to display a success message upon submission. For real-world applications, integrate backend services or form handling tools like Formspree, Google Forms, or custom APIs.
Add the following script before the closing </body> tag in your index.html:
<script>
const form = document.querySelector('.booking-form');
form.addEventListener('submit', function(e) {
e.preventDefault(); // Prevent the default form submission
// Simple validation (optional)
const name = form.name.value.trim();
const email = form.email.value.trim();
const eventDate = form['event-date'].value;
const services = form.services.value;
if (!name || !email || !eventDate || !services) {
alert('Please fill in all required fields.');
return;
}
// Here you can handle the form data, e.g., send it to a server
// For this example, we'll just display a success message
alert('Thank you for your booking! We will get back to you soon.');
// Reset the form
form.reset();
});
</script>
Browser Support: Ensure that the backdrop-filter property is supported in the browsers your audience uses. As of now, it is supported in most modern browsers, but always check the Can I use for up-to-date compatibility.
Accessibility: Ensure that color contrasts meet accessibility standards. Tools like WebAIM's Contrast Checker can help.
Optimization: Optimize background images for faster loading times. Use formats like WebP and consider lazy loading if necessary.
Security: If processing form data, ensure you handle it securely to protect user information.
By following the above steps, you should have a sleek, modern glassmorphic booking form that enhances the aesthetics and functionality of your event styling services website. Feel free to tweak the design and functionality to better suit your specific needs and branding.
Not yet included in a published release.