Skip to content

Commit 7065e87

Browse files
committed
Fix gutter ads, move in-game add to bottom right corner. (#1214)
Move the in-game add to underneath the control panel, ensure both are 320px. Remove black squares on home page when user has ad blocker - [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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors regression is found: openfront <img width="420" alt="Screenshot 2025-06-17 at 7 13 51 PM" src="https://github.com/user-attachments/assets/2177e0b3-de1b-4196-afd7-2ceca412e9fe" />
1 parent 376a523 commit 7065e87

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed

src/client/GutterAdModal.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class GutterAdModal extends LitElement {
5757

5858
if (!window.ramp) {
5959
console.warn("Playwire RAMP not available");
60+
this.hide();
6061
return;
6162
}
6263

@@ -82,6 +83,7 @@ export class GutterAdModal extends LitElement {
8283
});
8384
} catch (error) {
8485
console.error("Failed to load Playwire ads:", error);
86+
this.hide();
8587
}
8688
}
8789

@@ -109,36 +111,24 @@ export class GutterAdModal extends LitElement {
109111
return html`
110112
<!-- Left Gutter Ad -->
111113
<div
112-
class="hidden xl:flex fixed left-0 top-1/2 transform -translate-y-1/2 w-[160px] min-h-[600px] bg-gray-900 border border-gray-600 z-[9999] pointer-events-auto items-center justify-center shadow-lg"
114+
class="hidden xl:flex fixed left-0 top-1/2 transform -translate-y-1/2 w-[160px] min-h-[600px] z-[10] pointer-events-auto items-center justify-center"
113115
style="margin-left: ${this.margin};"
114116
>
115117
<div
116118
id="${this.leftContainerId}"
117119
class="w-full h-full flex items-center justify-center p-2"
118-
>
119-
${!this.adLoaded
120-
? html`<span class="text-white text-xs text-center"
121-
>Loading ad...</span
122-
>`
123-
: ""}
124-
</div>
120+
></div>
125121
</div>
126122
127123
<!-- Right Gutter Ad -->
128124
<div
129-
class="hidden xl:flex fixed right-0 top-1/2 transform -translate-y-1/2 w-[160px] min-h-[600px] bg-gray-900 border border-gray-600 z-[9999] pointer-events-auto items-center justify-center shadow-lg"
125+
class="hidden xl:flex fixed right-0 top-1/2 transform -translate-y-1/2 w-[160px] min-h-[600px] z-[10] pointer-events-auto items-center justify-center"
130126
style="margin-right: ${this.margin};"
131127
>
132128
<div
133129
id="${this.rightContainerId}"
134130
class="w-full h-full flex items-center justify-center p-2"
135-
>
136-
${!this.adLoaded
137-
? html`<span class="text-white text-xs text-center"
138-
>Loading ad...</span
139-
>`
140-
: ""}
141-
</div>
131+
></div>
142132
</div>
143133
`;
144134
}

src/client/graphics/layers/ControlPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export class ControlPanel extends LitElement implements Layer {
206206
</style>
207207
<div
208208
class="${this._isVisible
209-
? "w-full text-sm lg:text-m lg:w-72 bg-gray-800/70 p-2 pr-3 lg:p-4 shadow-lg lg:rounded-lg backdrop-blur"
209+
? "w-[320px] text-sm lg:text-m bg-gray-800/70 p-2 pr-3 lg:p-4 shadow-lg lg:rounded-lg backdrop-blur"
210210
: "hidden"}"
211211
@contextmenu=${(e) => e.preventDefault()}
212212
>

src/client/graphics/layers/LeftInGameAd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class LeftInGameAd extends LitElement implements Layer {
118118

119119
return html`
120120
<div
121-
class="w-full min-h-[100px] bg-gray-900 border border-gray-600 z-[9999] pointer-events-auto flex items-center justify-center"
121+
class="w-[320px] min-h-[100px] bg-gray-900 border border-gray-600 flex items-center justify-center"
122122
>
123123
<div
124124
id="${AD_CONTAINER_ID}"

src/client/index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,18 @@
269269
style="position: fixed; pointer-events: none"
270270
>
271271
<div
272-
class="w-full sm:w-2/3 sm:fixed sm:right-0 sm:bottom-0 sm:flex justify-end"
272+
class="w-full sm:w-2/3 sm:fixed sm:right-0 sm:bottom-0 sm:flex flex-col items-end"
273273
style="pointer-events: none"
274274
>
275275
<chat-display></chat-display>
276276
<events-display></events-display>
277277
</div>
278-
<div class="w-full sm:w-1/3 md:max-w-72" style="pointer-events: auto">
279-
<left-in-game-ad></left-in-game-ad>
278+
<div
279+
class="w-[320px] flex flex-col items-center"
280+
style="pointer-events: auto"
281+
>
280282
<control-panel></control-panel>
283+
<left-in-game-ad></left-in-game-ad>
281284
</div>
282285
</div>
283286

@@ -354,7 +357,7 @@
354357
<user-setting></user-setting>
355358
<multi-tab-modal></multi-tab-modal>
356359
<news-modal></news-modal>
357-
<left-in-game-ad></left-in-game-ad>
360+
<game-left-sidebar></game-left-sidebar>
358361
<div
359362
id="language-modal"
360363
class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex justify-center items-center"

0 commit comments

Comments
 (0)