Feat: Replace Google ReCAPTCHA with ALTCHA using API - non-tracking, GDPR compliant without cookies or fingerprinting.
This commit is contained in:
@@ -10,9 +10,32 @@ export default class PageContact extends BasePage {
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
this.hookupCaptcha();
|
||||
this.hookupButtonSubmitFormContactUs();
|
||||
}
|
||||
|
||||
hookupCaptcha() {
|
||||
const form = document.querySelector(idContactForm);
|
||||
const altchaWidget = form.querySelector('altcha-widget');
|
||||
|
||||
// Listen for verification events from the ALTCHA widget
|
||||
if (altchaWidget) {
|
||||
altchaWidget.addEventListener('serververification', function(event) {
|
||||
// Create or update the hidden input for ALTCHA
|
||||
let altchaInput = form.querySelector('input[name="altcha"]');
|
||||
if (!altchaInput) {
|
||||
altchaInput = document.createElement('input');
|
||||
altchaInput.type = 'hidden';
|
||||
altchaInput.name = 'altcha';
|
||||
form.appendChild(altchaInput);
|
||||
}
|
||||
|
||||
// Set the verification payload
|
||||
altchaInput.value = event.detail.payload;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
hookupButtonSubmitFormContactUs() {
|
||||
const button = document.querySelector('form input[type="submit"]');
|
||||
button.classList.add(flagButton);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// internal
|
||||
import BasePage from "../base.js";
|
||||
// external
|
||||
import AOS from 'aos';
|
||||
|
||||
|
||||
export default class PageHome extends BasePage {
|
||||
@@ -15,46 +14,10 @@ export default class PageHome extends BasePage {
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
this.hookupButtonsNavContact();
|
||||
// this.initialiseAOS();
|
||||
this.initialiseAnimations();
|
||||
}
|
||||
|
||||
/* AOS */
|
||||
initialiseAOS() {
|
||||
AOS.init({
|
||||
duration: 1000,
|
||||
once: true,
|
||||
});
|
||||
}
|
||||
/* Manual animations *
|
||||
initialiseAnimations() {
|
||||
// Check if IntersectionObserver is supported
|
||||
if ('IntersectionObserver' in window) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('active');
|
||||
}
|
||||
});
|
||||
}, {
|
||||
threshold: 0.1,
|
||||
rootMargin: '50px'
|
||||
});
|
||||
|
||||
// Observe all elements with 'reveal' class
|
||||
document.querySelectorAll('.reveal').forEach((element) => {
|
||||
observer.observe(element);
|
||||
});
|
||||
} else {
|
||||
// If IntersectionObserver is not supported, make all elements visible
|
||||
document.querySelectorAll('.reveal').forEach((element) => {
|
||||
element.style.opacity = 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
leave() {
|
||||
super.leave();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2636
static/js/vendor/altcha.js
vendored
Normal file
2636
static/js/vendor/altcha.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user