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 {