diff --git a/src/components/layout/InputGroup.svelte b/src/components/layout/InputGroup.svelte
new file mode 100644
index 0000000..49bc066
--- /dev/null
+++ b/src/components/layout/InputGroup.svelte
@@ -0,0 +1,21 @@
+
+
+
-
фоновое изображение
+
+
{#snippet panelTitle()}
Панели
diff --git a/src/components/layout/TextBar.svelte b/src/components/layout/TextBar.svelte
index 6995270..146ddd9 100644
--- a/src/components/layout/TextBar.svelte
+++ b/src/components/layout/TextBar.svelte
@@ -4,7 +4,7 @@
-
+
Настройки текста
diff --git a/src/components/text/TextInlineEdit.svelte b/src/components/text/TextInlineEdit.svelte
new file mode 100644
index 0000000..0b85e57
--- /dev/null
+++ b/src/components/text/TextInlineEdit.svelte
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/text/TextInput.svelte b/src/components/text/TextInput.svelte
new file mode 100644
index 0000000..3cd2528
--- /dev/null
+++ b/src/components/text/TextInput.svelte
@@ -0,0 +1,39 @@
+
+
+
+
+
diff --git a/src/components/text/TextManager.svelte b/src/components/text/TextManager.svelte
new file mode 100644
index 0000000..404d3fb
--- /dev/null
+++ b/src/components/text/TextManager.svelte
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+ {#each textsState.texts as { text, id } (id)}
+ deleteText(id)} />
+ {/each}
+
+
+
+
diff --git a/src/components/ui/Button.svelte b/src/components/ui/Button.svelte
new file mode 100644
index 0000000..17a5de3
--- /dev/null
+++ b/src/components/ui/Button.svelte
@@ -0,0 +1,110 @@
+
+
+
+
+
diff --git a/src/states/texts.state.svelte.ts b/src/states/texts.state.svelte.ts
index f126835..f397d9c 100644
--- a/src/states/texts.state.svelte.ts
+++ b/src/states/texts.state.svelte.ts
@@ -1,23 +1,30 @@
-export interface TextsState {
- texts: string[];
- addText(text: string): void;
- removeText(text: string): void;
+export interface TextItem {
+ text: string;
+ id: number;
}
-const defaultTexts: string[] = ["About me", "Links", "Projects"];
+export interface TextsState {
+ texts: Array
;
+ addText(text: string): void;
+ removeText(id: number): void;
+}
+
+const defaultTexts: Array = ["About me", "Links", "Projects"].map((text, idx) => ({ text, id: idx }));
function createTextsState(): TextsState {
- let texts: string[] = $state(defaultTexts);
+ let texts: Array = $state(defaultTexts);
+ let nextId = $state(defaultTexts.length);
return {
get texts() {
return texts;
},
addText(text: string) {
- texts = [...texts, text];
+ texts.push({ text, id: nextId });
+ nextId++;
},
- removeText(text: string) {
- texts = texts.filter((t) => t !== text);
+ removeText(id: number) {
+ texts.filter((textItem) => textItem.id === id);
},
};
}