diff --git a/app/bibleview-js/src/components/BibleView.vue b/app/bibleview-js/src/components/BibleView.vue index 7edf8a8f95..39b8e2d891 100644 --- a/app/bibleview-js/src/components/BibleView.vue +++ b/app/bibleview-js/src/components/BibleView.vue @@ -40,14 +40,8 @@
Invisible element to make fonts load properly
-
-
- -
-
- -
-
+
+
svg { - transform: translateX(-50%) translateY(-50%) translateX(6mm) translateY(6mm) scale(150%); - } - color: rgba(0, 0, 0, 0.2); + right: 0; + bottom: 0; + top: 0; + width: 0; } .prev-page-button { @extend .next-page-button; - left: 4mm; + left: 0; right: unset; } + .bottom-touch-block { position: fixed; bottom: 0; diff --git a/app/bibleview-js/src/composables/config.ts b/app/bibleview-js/src/composables/config.ts index 2e16a7dc3a..c9bee4134e 100644 --- a/app/bibleview-js/src/composables/config.ts +++ b/app/bibleview-js/src/composables/config.ts @@ -16,10 +16,10 @@ */ -import {computed, nextTick, reactive, Ref} from "vue"; +import {computed, nextTick, reactive, Ref, shallowRef, triggerRef} from "vue"; import {emit, setupEventBusListener} from "@/eventbus"; import {isEqual} from "lodash"; -import {Deferred} from "@/utils"; +import {Deferred, setupWindowEventListener} from "@/utils"; import {BibleViewDocumentType} from "@/types/documents"; export type StrongsMode = 0 | 1 | 2 | 3 @@ -206,15 +206,29 @@ export function useConfig(documentType: Ref) { const mmInPx = calcMmInPx(); const isBible = computed(() => documentType.value === "bible"); + const resizeTrigger = shallowRef(); + setupWindowEventListener("resize", () => triggerRef(resizeTrigger)); const calculatedConfig = computed(() => { + resizeTrigger.value; let topOffset = appSettings.topOffset; let topMargin = 0; if (isBible.value) { topMargin = config.topMargin * mmInPx; topOffset += topMargin; } - return {topOffset, topMargin}; + const windowWidth = window.innerWidth; + const maxWidth = config.marginSize.maxWidth * mmInPx; + const leftPadding = config.marginSize.marginLeft * mmInPx; + const rightPadding = config.marginSize.marginRight * mmInPx; + + const elementWidth = Math.min(maxWidth, windowWidth - leftPadding - rightPadding); + const margin = (windowWidth - elementWidth) / 2; + + const marginLeft = margin + (leftPadding - rightPadding)/2; + const marginRight = margin + (rightPadding - leftPadding)/2; + + return {topOffset, topMargin, marginLeft, marginRight}; }); window.bibleViewDebug.config = config;