From 6234d26bacd59894fc6a7f0493f25c18295b89d4 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Fri, 23 Apr 2021 12:54:26 +0200 Subject: [PATCH] Remove ornaments --- UI/Base/Ornament.ts | 32 +--- assets/svg/Ornament-Horiz-0.svg | 91 ---------- assets/svg/Ornament-Horiz-1.svg | 159 ----------------- assets/svg/Ornament-Horiz-2.svg | 96 ---------- assets/svg/Ornament-Horiz-3.svg | 91 ---------- assets/svg/Ornament-Horiz-4.svg | 66 ------- assets/svg/Ornament-Horiz-5.svg | 81 --------- assets/svg/Ornament-Horiz-6.svg | 301 -------------------------------- 8 files changed, 1 insertion(+), 916 deletions(-) delete mode 100644 assets/svg/Ornament-Horiz-0.svg delete mode 100644 assets/svg/Ornament-Horiz-1.svg delete mode 100644 assets/svg/Ornament-Horiz-2.svg delete mode 100644 assets/svg/Ornament-Horiz-3.svg delete mode 100644 assets/svg/Ornament-Horiz-4.svg delete mode 100644 assets/svg/Ornament-Horiz-5.svg delete mode 100644 assets/svg/Ornament-Horiz-6.svg diff --git a/UI/Base/Ornament.ts b/UI/Base/Ornament.ts index 252014d..39f5f1b 100644 --- a/UI/Base/Ornament.ts +++ b/UI/Base/Ornament.ts @@ -4,44 +4,14 @@ import Svg from "../../Svg"; import State from "../../State"; export default class Ornament extends UIElement { - private static readonly ornamentsCount = Ornament.countOrnaments(); - private readonly _index = new UIEventSource("0") constructor(index = undefined) { super(); - index = index ?? State.state.osmConnection.GetPreference("ornament"); - this.SetClass("pt-3 pb-3 flex justify-center box-border") - - this.ListenTo(index); - this._index = index; - const self = this; - this.onClick(() => { - let c = Number(index.data); - if (isNaN(c)) { - c = 0; - } - self._index.setData("" + ((c + 1) % (Ornament.ornamentsCount + 1))); - - }) - } - - private static countOrnaments() { - let ornamentCount = 0; - for (const key in Svg.All) { - if (key.startsWith("Ornament-Horiz-")) { - ornamentCount++; - } - } - return ornamentCount; } InnerRender(): string { - const svg = Svg.All[`Ornament-Horiz-${Number(this._index.data) - 1}.svg`]; - if (this._index.data == "0" || svg === undefined) { - return "" - } - return svg; + return "" } } \ No newline at end of file diff --git a/assets/svg/Ornament-Horiz-0.svg b/assets/svg/Ornament-Horiz-0.svg deleted file mode 100644 index 83fabd3..0000000 --- a/assets/svg/Ornament-Horiz-0.svg +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-1.svg b/assets/svg/Ornament-Horiz-1.svg deleted file mode 100644 index 1475dd7..0000000 --- a/assets/svg/Ornament-Horiz-1.svg +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-2.svg b/assets/svg/Ornament-Horiz-2.svg deleted file mode 100644 index a5f18fe..0000000 --- a/assets/svg/Ornament-Horiz-2.svg +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-3.svg b/assets/svg/Ornament-Horiz-3.svg deleted file mode 100644 index c9a3356..0000000 --- a/assets/svg/Ornament-Horiz-3.svg +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-4.svg b/assets/svg/Ornament-Horiz-4.svg deleted file mode 100644 index ade8558..0000000 --- a/assets/svg/Ornament-Horiz-4.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-5.svg b/assets/svg/Ornament-Horiz-5.svg deleted file mode 100644 index 9367c3e..0000000 --- a/assets/svg/Ornament-Horiz-5.svg +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/assets/svg/Ornament-Horiz-6.svg b/assets/svg/Ornament-Horiz-6.svg deleted file mode 100644 index b2f2e4e..0000000 --- a/assets/svg/Ornament-Horiz-6.svg +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -