-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
54 lines (48 loc) · 1.63 KB
/
script.js
File metadata and controls
54 lines (48 loc) · 1.63 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
50
51
52
53
54
// Folusho.Design - Scripts
// Navigation scroll effect
const nav = document.querySelector('.nav');
window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
nav.style.borderBottom = '1px solid #222';
} else {
nav.style.borderBottom = 'none';
}
});
// Smooth scroll
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
const navHeight = nav.offsetHeight;
window.scrollTo({
top: target.offsetTop - navHeight,
behavior: 'smooth'
});
}
});
});
// Clone first rotating word for seamless loop
const rotatingText = document.querySelector('.rotating-text');
if (rotatingText) {
const firstWord = rotatingText.querySelector('.rotating-word');
if (firstWord) {
const clone = firstWord.cloneNode(true);
rotatingText.appendChild(clone);
}
}
// Copy email function
function copyEmail() {
const email = 'Emmanuelfolushojoseph@gmail.com';
navigator.clipboard.writeText(email).then(() => {
const btn = document.querySelector('.btn-copy');
const originalText = btn.textContent;
btn.textContent = 'Copied!';
setTimeout(() => {
btn.textContent = originalText;
}, 2000);
});
}
// Console Easter egg
console.log('%c👋 Hey there!', 'font-size: 20px; font-weight: bold;');
console.log('%cLooking for a brand designer? Email: Emmanuelfolushojoseph@gmail.com', 'font-size: 14px; color: #888;');