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/html/index.html b/frontend/www/html/index.html index 9a253e3..900664d 100644 --- a/frontend/www/html/index.html +++ b/frontend/www/html/index.html @@ -6,6 +6,14 @@ + + <% if (htmlWebpackPlugin.options.title=="Mobile View" ) { %> + + <% } %> diff --git a/frontend/www/src/modules/modal.ts b/frontend/www/src/modules/modal.ts index 922c49d..3287b7b 100644 --- a/frontend/www/src/modules/modal.ts +++ b/frontend/www/src/modules/modal.ts @@ -3,9 +3,25 @@ import { ebsFetch } from "../util/ebs"; import { getConfig } from "../util/config"; import { logToDiscord } from "../util/logger"; +document.body.addEventListener("click", (e) => { + e.stopPropagation(); + e.preventDefault(); +}); + +document.body.addEventListener("dblclick", (e) => { + e.stopPropagation(); + e.preventDefault(); +}); + +document.addEventListener("auxclick", (e) => { + e.stopPropagation(); + e.preventDefault(); +}); + /* 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")!; @@ -97,6 +113,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();