From: Danilo M. Date: Wed, 22 Apr 2026 08:34:32 +0000 (+0200) Subject: feat: compact tag cloud spiral with controlled overlap X-Git-Tag: release_22042026-1342~15 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=686cb366f696c6d684e3e9ec2dc26d6c6caadf75;p=danix.xyz-2.git feat: compact tag cloud spiral with controlled overlap 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 --- 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;