-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanding.js
More file actions
49 lines (41 loc) · 1.78 KB
/
Copy pathlanding.js
File metadata and controls
49 lines (41 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// landing.js – SkillSwap Landing Page
(function () {
const modal = document.getElementById('modal');
const loginBtn = document.getElementById('loginBtn');
const signupBtn = document.getElementById('signupBtn');
const reserveBtn = document.getElementById('reserveBtn');
const modalClose = document.getElementById('modalClose');
function openModal() { modal.classList.add('active'); }
function closeModal() { modal.classList.remove('active'); }
function goToApp() { window.location.href = 'home.html'; }
loginBtn.addEventListener('click', openModal);
signupBtn.addEventListener('click', openModal);
reserveBtn.addEventListener('click', openModal);
modalClose.addEventListener('click', closeModal);
// Help → FAQ page
document.getElementById('helpBtn').addEventListener('click', function (e) {
e.preventDefault();
window.location.href = 'help.html';
});
// About Us → About page
document.getElementById('aboutBtn').addEventListener('click', function (e) {
e.preventDefault();
window.location.href = 'about.html';
});
// Close when clicking the overlay backdrop
modal.addEventListener('click', function (e) {
if (e.target === modal) closeModal();
});
// Auth buttons → redirect into the app
document.getElementById('continueGoogle').addEventListener('click', goToApp);
document.getElementById('continueLinkedIn').addEventListener('click', goToApp);
document.getElementById('continueEmail').addEventListener('click', function () {
const email = document.getElementById('emailInput').value.trim();
if (!email) { document.getElementById('emailInput').focus(); return; }
goToApp();
});
// Escape key closes modal
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape') closeModal();
});
})();