diff --git a/frontend/www/css/base.css b/frontend/www/css/base.css index 45bdeb8..90b4ad6 100644 --- a/frontend/www/css/base.css +++ b/frontend/www/css/base.css @@ -8,6 +8,7 @@ body { background-color: #111; color: #fff; + overscroll-behavior: contain; } main { diff --git a/frontend/www/src/modules/modal.ts b/frontend/www/src/modules/modal.ts index ff6abc2..4baa5cb 100644 --- a/frontend/www/src/modules/modal.ts +++ b/frontend/www/src/modules/modal.ts @@ -21,6 +21,7 @@ document.addEventListener("auxclick", (e) => { /* Containers */ const $modalWrapper = document.getElementById("modal-wrapper")!; const $modal = document.getElementById("modal-wrapper")!.getElementsByClassName("modal")[0]!; +const $modalInsideWrapper = $modal.getElementsByClassName("modal-inside-wrapper")[0]!; /* Descriptors */ const $modalTitle = document.getElementById("modal-title")!; @@ -109,6 +110,9 @@ export async function openModal(redeem: Redeem | null) { $modalPrice.textContent = redeem.price.toString(); $modalImage.src = redeem.image; + // scroll to top of modal + $modalInsideWrapper.scrollTop = 0; + setTimeout(() => $modal.classList.add("active-modal"), 10); hideProcessingModal();