From 5f3c2298046410bd42b65abd83d1076fdb5e9058 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Fri, 22 Dec 2023 10:09:49 -0800 Subject: [PATCH] front page redesign: unused code to auto-resize anim when window resizes --- static/topology.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/static/topology.js b/static/topology.js index c9705654..3d966338 100644 --- a/static/topology.js +++ b/static/topology.js @@ -163,4 +163,17 @@ let sketch = function(p) { return (x % n + n) % n; } }; -new p5(sketch, document.getElementById('topology')); + +let myQ5Sketch = new p5(sketch, document.getElementById('topology')); + + +// tried setting this inside the sketch with p.windowResized = ... +// but that didn't work. +// https://github.com/processing/p5.js/wiki/Positioning-your-canvas#making-the-canvas-fill-the-window +// https://github.com/quinton-ashley/q5.js/pull/6 +// +// also this restarts the animation, and occasionally it crashes. so, forget +// about this for now +// addEventListener("resize", (event) => { +// myQ5.resizeCanvas(document.documentElement.clientWidth, 900); +// });