summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-22 10:34:32 +0200
committerDanilo M. <danix@danix.xyz>2026-04-22 10:34:32 +0200
commit686cb366f696c6d684e3e9ec2dc26d6c6caadf75 (patch)
tree3c8d6ecb29fc433d99699b75df332e29f4dea382 /themes/danix-xyz-hacker
parente6ff0781a76f476d137d5724d8e4dea474778d40 (diff)
downloaddanixxyz-686cb366f696c6d684e3e9ec2dc26d6c6caadf75.tar.gz
danixxyz-686cb366f696c6d684e3e9ec2dc26d6c6caadf75.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker')
-rw-r--r--themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js8
1 files changed, 4 insertions, 4 deletions
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;