-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
40 lines (33 loc) · 1.2 KB
/
script.js
File metadata and controls
40 lines (33 loc) · 1.2 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
// Typing Animation for Hero Section
const typingText = "Welcome to VisionFlow";
const typingElement = document.getElementById("typing-effect");
let charIndex = 0;
function type() {
if (charIndex < typingText.length) {
typingElement.textContent += typingText.charAt(charIndex);
charIndex++;
setTimeout(type, 100); // Adjust typing speed here (100ms per character)
} else {
typingElement.style.borderRight = "none"; // Remove cursor after typing
} nhi
}
// Start typing animation when the page loads
window.onload = type;
// Mobile Menu Toggle
// Mobile Menu Toggle
document.addEventListener('DOMContentLoaded', () => {
const mobileMenu = document.getElementById('mobile-menu');
const navLinks = document.getElementById('nav-links');
mobileMenu.addEventListener('click', () => {
navLinks.classList.toggle('active');
mobileMenu.classList.toggle('active');
});
});
// FAQ Accordion
const faqItems = document.querySelectorAll('.faq-item');
faqItems.forEach((item) => {
const question = item.querySelector('.faq-question');
question.addEventListener('click', () => {
item.classList.toggle('active');
});
});