From 0be69ea7c31a297442d509eae4dce0c3e0e9fbc1 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 15 Mar 2022 20:33:34 +1300 Subject: [PATCH] added some structure files --- Catalogue/Scripts/colourToText.js | 3 + Catalogue/Scripts/degToRad.js | 4 + Catalogue/Scripts/lerp.js | 10 + Catalogue/template.html | 44 ++ animate 0.1 (deconstructing)/animation.html | 521 ++++++++++++++++++++ 5 files changed, 582 insertions(+) create mode 100644 Catalogue/Scripts/colourToText.js create mode 100644 Catalogue/Scripts/degToRad.js create mode 100644 Catalogue/Scripts/lerp.js create mode 100644 Catalogue/template.html create mode 100644 animate 0.1 (deconstructing)/animation.html diff --git a/Catalogue/Scripts/colourToText.js b/Catalogue/Scripts/colourToText.js new file mode 100644 index 0000000..a9cbb43 --- /dev/null +++ b/Catalogue/Scripts/colourToText.js @@ -0,0 +1,3 @@ +function colourToText(colour) { + return "rgb(" + colour[0] + "," + colour[1] + "," + colour[2] + ")" +} \ No newline at end of file diff --git a/Catalogue/Scripts/degToRad.js b/Catalogue/Scripts/degToRad.js new file mode 100644 index 0000000..4f880c9 --- /dev/null +++ b/Catalogue/Scripts/degToRad.js @@ -0,0 +1,4 @@ +function rad(degrees) { + var pi = Math.PI; + return degrees * (pi / 180); +} diff --git a/Catalogue/Scripts/lerp.js b/Catalogue/Scripts/lerp.js new file mode 100644 index 0000000..8b2db49 --- /dev/null +++ b/Catalogue/Scripts/lerp.js @@ -0,0 +1,10 @@ +function LerpRGB(a, b, t) { + if (t < 0) { + t *= -1; + } + var newColor = [0, 0, 0]; + newColor[0] = a[0] + (b[0] - a[0]) * t; + newColor[1] = a[1] + (b[1] - a[1]) * t; + newColor[2] = a[2] + (b[2] - a[2]) * t; + return newColor; +} diff --git a/Catalogue/template.html b/Catalogue/template.html new file mode 100644 index 0000000..e91558d --- /dev/null +++ b/Catalogue/template.html @@ -0,0 +1,44 @@ + + + + + + Your browser does not support the HTML5 canvas tag. + + + diff --git a/animate 0.1 (deconstructing)/animation.html b/animate 0.1 (deconstructing)/animation.html new file mode 100644 index 0000000..7291ef2 --- /dev/null +++ b/animate 0.1 (deconstructing)/animation.html @@ -0,0 +1,521 @@ + + + + + + + Your browser does not support the HTML5 canvas tag. + + + + + \ No newline at end of file