From be0951dcf27887152c457ef0d96c4dc7ef517224 Mon Sep 17 00:00:00 2001 From: Cooper Hall Date: Thu, 9 Nov 2023 00:04:09 -0700 Subject: [PATCH 1/5] combined files for donutification --- donut.js | 52 --------------------------------------------------- index.html | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 53 deletions(-) delete mode 100644 donut.js diff --git a/donut.js b/donut.js deleted file mode 100644 index 68aa76e..0000000 --- a/donut.js +++ /dev/null @@ -1,52 +0,0 @@ -var pretag = document.getElementById("d"); - -var tmr1 = undefined, - tmr2 = undefined; -var A = 1, - B = 1; - -var asciiframe = () => { - var b = []; - var z = []; - A += 0.07; - B += 0.03; - var cA = Math.cos(A), - sA = Math.sin(A), - cB = Math.cos(B), - sB = Math.sin(B); - for (var k = 0; k < 1760; k++) { - b[k] = k % 80 == 79 ? "\n" : " "; - z[k] = 0; - } - for (var j = 0; j < 6.28; j += 0.07) { - // j <=> theta - var ct = Math.cos(j), - st = Math.sin(j); - for (i = 0; i < 6.28; i += 0.02) { - // i <=> phi - var sp = Math.sin(i), - cp = Math.cos(i), - h = ct + 2, // R1 + R2*cos(theta) - D = 1 / (sp * h * sA + st * cA + 5), // this is 1/z - t = sp * h * cA - st * sA; // this is a clever factoring of some of the terms in x' and y' - - var x = 0 | (40 + 30 * D * (cp * h * cB - t * sB)), - y = 0 | (12 + 15 * D * (cp * h * sB + t * cB)), - o = x + 80 * y, - N = - 0 | - (8 * - ((st * sA - sp * ct * cA) * cB - - sp * ct * sA - - st * cA - - cp * ct * sB)); - if (y < 22 && y >= 0 && x >= 0 && x < 79 && D > z[o]) { - z[o] = D; - b[o] = ".,-~:;=!*#$@"[N > 0 ? N : 0]; - } - } - } - pretag.innerHTML = b.join(""); -}; - -setInterval(asciiframe, 50) \ No newline at end of file diff --git a/index.html b/index.html index 347579f..ab80e4d 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,60 @@

     
- + \ No newline at end of file From f4732f836071be5fe27b3c09dedd2942a0e3d640 Mon Sep 17 00:00:00 2001 From: Cooper Hall Date: Thu, 9 Nov 2023 00:19:36 -0700 Subject: [PATCH 2/5] simplified html and css --- index.html | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index ab80e4d..6c6cef0 100644 --- a/index.html +++ b/index.html @@ -1,48 +1,24 @@ - + - - Donut - -
-

-    
+ - - - \ No newline at end of file + Donut + +
 
+ \ No newline at end of file