From db145cd8adf8462910c7fec04890206ae53ba7bd Mon Sep 17 00:00:00 2001 From: Jai A Date: Sun, 3 Nov 2024 20:35:04 -0700 Subject: [PATCH] More ads test --- apps/frontend/src/public/promo-frame-us.html | 233 ++++++++----------- apps/frontend/src/public/promo-frame.html | 62 ++--- 2 files changed, 118 insertions(+), 177 deletions(-) diff --git a/apps/frontend/src/public/promo-frame-us.html b/apps/frontend/src/public/promo-frame-us.html index e43142560..bf669126f 100644 --- a/apps/frontend/src/public/promo-frame-us.html +++ b/apps/frontend/src/public/promo-frame-us.html @@ -1,140 +1,111 @@ - - - - Modrinth App Ad - - - - - - -
- -
-
- + + + + + +
+ +
+
+ - + window.addEventListener( + "message", + (event) => { + if (event.data.modrinthAdClick && window.__TAURI_INTERNALS__) { + window.__TAURI_INTERNALS__.invoke("plugin:ads|record_ads_click", {}); + } + + if (event.data.modrinthOpenUrl && window.__TAURI_INTERNALS__) { + window.__TAURI_INTERNALS__.invoke("plugin:ads|open_link", { + path: event.data.modrinthOpenUrl, + origin: event.origin, + }); + } + }, + false, + ); + + window.addEventListener("mousewheel", (event) => { + if (window.__TAURI_INTERNALS__) { + window.__TAURI_INTERNALS__.invoke("plugin:ads|scroll_ads_window", { + scroll: event.deltaY, + }); + } + }); + + document.addEventListener("contextmenu", (event) => event.preventDefault()); + + const plusLink = document.getElementById("plus-link"); + plusLink.addEventListener("click", function () { + window.__TAURI_INTERNALS__.invoke("plugin:ads|record_ads_click", {}); + window.__TAURI_INTERNALS__.invoke("plugin:ads|open_link", { + path: "https://modrinth.com/plus", + origin: "https://modrinth.com", + }); + }); + + diff --git a/apps/frontend/src/public/promo-frame.html b/apps/frontend/src/public/promo-frame.html index 740752386..46377d2e4 100644 --- a/apps/frontend/src/public/promo-frame.html +++ b/apps/frontend/src/public/promo-frame.html @@ -50,57 +50,27 @@