-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
141 lines (124 loc) · 5.1 KB
/
script.js
File metadata and controls
141 lines (124 loc) · 5.1 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// RuneCast Landing Page Script
// Configuration constants
const GLITCH_PROBABILITY = 0.7; // Probability threshold for glitch effect
const TYPING_SPEED_MS = 100; // Speed of typing animation in milliseconds
document.addEventListener('DOMContentLoaded', function() {
// Add smooth scrolling for any navigation links
const links = document.querySelectorAll('a[href^="#"]');
links.forEach(link => {
link.addEventListener('click', function(e) {
const href = this.getAttribute('href');
if (href !== '#' && href.length > 1) {
e.preventDefault();
const target = document.querySelector(href);
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
});
});
// Add glitch effect on hero text occasionally
const glitchText = document.querySelector('.glitch-text');
if (glitchText) {
setInterval(() => {
if (Math.random() > GLITCH_PROBABILITY) {
glitchText.style.animation = 'none';
setTimeout(() => {
glitchText.style.animation = '';
}, 100);
}
}, 5000);
}
// Parallax scrolling disabled per user request
// Add fade-in animation for sections on scroll
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -100px 0px'
};
const observer = new IntersectionObserver(function(entries) {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Observe all sections except hero
const sections = document.querySelectorAll('section:not(.hero)');
sections.forEach(section => {
section.style.opacity = '0';
section.style.transform = 'translateY(30px)';
section.style.transition = 'opacity 0.8s ease, transform 0.8s ease';
observer.observe(section);
});
// Add typing effect to tagline
const tagline = document.querySelector('.tagline');
if (tagline) {
const text = tagline.textContent;
tagline.textContent = '';
let index = 0;
function typeWriter() {
if (index < text.length) {
tagline.textContent += text.charAt(index);
index++;
setTimeout(typeWriter, TYPING_SPEED_MS);
}
}
setTimeout(typeWriter, 500);
}
// Add hover sound effect simulation (visual feedback)
const buttons = document.querySelectorAll('.cta-button');
buttons.forEach(button => {
button.addEventListener('mouseenter', function() {
this.style.transition = 'all 0.1s ease';
});
button.addEventListener('mouseleave', function() {
this.style.transition = 'all 0.3s ease';
});
});
// Add click ripple effect to buttons
buttons.forEach(button => {
button.addEventListener('click', function(e) {
if (this.getAttribute('href') === '#') {
e.preventDefault();
// Create ripple effect
const ripple = document.createElement('span');
ripple.style.position = 'absolute';
ripple.style.borderRadius = '50%';
ripple.style.background = 'rgba(255, 255, 255, 0.5)';
ripple.style.width = '20px';
ripple.style.height = '20px';
ripple.style.left = e.offsetX + 'px';
ripple.style.top = e.offsetY + 'px';
ripple.style.transform = 'translate(-50%, -50%)';
ripple.style.animation = 'ripple 0.6s ease-out';
ripple.style.pointerEvents = 'none';
this.appendChild(ripple);
setTimeout(() => {
ripple.remove();
}, 600);
}
});
});
// Add CSS for ripple animation
const style = document.createElement('style');
style.textContent = `
@keyframes ripple {
to {
width: 300px;
height: 300px;
opacity: 0;
}
}
`;
document.head.appendChild(style);
// Console easter egg
console.log('%c╔═══════════════════════════════════════╗', 'color: #00ffff; font-size: 12px;');
console.log('%c║ RUNECAST - ACCESS GRANTED ║', 'color: #00ffff; font-size: 12px;');
console.log('%c║ System Status: ONLINE ║', 'color: #00ffff; font-size: 12px;');
console.log('%c║ Welcome, Developer ║', 'color: #ff00ff; font-size: 12px;');
console.log('%c╚═══════════════════════════════════════╝', 'color: #00ffff; font-size: 12px;');
});