From 539693190906df8dec520f14170d75d35a1d7929 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 9 Mar 2026 09:31:02 -0700 Subject: [PATCH] add footer ad to homepage (#3385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ad a footer ad to the bottom of the homescreen Screenshot 2026-03-08 at 2 28 05 PM Screenshot 2026-03-08 at 2 28 56 PM Screenshot 2026-03-08 at 2 29 31 PM ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan --- index.html | 7 ++- src/client/GutterAds.ts | 22 ++++++- src/client/Main.ts | 1 + src/client/components/Footer.ts | 2 +- src/client/components/HomeFooterAd.ts | 86 +++++++++++++++++++++++++++ src/client/components/MainLayout.ts | 2 +- 6 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 src/client/components/HomeFooterAd.ts diff --git a/index.html b/index.html index 153e80acd..7c22c1357 100644 --- a/index.html +++ b/index.html @@ -252,8 +252,11 @@ > - - + +
+ + +
{ + const isDesktop = window.innerWidth >= 640; + this.hasFooterAd = isDesktop && window.innerHeight >= FOOTER_AD_MIN_HEIGHT; + }; + private leftAdType: string = "standard_iab_left2"; private rightAdType: string = "standard_iab_rght1"; private leftContainerId: string = "gutter-ad-container-left"; @@ -23,6 +32,8 @@ export class GutterAds extends LitElement { connectedCallback() { super.connectedCallback(); + this.onResize(); + window.addEventListener("resize", this.onResize); document.addEventListener("userMeResponse", () => { if (window.adsEnabled) { console.log("showing gutter ads"); @@ -110,6 +121,7 @@ export class GutterAds extends LitElement { disconnectedCallback() { super.disconnectedCallback(); + window.removeEventListener("resize", this.onResize); } render() { @@ -121,7 +133,10 @@ export class GutterAds extends LitElement {