-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
48 lines (42 loc) · 1.37 KB
/
script.js
File metadata and controls
48 lines (42 loc) · 1.37 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
// Add smooth scroll behavior
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Add a simple fade-in animation when the page loads
document.addEventListener('DOMContentLoaded', () => {
document.body.style.opacity = '0';
setTimeout(() => {
document.body.style.transition = 'opacity 0.5s ease';
document.body.style.opacity = '1';
}, 100);
});
document.addEventListener('DOMContentLoaded', () => {
const rotatingText = document.getElementById('rotating-text');
const texts = [
'Open-Source',
'Mobile-First',
'AI-Powered'
];
let currentIndex = 0;
function updateText() {
rotatingText.classList.remove('animate-in');
rotatingText.classList.add('animate-out');
setTimeout(() => {
currentIndex = (currentIndex + 1) % texts.length;
rotatingText.textContent = texts[currentIndex];
rotatingText.classList.remove('animate-out');
rotatingText.classList.add('animate-in');
setTimeout(() => {
updateText()
}, 2000);
}, 50);
}
setTimeout(() => {
updateText()
}, 2000)
});