your personal website on atproto - mirror blento.app

Merge pull request #14 from flo-bit/fluid-text

pizza

authored by Florian and committed by GitHub 9acfe288 ad046b23

+4 -4
+1 -1
src/lib/cards/FluidTextCard/FluidTextCard.svelte
··· 19 19 const text = $derived((item.cardData?.text as string) || 'hello'); 20 20 const fontWeight = '900'; 21 21 const fontFamily = 'Arial'; 22 - const fontSize = $derived((item.cardData?.fontSize as number) || 0.13); 22 + const fontSize = $derived(parseFloat(item.cardData?.fontSize) || 0.33); 23 23 24 24 // Draw text mask on overlay canvas 25 25 function drawOverlayCanvas() {
+3 -3
src/lib/cards/FluidTextCard/FluidTextCardSettings.svelte
··· 10 10 item.cardData.fontSize = 0.33; 11 11 } 12 12 13 - const displayPercent = $derived(Math.round((item.cardData.fontSize as number) * 100)); 13 + const displayPercent = $derived(Math.round((parseFloat(item.cardData.fontSize) as number) * 100)); 14 14 </script> 15 15 16 16 <div class="flex flex-col gap-3"> ··· 26 26 min="0.1" 27 27 max="0.8" 28 28 step="0.01" 29 - value={item.cardData.fontSize ?? 0.33} 29 + value={parseFloat(item.cardData.fontSize) ?? 0.33} 30 30 oninput={(e) => { 31 - item.cardData.fontSize = parseFloat(e.currentTarget.value); 31 + item.cardData.fontSize = e.currentTarget.value.toString(); 32 32 }} 33 33 class="bg-base-200 dark:bg-base-700 h-2 w-full cursor-pointer appearance-none rounded-lg" 34 34 />