diff --git a/UI/Base/SubtleButton.ts b/UI/Base/SubtleButton.ts index 8470fc1..85a48b5 100644 --- a/UI/Base/SubtleButton.ts +++ b/UI/Base/SubtleButton.ts @@ -19,7 +19,7 @@ export class SubtleButton extends UIElement{ if ((imageUrl ?? "") === "") { this.image = new FixedUiElement(""); } else if (typeof (imageUrl) === "string") { - this.image = new FixedUiElement(``); + this.image = new FixedUiElement(``); } else { this.image = imageUrl; } @@ -37,15 +37,22 @@ export class SubtleButton extends UIElement{ if(this.linkTo != undefined){ return new Combine([ - ``, + ``, + `
`, + `
`, this.image, + `
`, + `
`, + `
`, this.message, - '' + `
`, + `` ]).Render(); } + // Styling todo return new Combine([ - '', + '', this.image, this.message, '' diff --git a/UI/BigComponents/MoreScreen.ts b/UI/BigComponents/MoreScreen.ts index f5685ee..57c3b39 100644 --- a/UI/BigComponents/MoreScreen.ts +++ b/UI/BigComponents/MoreScreen.ts @@ -65,15 +65,14 @@ export default class MoreScreen extends UIElement { } let description = Translations.W(layout.shortDescription); - if (description !== undefined) { - description = new Combine(["
", description]); - } return new SubtleButton(layout.icon, new Combine([ - "", + `
`, Translations.W(layout.title), - "", + `
`, + `
`, description ?? "", + `
`, ]), {url: linkText, newTab: false}); } @@ -83,21 +82,10 @@ export default class MoreScreen extends UIElement { const els: UIElement[] = [] - els.push(new VariableUiElement( - State.state.osmConnection.userDetails.map(userDetails => { - if (userDetails.csCount < Constants.userJourney.themeGeneratorReadOnlyUnlock) { - return tr.requestATheme.Render(); - } - return new SubtleButton(Svg.pencil_ui(), tr.createYourOwnTheme, { - url: "./customGenerator.html", - newTab: false - }).Render(); - }) - )); - + const linkButton: UIElement[] = [] for (const k in AllKnownLayouts.allSets) { - const layout : LayoutConfig = AllKnownLayouts.allSets[k]; + const layout: LayoutConfig = AllKnownLayouts.allSets[k]; if (k === personal.id) { if (State.state.osmConnection.userDetails.data.csCount < Constants.userJourney.personalLayoutUnlock) { continue; @@ -106,9 +94,26 @@ export default class MoreScreen extends UIElement { if (layout.id !== k) { continue; // This layout was added multiple time due to an uppercase } - els.push(this.createLinkButton(layout)); + linkButton.push(this.createLinkButton(layout)); } + els.push(new Combine([ + `
`, + new Combine(linkButton), + `
` + ])) + + els.push(new VariableUiElement( + State.state.osmConnection.userDetails.map(userDetails => { + if (userDetails.csCount < Constants.userJourney.themeGeneratorReadOnlyUnlock) { + return tr.requestATheme.SetClass("block text-base mx-10 my-3").Render(); + } + return new SubtleButton(Svg.pencil_ui(), tr.createYourOwnTheme, { + url: "./customGenerator.html", + newTab: false + }).Render(); + }) + )); const customThemesNames = State.state.installedThemes.data ?? []; @@ -125,16 +130,15 @@ export default class MoreScreen extends UIElement { intro = new Combine([ LanguagePicker.CreateLanguagePicker(Translations.t.general.index.SupportedLanguages()) - .SetStyle("position: absolute; right: 1.5em; top: 1.5em;"), - Translations.t.general.index.SetStyle("margin-top: 2em;display:block; margin-bottom: 1em;") - ]) + .SetClass("absolute top-2 right-3 dropdown-ui-element-2226"), + Translations.t.general.index.SetClass("sm:text-center lg:text-left block m-6 mt-8") + ]) } - - intro, - tr.streetcomplete this._component = new Combine([ + intro, new Combine(els), + tr.streetcomplete.SetClass("block text-base mx-10 my-3 mb-10") ]); return this._component.Render(); } diff --git a/index.css b/index.css index 9fbd083..e096803 100644 --- a/index.css +++ b/index.css @@ -492,52 +492,6 @@ a { } /** Switch layout **/ -.subtle-button { - display: flex; - flex-wrap: nowrap; - flex-direction: row; - font-size: large; - margin: 0.5em; - background-color: var(--subtle-detail-color); - color: var(--subtle-detail-color-contrast); - border-radius: 1em; - align-items: center; - text-decoration: none; -} - - -.subtle-button a { - text-decoration: unset !important; - color: unset !important; - display: block ruby; -} - -.round-button .subtle-button { - width: 2em; - height: 2em; - border-radius: 1em; - display: block !important; - margin: 0; - padding: 0.5em; -} - -.small-button .subtle-button { - height: 2em; -} - -.small-button .subtle-button img { - max-height: 1.8em; -} - -.subtle-button img { - max-width: 3em; - height: 3em; - margin-right: 0.5em; - padding: 0; - padding-bottom: 0.2em; -} - - .small-image img { height: 1em; max-width: 1em; @@ -596,4 +550,4 @@ a { .ornament svg polygon { fill: var(--subtle-detail-color-light-contrast); -} \ No newline at end of file +}