Add an ad banner

This commit is contained in:
Manuel Thalmann 2022-12-23 18:13:25 +01:00
parent c130b72ab6
commit de0b81efac
4 changed files with 45 additions and 2 deletions

BIN
src/assets/ad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/adInfo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

View file

@ -81,7 +81,7 @@ export function App()
} }
}, },
{ {
className: `game ${game.winner ? `winner ${game.winner}` : ""}` className: `game ${game.winner ? `winner ${game.winner}` : game.currentPlayer}`
}, },
[ [
Board, Board,
@ -94,7 +94,8 @@ export function App()
`Player ${Constants.PLAYER_NAMES[game.winner]} wins!` : `Player ${Constants.PLAYER_NAMES[game.winner]} wins!` :
`It's player "${Constants.PLAYER_NAMES[game.currentPlayer]}"s turn` `It's player "${Constants.PLAYER_NAMES[game.currentPlayer]}"s turn`
], ],
[MenuBar, { game }] [MenuBar, { game }],
[Ad]
]; ];
} }
@ -198,3 +199,41 @@ export function Button({ content })
...content ...content
]; ];
} }
/**
* Renders a very serious ad.
*
* @returns {NodeDescriptor}
* The rendered ad.
*/
export function Ad()
{
return [
"div",
{
className: "ad",
style: "text-align: center;"
},
[
"div",
{
style: "display: inline-block; position: relative;"
},
[
"a",
{
href: "https://www.youtube.com/watch?v=Wgt7JQdymsQ",
target: "_blank"
},
["img", { src: "./assets/ad.gif" }],
[
"img",
{
src: "./assets/adInfo.png",
style: "position: absolute; top: 0; right: 0;"
}
]
]
]
];
}

View file

@ -87,3 +87,7 @@ div {
.game .menu-bar button { .game .menu-bar button {
margin: 0 5px 5px 0; margin: 0 5px 5px 0;
} }
.ad {
margin-top: 3rem;
}