-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
24 lines (23 loc) · 883 Bytes
/
scripts.js
File metadata and controls
24 lines (23 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Simple site scripts: mobile nav toggle + contact form stub
document.addEventListener('DOMContentLoaded', function () {
var toggle = document.getElementById('nav-toggle');
var nav = document.getElementById('main-nav');
if (toggle && nav) {
toggle.addEventListener('click', function () {
nav.classList.toggle('open');
toggle.classList.toggle('open');
});
}
});
function submitContact(e) {
if (e) e.preventDefault();
var status = document.getElementById('form-status');
if (!status) return false;
status.textContent = 'Sending message… (this demo does not send mail)';
// In a real site, send via fetch() to an API endpoint here.
setTimeout(function () {
status.textContent = 'Thanks — we received your message. We will reply within 2 business days.';
document.getElementById('contact-form')?.reset();
}, 900);
return false;
}