From 88a00113f3ecbbf454f8115f16868730eb07b2d8 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 4 Nov 2024 17:21:36 +0100 Subject: Added simple controls for ratio customization --- index.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 4e951be..b845c31 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,14 @@ function update(element, diff) { element.dataset.angle = Number(element.dataset.angle) + diff; element.style.transform = `rotate(${Math.floor(element.dataset.angle)}deg)`; } +function reset() { + if (svg) { + svg.querySelectorAll(".pointer").forEach((x) => { + x.dataset.angle = 0; + update(x, 0); + }); + } +} function onmove(event) { if (dragging) { const rect = svg.getBoundingClientRect(); @@ -49,14 +57,20 @@ function onmove(event) { }); } } +function change(query, ratio) { + svg.querySelector(query).dataset.ratio = ratio; +} - + - + + + + -- cgit v1.1