-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcat.js
More file actions
72 lines (65 loc) · 2.89 KB
/
Copy pathcat.js
File metadata and controls
72 lines (65 loc) · 2.89 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
(function() {
// Create and insert an audio element for the provided MP3
var audio = document.createElement('audio');
audio.src = 'https://github.com/orlyjamie/spinningcat/raw/refs/heads/main/cat.mp3'; // Raw MP3 URL
audio.autoplay = true;
audio.loop = true;
document.body.appendChild(audio);
// Create a full-screen neon green overlay under the GIFs but above the page content
var overlay = document.createElement('div');
overlay.style.position = 'fixed';
overlay.style.top = '0';
overlay.style.left = '0';
overlay.style.width = '100%';
overlay.style.height = '100%';
overlay.style.backgroundColor = '#00FF00'; // Neon green
overlay.style.zIndex = 9998; // Below the cats (9999) but above everything else
overlay.style.opacity = '0'; // Initially transparent
overlay.style.transition = 'opacity 0.2s'; // Smooth fade in/out for flash
document.body.appendChild(overlay);
// Function to create your hosted GIF elements
function spawnCatGif() {
var gif = document.createElement('img');
gif.src = 'https://raw.githubusercontent.com/orlyjamie/spinningcat/refs/heads/main/cat.gif'; // Your hosted GIF URL
gif.style.position = 'fixed';
gif.style.zIndex = 9999; // Above the overlay
gif.style.width = '150px';
gif.style.animation = 'spin 2s linear infinite';
gif.style.top = Math.random() * window.innerHeight + 'px';
gif.style.left = Math.random() * window.innerWidth + 'px';
document.body.appendChild(gif);
// Remove GIF after 10 seconds to prevent overflow
setTimeout(() => gif.remove(), 10000);
}
// Spawn your hosted GIFs immediately every 500ms
setInterval(spawnCatGif, 500);
// Create a function to handle the neon green flash
function flashScreen() {
overlay.style.opacity = '1'; // Show neon green overlay
setTimeout(() => {
overlay.style.opacity = '0'; // Hide neon green overlay
}, 200); // Duration of the flash
}
// Delay the spinning effect and other animations by 3-4 seconds
setTimeout(() => {
// Inject spinning CSS animation for all page elements
var style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(`
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes spin-all {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
body * {
animation: spin-all 5s linear infinite;
}
`));
document.head.appendChild(style);
// Trigger screen flash every 2 seconds
setInterval(flashScreen, 2000);
}, 3500); // 3.5-second delay for spinning and green flash to start
})();