add newsletter and test avatar

This commit is contained in:
2025-03-21 11:15:37 +01:00
parent b848184b4b
commit b7578da307
15 changed files with 83 additions and 28 deletions

View File

@@ -1,14 +1,25 @@
document.addEventListener('DOMContentLoaded', () => {
// Newsletter form submission
const form = document.getElementById('newsletter-form');
form.addEventListener('submit', (e) => {
form.addEventListener('submit', async (e) => {
e.preventDefault();
const email = e.target.querySelector('input[type="email"]').value;
// Here you would typically send this to your backend
alert('Thanks for subscribing! Check your email for confirmation.');
form.reset();
const subscribe = e.target.querySelector('input[id="subscribe"]').value;
const message = e.target.querySelector('input[id="sub_message"]');
message.setAttribute('type','text');
message.type = 'text';
const response = await fetch('http://localhost:3001/newsletter', {
method: 'POST',
body: JSON.stringify({
"email": email,
"subscribe": subscribe
}),
headers: {
'Content-Type': 'application/json'
}
});
});
// Add subtle parallax effect to video background
document.addEventListener('mousemove', (e) => {
const mouseX = e.clientX / window.innerWidth;