]> danix's work - danix.xyz-2.git/commitdiff
fix: correct padding calculation and remove flex classes in spiral layout
authorDanilo M. <redacted>
Tue, 21 Apr 2026 21:40:09 +0000 (23:40 +0200)
committerDanilo M. <redacted>
Tue, 21 Apr 2026 21:40:09 +0000 (23:40 +0200)
- Issue #1: Fix padding calculation from 48px to 32px (2rem). Tags normalized to y=16px (top), so add 32px bottom padding = 16+32=48px total height buffer after normalization
- Issue #2: Explicitly remove flex and flex-wrap classes via classList.remove() to properly clean DOM when switching to absolute positioning

Co-Authored-By: Claude Haiku 4.5 <redacted>
themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js

index 69655650030b2c09a5a2601888a62e98ae68479b..9f8b7b42e66927ccd9a20ce1b3d2fa6f88251d47 100644 (file)
@@ -44,9 +44,10 @@ document.addEventListener('DOMContentLoaded', function () {
       return { w: rect.width, h: rect.height };
     });
 
-    // Switch container to relative positioning
+    // Switch container to relative positioning and remove flex layout
     container.style.position = 'relative';
     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
@@ -115,7 +116,7 @@ document.addEventListener('DOMContentLoaded', function () {
       }
     });
 
-    // Set container height to fit all tags + 2rem bottom padding
-    container.style.height = (maxBottom - minTop + 48) + 'px';
+    // Set container height to fit all tags + 2rem bottom padding (32px)
+    container.style.height = (maxBottom - minTop + 32) + 'px';
   });
 });