-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcow.html
63 lines (55 loc) · 1.89 KB
/
cow.html
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
<!doctype html>
<html>
<head>
<title>COW | Tenderloin Tech</title>
<script defer data-domain="tenderloin.tech" src="https://research.riverside.rocks/js/plausible.js"></script>
</head>
<body>
<style>
#floatingImage {
position: absolute;
animation: spin 5s linear infinite, flash 15s infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
20% { transform: rotate(360deg); }
100% { transform: rotate(360deg); }
}
@keyframes flash {
0%, 100% { background: red; }
14% { background: orange; }
28% { background: yellow; }
42% { background: green; }
57% { background: blue; }
71% { background: indigo; }
85% { background: violet; }
}
</style>
<img id="floatingImage" src="https://trentwil.es/a/149126939.jpeg" alt="Floating Image" width="200" height="100">
<script>
const image = document.getElementById("floatingImage");
// Function to move the image around the screen
function floatImage() {
const maxX = window.innerWidth - image.width;
const maxY = window.innerHeight - image.height;
const randomX = Math.random() * maxX;
const randomY = Math.random() * maxY;
image.style.left = randomX + "px";
image.style.top = randomY + "px";
}
// Function to flash rainbow colors
function flashRainbow() {
const colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
let currentColorIndex = 0;
function changeColor() {
image.style.backgroundColor = colors[currentColorIndex];
currentColorIndex = (currentColorIndex + 1) % colors.length;
}
setInterval(changeColor, 200); // Change color every 200 milliseconds
}
// Periodically float the image
setInterval(floatImage, 500); // Float every 2 seconds
flashRainbow();
</script>
</body>
</html>