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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -