forked from TheRiceFarmer/GBA_EMU
-
Notifications
You must be signed in to change notification settings - Fork 2
/
donut.html
100 lines (82 loc) · 2.79 KB
/
donut.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pr0j3ct-Ch4os</title>
<style>
/* Style to make the background dark */
body {
background-color: #000; /* Black background */
color: #fff; /* White text */
font-family: monospace; /* Ensures consistent font rendering for the ASCII art */
}
/* Style for the button */
.button {
display: inline-block;
padding: 10px 20px;
background-image: linear-gradient(45deg, rgb(96, 0, 250), rgb(115, 15, 190), rgb(57, 42, 68), rgb(48, 12, 121));
background-size: 400%;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
transition: transform 0.2s ease;
animation: gradientShift 5s infinite linear;
}
/* Hide the image by default */
#toggleImage {
display: none;
max-width: 100%; /* Ensure image does not exceed container width */
}
</style>
</head>
<body>
<!-- Audio element for background music -->
Your browser does not support the audio tag.
</audio>
<pre id="animationOutput"></pre> <!-- This pre tag will hold the output of the animation -->
<script>
// Place your JavaScript animation logic here
let A = 0, B = 0, M = Math;
const asciiframe = () => {
let b = [], z = [];
A += 0.05;
B += 0.07;
const cA = M.cos(A);
const sA = M.sin(A);
const cB = M.cos(B);
const sB = M.sin(B);
for (let k = 0; k < 1760; k++) {
b[k] = k % 80 == 79 ? "\n" : " ";
z[k] = 0;
}
for (let j = 0; j < 6.28; j += 0.07) {
const ct = M.cos(j);
const st = M.sin(j);
for (let i = 0; i < 6.28; i += 0.02) {
const sp = M.sin(i), cp = M.cos(i);
const h = ct + 2;
const D = 1 / (sp * h * sA + st * cA + 5);
const t = sp * h * cA - st * sA;
const x = (40 + 30 * D * (cp * h * cB - t * sB)) | 0;
const y = (12 + 15 * D * (cp * h * sB + t * cB)) | 0;
const o = x + 80 * y;
const N = (8 * ((st * sA - sp * ct * cA) * cB - sp * ct * sA - st * cA - cp * ct * sB)) | 0;
if (y < 22 && y >= 0 && x >= 0 && x < 79 && D > z[o]) {
z[o] = D;
b[o] = ".,-~:;=!*#$@"[N > 0 ? N : 0];
}
}
}
document.getElementById('animationOutput').innerText = b.join(""); // Output the result to the pre tag
};
const intervalId = setInterval(asciiframe, 50); // Animation interval of 50 milliseconds
// Optionally, you can stop the animation and reload the page if the music stops playing
const bgMusic = document.getElementById('bgMusic');
bgMusic.addEventListener('ended', () => {
clearInterval(intervalId); // Stop the animation
location.reload(); // Reload the page
});
</script>
</body>
</html>