From 2e6f6fe729a224438cdc3a26caf8ae69d0c0fcf2 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 28 Jul 2024 18:10:54 +0100 Subject: [PATCH 1/3] chore: Add Termly consent preferences and policies links (#3187) * chore: Add Termly consent preferences and policies links Added Termly consent preferences link and links to Privacy Policy, Cookie Disclaimer, Terms & Conditions, and Acceptable Use Policy in the HTML file. Also included a script for blocking resources from Termly. * feat: Add consent preferences menu option This commit adds a new menu option for "Consent Preferences" in the UI. When clicked, it triggers a click event on the consent link element and focuses on it. This allows users to easily access and manage their consent preferences. --- index.html | 7 ++++++- src/ui/menu-ui-handler.ts | 24 +++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 3722bdd3422..0634385f38b 100644 --- a/index.html +++ b/index.html @@ -39,6 +39,7 @@ + + + Privacy Policy + Cookie Disclaimer + Terms & Conditions + Acceptable Use Policy - \ No newline at end of file diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 88c9791c689..a0cea2f78d5 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -193,17 +193,31 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { this.scene.gameData.tryExportData(GameDataType.SYSTEM); return true; + } + }, + { + label: "Consent Preferences", + handler: () => { + const consentLink = document.querySelector(".termly-display-preferences") as HTMLInputElement; + const clickEvent = new MouseEvent("click", { + view: window, + bubbles: true, + cancelable: true + }); + consentLink.dispatchEvent(clickEvent); + consentLink.focus(); + return true; }, keepOpen: true - }); - manageDataOptions.push({ + }, + { label: i18next.t("menuUiHandler:cancel"), handler: () => { this.scene.ui.revertMode(); return true; - } - } - ); + }, + keepOpen: true + }); this.manageDataConfig = { xOffset: 98, From 118db8c7d0a89a6110e280b82be0b4ccab2ea312 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 28 Jul 2024 20:35:51 +0100 Subject: [PATCH 2/3] chore: Update links layout and position in index.html --- index.css | 11 +++++++++++ index.html | 12 +++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/index.css b/index.css index 30e7c63d954..28c991c29b4 100644 --- a/index.css +++ b/index.css @@ -19,9 +19,20 @@ html { body { margin: 0; + display:flex; + flex-direction: column; + align-items: center; background: #484050; } +#links { + width: 90%; + text-align: center; + position: fixed; + bottom: 0; + display: flex; + justify-content: space-around; +} #app { display: flex; justify-content: center; diff --git a/index.html b/index.html index 0634385f38b..d567eba0866 100644 --- a/index.html +++ b/index.html @@ -117,10 +117,12 @@ - - Privacy Policy - Cookie Disclaimer - Terms & Conditions - Acceptable Use Policy + \ No newline at end of file From 2d1fe13efad724d69fe40ec2ed240a349ae3d1d4 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer <110984302+ben-lear@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:03:38 -0400 Subject: [PATCH 3/3] [QoL] Toggle TNC display visibility (#3210) * toggle TNC display visibility on end of Title phase * move TNC toggle to helper util * update to use stylesheet * dynamically move TNC links according to window size * adjust TNC link spacing * adjust TNC link spacing * add early escape if links element not found * remove link hide functionality --------- Co-authored-by: ImperialSympathizer --- index.css | 12 ++++++++++++ index.html | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/index.css b/index.css index 28c991c29b4..85878e54fff 100644 --- a/index.css +++ b/index.css @@ -206,6 +206,18 @@ input:-internal-autofill-selected { } } +#tnc-links { + font-size: larger; + position: relative; + bottom: max(calc(92vh - 100vw / 16 * 9), 0%); +} + +a { + color: #328cea; + margin-right: 4px; + margin-left: 4px; +} + /* Firefox old*/ @-moz-keyframes blink { 0% { diff --git a/index.html b/index.html index d567eba0866..e37529572e5 100644 --- a/index.html +++ b/index.html @@ -117,12 +117,12 @@ -