Skip to content

Commit

Permalink
feat: Improve node sizing for mobile responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Nov 30, 2024
1 parent a32e2f8 commit 7c8c1b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hugo-site/static/html/eventual_convergence_viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ <h1 class="title is-4">Freenet Eventual Convergence Simulation</h1>
60
);

// Increase base node size for mobile
const baseSizeFactor = containerWidth < 768 ? 0.035 : 0.02;
const optimalNodeSize = Math.min(
Math.max(10, Math.floor(Math.sqrt(availableArea) * 0.02)),
30
Math.max(15, Math.floor(Math.sqrt(availableArea) * baseSizeFactor)),
containerWidth < 768 ? 40 : 30
);

return {
Expand Down

0 comments on commit 7c8c1b5

Please sign in to comment.