Skip to content

Commit abf6d65

Browse files
dahliaclaude
andcommitted
Integrate Buttondown for newsletter subscription
Use standard HTML form submission to Buttondown API instead of JavaScript fetch to avoid CORS issues. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 97b7815 commit abf6d65

1 file changed

Lines changed: 10 additions & 38 deletions

File tree

src/components/NewsletterSection.vue

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
<script setup lang="ts">
2-
import { ref } from 'vue'
3-
4-
const email = ref('')
5-
const isSubmitted = ref(false)
6-
const isSubmitting = ref(false)
7-
8-
const handleSubmit = async () => {
9-
if (!email.value || isSubmitting.value) return
10-
11-
isSubmitting.value = true
12-
13-
// Simulate API call delay
14-
await new Promise(resolve => setTimeout(resolve, 800))
15-
16-
isSubmitted.value = true
17-
isSubmitting.value = false
18-
}
192
</script>
203

214
<template>
@@ -47,29 +30,29 @@ const handleSubmit = async () => {
4730
</p>
4831

4932
<!-- Form -->
50-
<div v-if="!isSubmitted" class="max-w-md mx-auto">
51-
<form @submit.prevent="handleSubmit" class="relative">
33+
<div class="max-w-md mx-auto">
34+
<form
35+
action="https://buttondown.com/api/emails/fedify-studio"
36+
method="post"
37+
target="_blank"
38+
class="relative"
39+
>
5240
<div class="flex flex-col sm:flex-row gap-3">
5341
<div class="relative flex-1">
5442
<div class="absolute left-4 top-1/2 -translate-y-1/2 i-lucide-mail w-5 h-5 text-slate-500" />
5543
<input
56-
v-model="email"
5744
type="email"
45+
name="email"
5846
required
5947
placeholder="you@example.com"
6048
class="w-full pl-12 pr-4 py-4 rounded-xl bg-white/10 border border-white/20 text-white placeholder-slate-500 focus:outline-none focus:border-fedify-blue focus:ring-2 focus:ring-fedify-blue/20 transition-all duration-300"
6149
/>
6250
</div>
6351
<button
6452
type="submit"
65-
:disabled="isSubmitting"
66-
class="px-8 py-4 rounded-xl bg-gradient-to-r from-fedify-blue to-fedify-violet text-white font-semibold hover:shadow-lg hover:shadow-fedify-blue/30 transition-all duration-300 disabled:opacity-70 disabled:cursor-not-allowed flex items-center justify-center gap-2"
53+
class="px-8 py-4 rounded-xl bg-gradient-to-r from-fedify-blue to-fedify-violet text-white font-semibold hover:shadow-lg hover:shadow-fedify-blue/30 transition-all duration-300 flex items-center justify-center gap-2"
6754
>
68-
<span v-if="!isSubmitting">Notify me</span>
69-
<span v-else class="flex items-center gap-2">
70-
<div class="w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" />
71-
<span>Subscribing...</span>
72-
</span>
55+
Notify me
7356
</button>
7457
</div>
7558
</form>
@@ -78,17 +61,6 @@ const handleSubmit = async () => {
7861
</p>
7962
</div>
8063

81-
<!-- Success state -->
82-
<div v-else class="max-w-md mx-auto">
83-
<div class="p-8 rounded-2xl bg-emerald-500/20 border border-emerald-500/30">
84-
<div class="i-lucide-check-circle w-12 h-12 mx-auto text-emerald-400 mb-4" />
85-
<h3 class="text-xl font-semibold text-white mb-2">You're on the list!</h3>
86-
<p class="text-slate-400">
87-
Thanks for your interest in Fedify Studio. We'll let you know as soon as it's ready.
88-
</p>
89-
</div>
90-
</div>
91-
9264
<!-- Social proof -->
9365
<div class="mt-12 pt-12 border-t border-white/10">
9466
<p class="text-sm text-slate-500 mb-4">Fedify Studio is a sister project of</p>

0 commit comments

Comments
 (0)