-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
44 lines (34 loc) · 1.7 KB
/
script.js
File metadata and controls
44 lines (34 loc) · 1.7 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
document.addEventListener('DOMContentLoaded', () => {
// --- Footer Year ---
const yearSpan = document.getElementById('year');
if (yearSpan) {
yearSpan.textContent = new Date().getFullYear();
}
// --- Fade-in Animation on Scroll ---
const observerOptions = {
root: null, // relative to document viewport
rootMargin: '0px',
threshold: 0.1 // trigger when 10% of the element is visible
};
const observerCallback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('is-visible');
observer.unobserve(entry.target); // Stop observing once visible
}
});
};
const observer = new IntersectionObserver(observerCallback, observerOptions);
const elementsToFade = document.querySelectorAll('.fade-in');
elementsToFade.forEach(el => {
observer.observe(el);
});
// --- Personalize Content (Replace placeholders here too if not done in HTML) ---
const emailLinks = document.querySelectorAll('a[href="mailto:your.email@example.com"]');
emailLinks.forEach(link => link.href = 'mailto:your.real.email@example.com'); // !!! REPLACE with your actual email
const calendlyLinks = document.querySelectorAll('a[href="YOUR_CALENDLY_LINK_HERE"]');
calendlyLinks.forEach(link => link.href = 'YOUR_ACTUAL_CALENDLY_LINK'); // !!! REPLACE with your actual Calendly link
// Add your actual social media links here if you prefer JS over HTML edits
// const linkedinLink = document.querySelector('.social-icons a[href="#"]'); // Example
// if(linkedinLink) linkedinLink.href = 'YOUR_LINKEDIN_URL';
});