Skip to content

Commit

Permalink
fix: Adjust summary positioning to prevent overlap and improve layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 3, 2024
1 parent 3d6cc1e commit 252dcdd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hugo-site/layouts/shortcodes/summary-delta-sync/sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,13 @@
// Adjust spacing based on screen size
const PEER_SPACING = window.innerWidth <= 768 ? 10 : 20;

// Calculate positions relative to container with adjusted spacing
// Position summary1 to the right of peer1
const summary1Left = (peer1Rect.right - containerRect.left) + PEER_SPACING;
const summary1Top = (peer1Rect.top - containerRect.top) + (peer1Rect.height / 2) - 20;
const summary1Top = (peer1Rect.top - containerRect.top) + (peer1Rect.height / 2) - 40;

// Position summary2 to the left of peer2
const summary2Left = (peer2Rect.left - containerRect.left) - summary2.offsetWidth - PEER_SPACING;
const summary2Top = (peer2Rect.top - containerRect.top) + (peer2Rect.height / 2) + 20;
const summary2Top = (peer2Rect.top - containerRect.top) + (peer2Rect.height / 2) + 40;

console.log('Calculated positions:', {
summary1Left,
Expand Down

0 comments on commit 252dcdd

Please sign in to comment.