diff --git a/resources/images/MastersIcon.png b/resources/images/MastersIcon.png new file mode 100644 index 000000000..52532c841 Binary files /dev/null and b/resources/images/MastersIcon.png differ diff --git a/src/client/graphics/layers/WinModal.ts b/src/client/graphics/layers/WinModal.ts index d8a89e6aa..819e50a47 100644 --- a/src/client/graphics/layers/WinModal.ts +++ b/src/client/graphics/layers/WinModal.ts @@ -1,38 +1,24 @@ import { LitElement, css, html } from "lit"; import { customElement, state } from "lit/decorators.js"; +import mastersIcon from "../../../../resources/images/MastersIcon.png"; import { EventBus } from "../../../core/EventBus"; import { Team } from "../../../core/game/Game"; import { GameUpdateType } from "../../../core/game/GameUpdates"; import { GameView, PlayerView } from "../../../core/game/GameView"; -import { PseudoRandom } from "../../../core/PseudoRandom"; -import { simpleHash } from "../../../core/Util"; import { SendWinnerEvent } from "../../Transport"; import { Layer } from "./Layer"; -// Add this at the top of your file -declare global { - interface Window { - adsbygoogle: unknown[]; - } -} - -// Add this at the top of your file -declare let adsbygoogle: unknown[]; - @customElement("win-modal") export class WinModal extends LitElement implements Layer { public game: GameView; public eventBus: EventBus; - private rand: PseudoRandom; - private hasShownDeathModal = false; @state() isVisible = false; private _title: string; - private won: boolean; // Override to prevent shadow DOM creation createRenderRoot() { @@ -53,7 +39,7 @@ export class WinModal extends LitElement implements Layer { box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px); color: white; - width: 300px; + width: 350px; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; @@ -77,7 +63,7 @@ export class WinModal extends LitElement implements Layer { .win-modal h2 { margin: 0 0 15px 0; - font-size: 24px; + font-size: 26px; text-align: center; color: white; } @@ -127,7 +113,7 @@ export class WinModal extends LitElement implements Layer { } .win-modal h2 { - font-size: 20px; + font-size: 26px; } .win-modal button { @@ -160,7 +146,41 @@ export class WinModal extends LitElement implements Layer { innerHtml() { return html` -
+
+
+ Watch the best compete in the +
+ OpenFront Masters +
+
`; } @@ -179,9 +199,7 @@ export class WinModal extends LitElement implements Layer { window.location.href = "/"; } - init() { - this.rand = new PseudoRandom(simpleHash(this.game.myClientID())); - } + init() {} tick() { const myPlayer = this.game.myPlayer(); @@ -194,7 +212,6 @@ export class WinModal extends LitElement implements Layer { ) { this.hasShownDeathModal = true; this._title = "You died"; - this.won = false; this.show(); } this.game.updatesSinceLastTick()[GameUpdateType.Win].forEach((wu) => { @@ -204,10 +221,8 @@ export class WinModal extends LitElement implements Layer { ); if (wu.winner == this.game.myPlayer()?.team()) { this._title = "Your team won!"; - this.won = true; } else { this._title = `${wu.winner} team has won!`; - this.won = false; } this.show(); } else { @@ -219,10 +234,8 @@ export class WinModal extends LitElement implements Layer { ); if (winner == this.game.myPlayer()) { this._title = "You Won!"; - this.won = true; } else { this._title = `${winner.name()} has won!`; - this.won = false; } this.show(); }