diff --git a/.gitignore b/.gitignore
index d66edda..a8587e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
.idea
.DS_Store
-vendor
+/vendor
\ No newline at end of file
diff --git a/resources/views/_panels/form.antlers.html b/resources/views/_panels/form.antlers.html
index bcdbf4a..faf72e3 100644
--- a/resources/views/_panels/form.antlers.html
+++ b/resources/views/_panels/form.antlers.html
@@ -1,47 +1,39 @@
{{#
FORM EXAMPLE
- + REFERENCES HCAPTCHA SO REMOVE IF NOT NEEDED
+ + REFERENCES TURNSTILE SO REMOVE IF NOT NEEDED OR USING SOMETHING ELSE
#}}
- {{ form:create in="{choose_form|raw}" js="alpine:form" attr:x-ref="form" \x-data='{"h-captcha-response": ""}' }}
+ {{ form:create in="{choose_form|raw}" js="alpine:form" attr:x-ref="form" \x-data='{"cf-turnstile-response": ""}'}}
{
+ handler.$refs.form.classList.add('success');
+ handler.form.success = true;
+ setTimeout(() => { handler.$refs.form.classList.remove('success'); handler.form.success = false; }, 8000);
+ },
+ onError: (handler) => {
+ turnstile.reset()
+ }
+ })"
+ x-cloak
+ x-init="cfWidgetId = null;"
+ @turnstile-ready.window="
+ if (this.cfWidgetId) {
+ turnstile.remove(this.cfWidgetId);
+ }
+
+ let cfEl = $el.querySelector('.cf-turnstile');
+
+ this.cfWidgetId = turnstile.render(cfEl, {
+ sitekey: cfEl.getAttribute('data-sitekey'),
+ callback: function (token) {
+ form['cf-turnstile-response'] = token;
}
-
- hcaptcha.execute(widgetId, { async: true })
- .then(({ response, key }) => {
- handler.form['h-captcha-response'] = response;
- handler.submitWithoutInterception();
- })
- .catch(err => {
- handler.form.errors._unspecified = 'Captcha error';
- hcaptcha.reset(widgetId);
- });
- }
- })"
- @hcaptcha-ready.window="
- let el;
- if (el = $el.querySelector('.h-captcha')) {
- let functionId = $id('hcaptchaCallBack');
- el.setAttribute('data-callback', functionId);
-
- window[functionId] = () => {
- // empty function to prevent captcha doing anything
- }
-
- hcaptcha.render(el);
- }
- "
- >
+ });
+ "
+ >
One of our team will be in touch as soon as possible.
diff --git a/resources/views/vendor/captcha/turnstile/head.blade.php b/resources/views/vendor/captcha/turnstile/head.blade.php
new file mode 100644
index 0000000..66943fd
--- /dev/null
+++ b/resources/views/vendor/captcha/turnstile/head.blade.php
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file