|
556 | 556 | color: var(--text-muted); |
557 | 557 | text-align: center; |
558 | 558 | margin-top: 0.6rem; |
| 559 | + transition: color 0.3s; |
559 | 560 | } |
| 561 | + .signup-note.success { color: var(--terminal-green); } |
| 562 | + .signup-note.error { color: #ef4444; } |
560 | 563 |
|
561 | 564 | /* Builder note */ |
562 | 565 | .builder-note { |
@@ -633,12 +636,11 @@ <h1> |
633 | 636 | <span class="gradient">Design better courses.</span> |
634 | 637 | </h1> |
635 | 638 | <p>Open source instructional design skills for Claude Code. Every recommendation is backed by peer-reviewed research, so you always know how strong the evidence is.</p> |
636 | | - <form action="https://formspree.io/f/xkokkzyy" method="POST" class="signup-form"> |
| 639 | + <form id="signup-form" class="signup-form"> |
637 | 640 | <input type="email" name="email" placeholder="your@email.com" required aria-label="Email address"> |
638 | 641 | <button type="submit">Get updates</button> |
639 | | - <input type="hidden" name="_next" value="https://idstack.org/"> |
640 | 642 | </form> |
641 | | - <p class="signup-note">No spam. Just releases.</p> |
| 643 | + <p class="signup-note" id="signup-note">No spam. Just releases.</p> |
642 | 644 | </header> |
643 | 645 |
|
644 | 646 | <hr class="section-divider" style="margin-top: 3rem;"> |
@@ -1040,6 +1042,35 @@ <h3>Where we're headed</h3> |
1040 | 1042 | document.body.removeChild(textarea); |
1041 | 1043 | } |
1042 | 1044 | } |
| 1045 | + |
| 1046 | + document.getElementById('signup-form').addEventListener('submit', function(e) { |
| 1047 | + e.preventDefault(); |
| 1048 | + var form = this; |
| 1049 | + var btn = form.querySelector('button'); |
| 1050 | + var note = document.getElementById('signup-note'); |
| 1051 | + btn.disabled = true; |
| 1052 | + btn.textContent = 'Sending...'; |
| 1053 | + fetch('https://formspree.io/f/xkokkzyy', { |
| 1054 | + method: 'POST', |
| 1055 | + body: new FormData(form), |
| 1056 | + headers: { 'Accept': 'application/json' } |
| 1057 | + }).then(function(res) { |
| 1058 | + if (res.ok) { |
| 1059 | + note.textContent = 'You\u2019re in! We\u2019ll keep you posted.'; |
| 1060 | + note.className = 'signup-note success'; |
| 1061 | + form.reset(); |
| 1062 | + } else { |
| 1063 | + note.textContent = 'Something went wrong. Try again.'; |
| 1064 | + note.className = 'signup-note error'; |
| 1065 | + } |
| 1066 | + }).catch(function() { |
| 1067 | + note.textContent = 'Something went wrong. Try again.'; |
| 1068 | + note.className = 'signup-note error'; |
| 1069 | + }).finally(function() { |
| 1070 | + btn.disabled = false; |
| 1071 | + btn.textContent = 'Get updates'; |
| 1072 | + }); |
| 1073 | + }); |
1043 | 1074 | </script> |
1044 | 1075 |
|
1045 | 1076 | </body> |
|
0 commit comments