your personal website on atproto - mirror blento.app

Merge pull request #164 from flo-bit/improve-fluid-text

Improve fluid text

authored by Florian and committed by GitHub 740f860a b7c28f6e

+2 -3
+2 -3
src/lib/cards/visual/FluidTextCard/FluidTextCard.svelte
··· 146 146 metrics.actualBoundingBoxDescent !== undefined 147 147 ) { 148 148 shadowCtx.textBaseline = 'alphabetic'; 149 - textY = 150 - (height + metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) / 2; 149 + textY = (height + metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) / 2; 151 150 } else { 152 151 shadowCtx.textBaseline = 'middle'; 153 152 } ··· 206 205 ctx.globalCompositeOperation = 'source-over'; 207 206 208 207 // Add overlay: brighten in dark mode, darken in light mode 209 - ctx.strokeStyle = isDark ? 'rgba(255, 255, 255, 0.15)' : 'rgba(0, 0, 0, 0.2)'; 208 + ctx.strokeStyle = isDark ? 'rgba(255, 255, 255, 0.3)' : 'rgba(0, 0, 0, 0.4)'; 210 209 ctx.strokeText(text, width / 2, textY); 211 210 } else { 212 211 ctx.strokeStyle = 'rgba(255, 255, 255, 0.3)';