kaka.farm

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/kaka.farm
Log | Files | Refs | README

commit a53728d36dad86458d4b1d233cf1ba181ad17100
parent da0a435016b3f8c57a5c5f6ed8b618c8a1b81ef0
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Fri, 19 Jan 2024 15:22:28 +0200

Not even sure what is going on after all this time.

Diffstat:
Mhtml/shades-of-grey/main.js | 6+++++-
Mhtml/spinning-shapes/main.js | 14+++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/html/shades-of-grey/main.js b/html/shades-of-grey/main.js @@ -34,6 +34,8 @@ let canvas = document.getElementById('canvas'); let ctx = canvas.getContext('2d'); + console.info(canvas.width, number_of_rectangles); + ctx.clearRect(0, 0, canvas.width, canvas.height); let rectangle_width = canvas.width / number_of_rectangles; @@ -90,7 +92,9 @@ } number_of_rectangles = factor * number_of_rectangles; draw(); - }, INTERVAL); + }, + INTERVAL, + ); } window.addEventListener('load', main); diff --git a/html/spinning-shapes/main.js b/html/spinning-shapes/main.js @@ -43,13 +43,13 @@ Math.TAU = 2 * Math.PI; step_on(turn % CYCLE_LENGTH, 16.5, 17) - step_on(turn % CYCLE_LENGTH, 17.5, 18) + step_on(turn % CYCLE_LENGTH, 18.5, 19) - step_on(turn % CYCLE_LENGTH, 19.5, 20), */ - turn => Math.sin(turn * Math.TAU / 20 * 7), - turn => Math.sin(turn * Math.TAU / 20 * 6), - turn => Math.sin(turn * Math.TAU / 20 * 5), - turn => Math.sin(turn * Math.TAU / 20 * 4), - turn => Math.sin(turn * Math.TAU / 20 * 3), - turn => Math.sin(turn * Math.TAU / 20 * 2), - turn => Math.sin(turn * Math.TAU / 20), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 7), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 6), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 5), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 4), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 3), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH * 2), + turn => Math.sin(turn * Math.TAU / CYCLE_LENGTH), ]; function quadratic_stepper(t) {