This repository was archived by the owner on Dec 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
118 lines (98 loc) · 3.06 KB
/
script.js
File metadata and controls
118 lines (98 loc) · 3.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Modern Cyrethium - Interactive Features
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Navbar scroll effect
let lastScroll = 0;
const nav = document.querySelector('.nav');
window.addEventListener('scroll', () => {
const currentScroll = window.pageYOffset;
if (currentScroll <= 0) {
nav.style.transform = 'translateY(0)';
return;
}
if (currentScroll > lastScroll && currentScroll > 100) {
// Scrolling down
nav.style.transform = 'translateY(-100%)';
} else {
// Scrolling up
nav.style.transform = 'translateY(0)';
}
lastScroll = currentScroll;
});
// Intersection Observer for fade-in animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -100px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Observe all cards and sections
document.querySelectorAll('.feature-card, .tool-item, .version-card').forEach(el => {
el.style.opacity = '0';
el.style.transform = 'translateY(30px)';
el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
observer.observe(el);
});
// Add parallax effect to background
window.addEventListener('scroll', () => {
const scrolled = window.pageYOffset;
const bg = document.querySelector('.bg-animation');
if (bg) {
bg.style.transform = `translateY(${scrolled * 0.5}px)`;
}
});
// Copy to clipboard functionality (for future use)
function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(() => {
// Show success message
console.log('Copied to clipboard');
}).catch(err => {
console.error('Failed to copy:', err);
});
}
// Mobile menu toggle (if needed in future)
const mobileMenuBtn = document.querySelector('.mobile-menu-btn');
const navLinks = document.querySelector('.nav-links');
if (mobileMenuBtn) {
mobileMenuBtn.addEventListener('click', () => {
navLinks.classList.toggle('active');
});
}
// Add loading animation
window.addEventListener('load', () => {
document.body.classList.add('loaded');
});
// Cursor trail effect (optional, can be removed if too much)
let mouseX = 0;
let mouseY = 0;
let cursorX = 0;
let cursorY = 0;
document.addEventListener('mousemove', (e) => {
mouseX = e.clientX;
mouseY = e.clientY;
});
function animateCursor() {
const diffX = mouseX - cursorX;
const diffY = mouseY - cursorY;
cursorX += diffX * 0.1;
cursorY += diffY * 0.1;
requestAnimationFrame(animateCursor);
}
animateCursor();