-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
117 lines (101 loc) · 3.65 KB
/
Copy pathscript.js
File metadata and controls
117 lines (101 loc) · 3.65 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
// Set the current timestamp
document.addEventListener('DOMContentLoaded', function() {
const timestampElement = document.getElementById('timestamp');
if (timestampElement) {
const now = new Date();
timestampElement.textContent = now.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
}
});
// Modal functions
function showDemo() {
const modal = document.getElementById('magic-modal');
modal.classList.remove('hidden');
// Add some animation
setTimeout(() => {
modal.style.opacity = '1';
}, 10);
}
function hideDemo() {
const modal = document.getElementById('magic-modal');
modal.classList.add('hidden');
}
// Close modal when clicking outside
document.addEventListener('click', function(event) {
const modal = document.getElementById('magic-modal');
if (event.target === modal) {
hideDemo();
}
});
// Smooth scrolling for navigation 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'
});
}
});
});
// Add some interactive effects
document.addEventListener('mousemove', function(e) {
const cursor = document.querySelector('.cursor-glow');
if (!cursor) {
const glow = document.createElement('div');
glow.className = 'cursor-glow';
glow.style.cssText = `
position: fixed;
width: 20px;
height: 20px;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
pointer-events: none;
z-index: 9999;
border-radius: 50%;
transform: translate(-50%, -50%);
transition: opacity 0.3s ease;
`;
document.body.appendChild(glow);
}
const glowElement = document.querySelector('.cursor-glow');
glowElement.style.left = e.clientX + 'px';
glowElement.style.top = e.clientY + 'px';
});
// Fun easter egg - konami code
let konamiCode = [];
const konamiSequence = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; // ↑↑↓↓←→←→BA
document.addEventListener('keydown', function(e) {
konamiCode.push(e.keyCode);
if (konamiCode.length > konamiSequence.length) {
konamiCode = konamiCode.slice(-konamiSequence.length);
}
if (konamiCode.length === konamiSequence.length &&
konamiCode.every((code, index) => code === konamiSequence[index])) {
// Easter egg activated!
document.body.style.background = 'linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080)';
document.body.style.backgroundSize = '400% 400%';
document.body.style.animation = 'rainbow 2s ease infinite';
// Add rainbow animation
const style = document.createElement('style');
style.textContent = `
@keyframes rainbow {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
`;
document.head.appendChild(style);
alert('🎉 Konami Code activated! Rainbow mode ON!');
// Reset after 10 seconds
setTimeout(() => {
location.reload();
}, 10000);
}
});
console.log('🦞 Moltbot Demo Site loaded successfully!');
console.log('💡 Try the Konami code: ↑↑↓↓←→←→BA');