add newsletter and test avatar
This commit is contained in:
21
script.js
21
script.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user