From 686cb366f696c6d684e3e9ec2dc26d6c6caadf75 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 22 Apr 2026 10:34:32 +0200 Subject: feat: compact tag cloud spiral with controlled overlap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tighten tag cloud spacing by adjusting spiral parameters: - padding: 8 → -2 (allows ~2px edge overlap, ~7-10% of tag height) - aStep: 0.3 → 0.2 (finer angular sampling per revolution) - rScale: 0.018 → 0.013 multiplier (28% tighter spiral arms) - attempt cap: 2000 → 3000 (compensate for smaller aStep) Tags now cluster closer together visually while remaining readable. Narrow viewport fallback (< 400px) and 404/sidebar placements unaffected. Co-Authored-By: Claude Haiku 4.5 --- themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'themes') diff --git a/themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js b/themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js index 68b3d99..bed4645 100644 --- a/themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js +++ b/themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js @@ -49,9 +49,9 @@ document.addEventListener('DOMContentLoaded', function () { container.style.display = 'block'; container.classList.remove('flex', 'flex-wrap'); - var padding = 8; // px gap between tags - var aStep = 0.3; // radians per spiral step - var rScale = (containerWidth * 0.018); // spiral tightness + var padding = -2; // px gap between tags (negative allows ~2px edge overlap) + var aStep = 0.2; // radians per spiral step + var rScale = (containerWidth * 0.013); // spiral tightness var minTop = Infinity, maxBottom = -Infinity; @@ -63,7 +63,7 @@ document.addEventListener('DOMContentLoaded', function () { var placed_rect; // Step along spiral until no collision - for (var attempt = 0; attempt < 2000; attempt++) { + for (var attempt = 0; attempt < 3000; attempt++) { var r = rScale * theta; var x = cx + r * Math.cos(theta) - w / 2; var y = r * Math.sin(theta) - h / 2; -- cgit v1.2.3