Skip to content

Commit 8b6f88a

Browse files
Create secret netlify form
1 parent 1899d0e commit 8b6f88a

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
3+
---
4+
5+
<div class="feedback-form">
6+
<form
7+
data-netlify="true"
8+
netlify-honeypot
9+
name="feedback"
10+
method="POST"
11+
action="/form-success"
12+
>
13+
<p class="hidden">
14+
<label>
15+
Don’t fill this out if you’re human: <input name="bot-field" />
16+
</label>
17+
</p>
18+
<input type="hidden" name="form-name" value="feedback" />
19+
<label for="name">Name</label>
20+
<input id="name" type="text" name="name" />
21+
<label for="email">Email</label>
22+
<input id="email" type="email" name="email" required />
23+
<button type="submit">Submit</button>
24+
</form>
25+
</div>
26+
27+
<style>
28+
.feedback-form {
29+
min-width: 250px;
30+
width: 45%;
31+
}
32+
label {
33+
font-size: 16px;
34+
}
35+
input,
36+
textarea,
37+
button {
38+
border-radius: 5px;
39+
border: 1px solid #cbd5e1;
40+
font-size: inherit;
41+
margin: 15px 0;
42+
padding: 12px 20px;
43+
width: 100%;
44+
}
45+
button {
46+
background-color: #2bdcd2;
47+
border: 1px solid #2bdcd2;
48+
color: #1e293b;
49+
font-size: 16px;
50+
width: 50%;
51+
}
52+
.hidden {
53+
clip: rect(0 0 0 0);
54+
clip-path: inset(50%);
55+
height: 1px;
56+
overflow: hidden;
57+
position: absolute;
58+
white-space: nowrap;
59+
width: 1px;
60+
}
61+
</style>

src/pages/form-success.astro

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
import BaseLayout from "../layouts/BaseLayout.astro";
3+
import "../styles/icons.css";
4+
---
5+
6+
<BaseLayout
7+
title="Audacity Cloud Saving Platform"
8+
description="Never lose your work in Audacity with seamless sync to Cloud Storage"
9+
>
10+
<section class="mx-8 max-w-screen-md xl:max-w-screen-lg md:mx-auto">
11+
<div class="py-8 sm:py-12 flex flex-col items-center">
12+
<div class="text-center">
13+
<h1>
14+
Submission successful, thanks!
15+
</h1>
16+
<div class="mt-12">
17+
<a href="/" class="w-fit px-4 py-4 bg-gray-200 my-4 rounded-md hover:bg-gray-300 cursor-pointer">Continue</a>
18+
</div>
19+
</div>
20+
</div>
21+
</section>
22+
</BaseLayout>

src/pages/secret-form.astro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
import NewsletterForm from "../components/form/NewsletterForm.astro";
3+
import BaseLayout from "../layouts/BaseLayout.astro";
4+
import "../styles/icons.css";
5+
---
6+
7+
<BaseLayout
8+
title="Audacity Cloud Saving Platform"
9+
description="Never lose your work in Audacity with seamless sync to Cloud Storage"
10+
>
11+
<section class="mx-8 max-w-screen-md xl:max-w-screen-lg md:mx-auto">
12+
<div class="mt-8 flex flex-col items-center gap-8">
13+
<h1>Sign up to our newsletter</h1>
14+
<NewsletterForm />
15+
</div>
16+
</section>
17+
</BaseLayout>

0 commit comments

Comments
 (0)