Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-enabled dartsThrown, fixed winner-animation styles #35

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/PageConfig.vue
Original file line number Diff line number Diff line change
@@ -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
13 changes: 9 additions & 4 deletions entrypoints/match.content/winner-animation.ts
Original file line number Diff line number Diff line change
@@ -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;
@@ -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;
@@ -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`;