feat: add outline button and render text in canvas
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
{width}
|
||||
{height}
|
||||
fontSize={textConfigState.fontSize}
|
||||
stroke={textConfigState.color}
|
||||
fill="transparent"
|
||||
stroke={textConfigState.outlined ? textConfigState.color : "transparent"}
|
||||
fill={textConfigState.outlined ? "transparent" : textConfigState.color}
|
||||
fontFamily={textConfigState.fontFamily}
|
||||
align={textConfigState.align}
|
||||
wrap="none"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import SettingsRow from "$components/layout/SettingsRow.svelte";
|
||||
import Alignment from "$components/ui/Alignment.svelte";
|
||||
import ColorPicker from "$components/ui/ColorPicker.svelte";
|
||||
import Outline from "$components/ui/Outline.svelte";
|
||||
import RangeSlider from "$components/ui/RangeSlider.svelte";
|
||||
import SelectFont from "$components/ui/SelectFont.svelte";
|
||||
import { TYPOGRAPHY } from "$lib/constants";
|
||||
@@ -23,8 +24,9 @@
|
||||
<SettingsRow label="Шрифт">
|
||||
<SelectFont bind:value={textConfigState.fontFamily} />
|
||||
</SettingsRow>
|
||||
<SettingsRow label="Цвет">
|
||||
<SettingsRow label="Цвет" noLabel={true}>
|
||||
<ColorPicker bind:value={textConfigState.color} />
|
||||
<Outline bind:outlined={textConfigState.outlined} />
|
||||
</SettingsRow>
|
||||
<SettingsRow label="Выравнивание" noLabel={true}>
|
||||
<Alignment bind:align={textConfigState.align} />
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
--btn-main: var(--action-primary);
|
||||
--btn-hover: var(--action-primary-hover);
|
||||
padding: 10px 16px;
|
||||
border: none;
|
||||
border: 1px solid var(--btn-main);
|
||||
border-radius: var(--radius);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<script lang="ts">
|
||||
import TypeOutline from "~icons/lucide/type-outline";
|
||||
import Button from "./Button.svelte";
|
||||
|
||||
interface Props {
|
||||
outlined: boolean;
|
||||
}
|
||||
|
||||
let { outlined = $bindable(false) }: Props = $props();
|
||||
</script>
|
||||
|
||||
<Button
|
||||
icon={TypeOutline}
|
||||
ariaLabel="toggle outline"
|
||||
onclick={() => (outlined = !outlined)}
|
||||
type={outlined ? "outline" : "primary"}
|
||||
/>
|
||||
Reference in New Issue
Block a user