Skip to content

Instantly share code, notes, and snippets.

@sjkp
Last active August 19, 2024 17:18
Show Gist options
  • Save sjkp/956815b46aa89a23d2067d27e49adc98 to your computer and use it in GitHub Desktop.
Save sjkp/956815b46aa89a23d2067d27e49adc98 to your computer and use it in GitHub Desktop.
CloudFlare-EmailForm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern Contact Form</title>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" defer></script>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.contact-form {
background-color: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}
h2 {
text-align: center;
color: #333;
}
.form-group {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 0.5rem;
color: #666;
}
input, textarea {
width: 100%;
padding: 0.5rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
box-sizing:border-box
}
textarea {
height: 100px;
resize: vertical;
}
button {
background-color: #007bff;
color: white;
border: none;
padding: 0.75rem 1rem;
border-radius: 4px;
cursor: pointer;
width: 100%;
font-size: 1rem;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="contact-form">
<h2>Contact Us</h2>
<form action="/" method="POST">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>
</div>
<div class="cf-turnstile" data-sitekey="0x4AAAAAAAhmY9XGHheaRPLx" data-theme="light"></div>
<button type="submit">Send Message</button>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment