diff --git a/frontend/src/styles/ads.scss b/frontend/src/styles/ads.scss index 28a1f3eb9..9df39e3fa 100644 --- a/frontend/src/styles/ads.scss +++ b/frontend/src/styles/ads.scss @@ -70,9 +70,19 @@ justify-content: center; justify-self: center; align-items: center; + grid-template-areas: "mid right"; + .textLeft { + grid-area: left; + text-align: right; + display: none; + } + .textRight { + grid-area: right; + } .icon { width: unset; height: unset; + grid-area: mid; } .text { color: var(--sub-color); @@ -81,5 +91,12 @@ font-size: 0.7rem; } } + &.withLeft { + grid-template-columns: 1fr auto 1fr; + grid-template-areas: "left mid right"; + .textLeft { + display: block; + } + } } } diff --git a/frontend/src/ts/controllers/ad-controller.ts b/frontend/src/ts/controllers/ad-controller.ts index b73355014..8a0c4a261 100644 --- a/frontend/src/ts/controllers/ad-controller.ts +++ b/frontend/src/ts/controllers/ad-controller.ts @@ -131,30 +131,36 @@ export async function renderResult(): Promise { if (!initialised) { init(); } - if (widerThanBreakpoint) { - // $("#ad-result-wrapper").html(` - //
- //
- // `); - // if ($("#ad-result-wrapper").is(":empty")) { - //@ts-ignore - // window.egAps.render(["ad-result"]); - // } else { - //@ts-ignore - window.egAps.refreshAds(["ad-result"]); - // } - } else { - // $("#ad-result-small-wrapper").html(` - //
- //
- // `); - // if ($("#ad-result-small-wrapper").is(":empty")) { - //@ts-ignore - // window.egAps.render(["ad-result-small"]); - // } else { - //@ts-ignore - window.egAps.refreshAds(["ad-result-small"]); - // } + //@ts-ignore + if (window.egAps === undefined) return; + try { + if (widerThanBreakpoint) { + // $("#ad-result-wrapper").html(` + //
+ //
+ // `); + // if ($("#ad-result-wrapper").is(":empty")) { + //@ts-ignore + // window.egAps.render(["ad-result"]); + // } else { + //@ts-ignore + window.egAps.refreshAds(["ad-result"]); + // } + } else { + // $("#ad-result-small-wrapper").html(` + //
+ //
+ // `); + // if ($("#ad-result-small-wrapper").is(":empty")) { + //@ts-ignore + // window.egAps.render(["ad-result-small"]); + // } else { + //@ts-ignore + window.egAps.refreshAds(["ad-result-small"]); + // } + } + } catch (e) { + $("#ad-result-wrapper .iconAndText").addClass("withLeft"); } } diff --git a/frontend/static/html/pages/test.html b/frontend/static/html/pages/test.html index d44bed469..9584bb9ce 100644 --- a/frontend/static/html/pages/test.html +++ b/frontend/static/html/pages/test.html @@ -305,16 +305,23 @@