Skip to content

Commit

Permalink
feat: use cf turnstile
Browse files Browse the repository at this point in the history
  • Loading branch information
faultables committed Sep 7, 2024
1 parent a646f93 commit 3d90f52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ em {
color: var(--primary-color);
border-radius: 3px;
margin-top: 2rem;
margin-bottom: 2rem;
}

.js-modal button {
Expand Down Expand Up @@ -509,11 +510,11 @@ em {

.js-modal__content {
max-width: 500px;
max-height: 400px;
max-height: 500px;
left: 50%;
top: 50%;
margin-left: -250px;
margin-top: -200px;
margin-top: -250px;
border-radius: 10px;
}
}
1 change: 1 addition & 0 deletions src/_includes/layouts/base.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
{{ content }}
</main>

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js"></script>
</body>
</html>
7 changes: 6 additions & 1 deletion src/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ layout: layouts/base
<h2>Join the waitlist</h2>
<p>Currently flo is in early preview and we'll let you know when we're on the App Store.</p>
<input id="email" type="email" placeholder="john@doe.com" required>
<button id="submit">Submit</button>
<div class="cf-turnstile" data-callback="enableSubmit" data-sitekey="0x4AAAAAAAi7bs0DROJL1xPi" data-size="flexible"></div>
<button id="submit" disabled>Submit</button>
</div>
</div>

Expand All @@ -133,6 +134,10 @@ const closeModal = document.getElementById('closeModal')
const emailForm = document.getElementById('email')
const submitButton = document.getElementById('submit')
function enableSubmit() {
submitButton.removeAttribute('disabled')
}
openModal.onclick = function() {
modal.style.display = 'block'
Expand Down

0 comments on commit 3d90f52

Please sign in to comment.