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
commit
Florian
3 days ago
567bff95
5048ccea
+15
-7
3 changed files
expand all
collapse all
unified
split
src
lib
cards
social
BigSocialCard
BigSocialCard.svelte
index.ts
visual
FluidTextCard
FluidTextCard.svelte
+9
-1
src/lib/cards/social/BigSocialCard/BigSocialCard.svelte
···
7
7
8
8
const platform = $derived(item.cardData.platform as string);
9
9
const platformData = $derived(platformsData[platform]);
10
10
+
11
11
+
// Color logic:
12
12
+
// - base/transparent/undefined: background = brand color, icon = white
13
13
+
// - other: background = that color (from BaseCard), icon = white
14
14
+
const useBrandBackground = $derived(
15
15
+
!item.color || item.color === 'base' || item.color === 'transparent'
16
16
+
);
17
17
+
const brandColor = $derived(`#${item.cardData.color}`);
10
18
</script>
11
19
12
20
<div
13
21
class="flex h-full w-full items-center justify-center p-10"
14
14
-
style={`background-color: #${item.cardData.color}`}
22
22
+
style={useBrandBackground ? `background-color: ${brandColor}` : ''}
15
23
>
16
24
<div
17
25
class="flex aspect-square max-h-full max-w-full items-center justify-center [&_svg]:size-full [&_svg]:max-w-60 [&_svg]:fill-white"
+2
-2
src/lib/cards/social/BigSocialCard/index.ts
···
36
36
return item;
37
37
},
38
38
name: 'Social Icon',
39
39
-
allowSetColor: false,
40
40
-
defaultColor: 'transparent',
39
39
+
allowSetColor: true,
40
40
+
defaultColor: 'base',
41
41
minW: 2,
42
42
minH: 2,
43
43
onUrlHandler: (url, item) => {
+4
-4
src/lib/cards/visual/FluidTextCard/FluidTextCard.svelte
···
127
127
const isDark = document.documentElement.classList.contains('dark');
128
128
129
129
// Draw shadow behind fluid (light mode only, transparent only)
130
130
-
if (shadowCanvas && item.color === 'transparent' && !isDark) {
130
130
+
if (shadowCanvas && item.color === 'transparent') {
131
131
shadowCanvas.width = width * dpr;
132
132
shadowCanvas.height = height * dpr;
133
133
const shadowCtx = shadowCanvas.getContext('2d')!;
···
153
153
}
154
154
155
155
// Draw darkened text shape behind fluid
156
156
-
shadowCtx.fillStyle = getHexCSSVar('--color-base-200');
156
156
+
shadowCtx.fillStyle = getHexCSSVar(isDark ? '--color-base-950' : '--color-base-200');
157
157
shadowCtx.fillText(text, width / 2, textY);
158
158
} else if (shadowCanvas) {
159
159
-
// Clear shadow canvas in dark mode
159
159
+
// Clear shadow canvas when not transparent
160
160
shadowCanvas.width = 1;
161
161
shadowCanvas.height = 1;
162
162
}
···
1774
1774
? 'bg-base-50 dark:bg-base-900'
1775
1775
: 'bg-black'}"
1776
1776
>
1777
1777
-
<canvas bind:this={shadowCanvas} class="absolute h-full w-full dark:hidden"></canvas>
1777
1777
+
<canvas bind:this={shadowCanvas} class="absolute h-full w-full"></canvas>
1778
1778
<canvas bind:this={fluidCanvas} class="absolute h-full w-full"></canvas>
1779
1779
<canvas bind:this={maskCanvas} class="absolute h-full w-full"></canvas>
1780
1780
</div>