diff --git a/src/common/config/public/ClientConfig.ts b/src/common/config/public/ClientConfig.ts index 9ce706346..839a980fe 100644 --- a/src/common/config/public/ClientConfig.ts +++ b/src/common/config/public/ClientConfig.ts @@ -29,6 +29,10 @@ export enum ThemeModes { light = 1, dark, auto } +export enum ScrollUpModes { + never = 1, mobileOnly, always +} + export type TAGS = { client?: true, priority?: ConfigPriority, @@ -739,6 +743,17 @@ export class NavBarConfig { description: $localize`Ratio of the page height, you need to scroll to hide the navigation bar.`, }) NavbarHideDelay: number = 0.15; + + @ConfigProperty({ + tags: { + name: $localize`Show scroll up button`, + priority: ConfigPriority.underTheHood + }, + type: ScrollUpModes, + description: $localize`Set when the floating scroll-up button should be visible.`, + }) + showScrollUpButton: ScrollUpModes = ScrollUpModes.mobileOnly; + } @SubConfigClass({tags: {client: true}, softReadonly: true}) diff --git a/src/frontend/app/ui/frame/frame.component.css b/src/frontend/app/ui/frame/frame.component.css index 78515612d..b4b1f9af7 100644 --- a/src/frontend/app/ui/frame/frame.component.css +++ b/src/frontend/app/ui/frame/frame.component.css @@ -60,3 +60,17 @@ a.dropdown-item span, button.dropdown-item span, div.dropdown-item span { a.dropdown-item span.badge, button.dropdown-item span.badge { margin-left: -0.8rem; } + +.btn-scroll-up { + position: fixed; + width: 3em; + height: 3em; + right: -3em; + bottom: 3em; + transition: 0.3s right; + z-index: 999; +} + +.show-btn-scroll-up{ + right: 1em; +} diff --git a/src/frontend/app/ui/frame/frame.component.html b/src/frontend/app/ui/frame/frame.component.html index 3107671f2..91366a8be 100644 --- a/src/frontend/app/ui/frame/frame.component.html +++ b/src/frontend/app/ui/frame/frame.component.html @@ -7,7 +7,7 @@
- + {{title}}