tangled
alpha
login
or
join now
flo-bit.dev
/
blento
your personal website on atproto - mirror
blento.app
20
fork
atom
overview
issues
pulls
pipelines
test 2
jycouet
1 week ago
04eb63a7
0e4a4935
+5
-5
1 changed file
expand all
collapse all
unified
split
src
lib
cards
GitHubContributorsCard
GitHubContributorsCard.svelte
+5
-5
src/lib/cards/GitHubContributorsCard/GitHubContributorsCard.svelte
···
59
60
const GAP = 6;
61
const MIN_SIZE = 16;
62
-
const MAX_SIZE = 80;
63
64
function hexCapacity(size: number, availW: number, availH: number): number {
65
const colsWide = Math.floor((availW + GAP) / (size + GAP));
···
89
90
while (lo <= hi) {
91
const mid = Math.floor((lo + hi) / 2);
92
-
const availW = containerWidth - (layout === 'hex' ? mid : 0);
93
-
const availH = containerHeight - (layout === 'hex' ? mid : 0);
94
if (availW <= 0 || availH <= 0) {
95
hi = mid - 1;
96
continue;
···
105
return Math.max(MIN_SIZE, hi);
106
});
107
108
-
let padding = $derived(layout === 'hex' ? computedSize / 2 : 0);
109
110
let rows = $derived.by(() => {
111
-
const availW = containerWidth - (layout === 'hex' ? computedSize : 0);
112
if (availW <= 0) return [] as GitHubContributor[][];
113
114
const colsWide = Math.floor((availW + GAP) / (computedSize + GAP));
···
59
60
const GAP = 6;
61
const MIN_SIZE = 16;
62
+
const MAX_SIZE = 120;
63
64
function hexCapacity(size: number, availW: number, availH: number): number {
65
const colsWide = Math.floor((availW + GAP) / (size + GAP));
···
89
90
while (lo <= hi) {
91
const mid = Math.floor((lo + hi) / 2);
92
+
const availW = containerWidth - (layout === 'hex' ? mid / 2 : 0);
93
+
const availH = containerHeight - (layout === 'hex' ? mid / 2 : 0);
94
if (availW <= 0 || availH <= 0) {
95
hi = mid - 1;
96
continue;
···
105
return Math.max(MIN_SIZE, hi);
106
});
107
108
+
let padding = $derived(layout === 'hex' ? computedSize / 4 : 0);
109
110
let rows = $derived.by(() => {
111
+
const availW = containerWidth - (layout === 'hex' ? computedSize / 4 : 0);
112
if (availW <= 0) return [] as GitHubContributor[][];
113
114
const colsWide = Math.floor((availW + GAP) / (computedSize + GAP));