Skip to content

Commit

Permalink
Merge pull request creazy231#35 from dotty-dev/main
Browse files Browse the repository at this point in the history
re-enabled dartsThrown, fixed winner-animation styles
  • Loading branch information
creazy231 authored May 28, 2024
2 parents 3002a35 + e8884b3 commit f7d9590
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/PageConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
</div>
</div>

<div v-if="false" class="space-y-4 rounded border border-white/10 p-4">
<div class="space-y-4 rounded border border-white/10 p-4">
<div>
<h2 class="text-lg font-semibold">
Show thrown darts
Expand Down
13 changes: 9 additions & 4 deletions entrypoints/match.content/winner-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,23 @@ export async function removeWinnerAnimationOnEdit() {
}

export async function winnerAnimation() {
addStyles(
addStyles(/* css */
`
.ad-ext-player-winner .ad-ext-player-score {
text-align: center;
line-height: 1;
margin-bottom: 0;
}
#ad-ext_winner-animation--message {
text-align: center;
line-height: 1;
}
.ad-ext_winner-score-wrapper + div{
margin-bottom: var(--chakra-space-4);
}
.ad-ext_winner-animation {
overflow: visible;
position: relative;
Expand Down Expand Up @@ -94,7 +99,7 @@ export async function winnerAnimation() {
border-radius: 5px;
}
.ad-ext-player-winner + div {
.ad-ext_winner-animation .ad-ext-player-winner + div {
border-radius: 5px;
background: black;
margin-top: 2px;
Expand Down Expand Up @@ -145,8 +150,8 @@ export async function winnerAnimation() {
(winnerScoreWrapperEl as HTMLElement).style.height = `${winnerScoreElHeight}px`;
}

if (config.thrownDartsOnWin.enabled && dartsThrown.length > 0) {
// (winnerScoreEl as HTMLElement).innerText = `${dartsThrown} Darts`; // TODO: Add darts thrown to winner animation in other way that does not break the confetti animation
if (config.thrownDartsOnWin.enabled && dartsThrown.length > 0) { // TODO: move to seprate file
(winnerScoreEl.firstChild as HTMLElement).textContent = `${dartsThrown} Darts`; //
// set font size of dart thrown text to 48pt on smaller screens because of longer text
if (!winnerScoreElWidth || winnerScoreElWidth < 615) (winnerScoreEl as HTMLElement).style.fontSize = "48pt";
(winnerScoreEl as HTMLElement).style.lineHeight = `${winnerScoreElHeight}px`;
Expand Down

0 comments on commit f7d9590

Please sign in to comment.