18
18
<div :style =" {
19
19
position: 'absolute',
20
20
top: '10px',
21
- left: '20px ',
21
+ left: '180px ',
22
22
'z-index': 99999999999,
23
23
}" >
24
24
<div
25
25
v-if =" alertList[0]"
26
26
:style =" {
27
27
'z-index': 1,
28
28
opacity: showAlert ? 1 : 0,
29
+ // opacity: 1,
29
30
transition: 'opacity 0.5s',
30
31
}"
31
32
class =" Flex coin-thing"
@@ -61,7 +62,6 @@ import { round } from 'lodash';
61
62
62
63
@Component
63
64
export default class extends Vue {
64
- // @Ref('SFX') sfx!: HTMLAudioElement;
65
65
theme = nodecg .bundleConfig .event .theme ;
66
66
total = 0 ;
67
67
playingAlerts = false ;
@@ -109,7 +109,6 @@ export default class extends Vue {
109
109
);
110
110
if (amount && amount > 0 && showAlert ) {
111
111
nodecg .sendMessage (' omnibarPlaySound' , { amount });
112
- // await this.sfx.play();
113
112
await new Promise ((res ) => {
114
113
setTimeout (res , 500 );
115
114
});
@@ -152,25 +151,20 @@ export default class extends Vue {
152
151
async created(): Promise <void > {
153
152
this .total = this .rawTotal ;
154
153
nodecg .listenFor (' donationTotalUpdated' , (data : { total: number }) => {
155
- // If after 10s this hasn't been cleared by a new donation, update the total with it.
156
- this .donationTotalTimeout = window .setTimeout (() => {
157
- nodecg .sendMessage (' donationAlertsLogging' , ' donationTotalTimeout triggered' );
158
- // Double check if the total really needs updating.
159
- // Also, only queue if alerts are not already
160
- // (the play system will check the final total at the end anyway).
161
- const completeTotal = round (data .total + this .additionalDonationsAmount , 2 );
162
- if (! this .playingAlerts && completeTotal !== this .total ) {
163
- nodecg .sendMessage (
164
- ' donationAlertsLogging' ,
165
- ' donationTotalTimeout decided we should push a new total as an alert' ,
166
- );
167
- this .alertList .push ({
168
- total: completeTotal ,
169
- showAlert: false ,
170
- });
171
- if (! this .playingAlerts ) this .playNextAlert (true );
172
- }
173
- }, 10 * 1000 );
154
+ const completeTotal = round (data .total + this .additionalDonationsAmount , 2 );
155
+ if (! this .playingAlerts && completeTotal !== this .total ) {
156
+ nodecg .sendMessage (
157
+ ' donationAlertsLogging' ,
158
+ ' donationTotalTimeout decided we should push a new total as an alert' ,
159
+ );
160
+ this .alertList .push ({
161
+ total: completeTotal ,
162
+ // @ts-expect-error this works so shrug
163
+ amount: (completeTotal - this .total ).toFixed (2 ),
164
+ showAlert: true ,
165
+ });
166
+ if (! this .playingAlerts ) this .playNextAlert (true );
167
+ }
174
168
});
175
169
nodecg .listenFor (' newDonation' , (data : { amount: number }) => {
176
170
clearTimeout (this .donationTotalTimeout );
@@ -202,17 +196,16 @@ export default class extends Vue {
202
196
font-variant-numeric : tabular-nums ;
203
197
font-size : 40px ;
204
198
font-weight : 500 ;
205
- text-align : left ;
206
- float : right ;
207
- height : 82px ;
199
+ text-align : center ;
200
+ // height: 82px;
208
201
209
- padding-left : 40 px ;
210
- padding-right : 40 px ;
202
+ padding-left : 45 px ;
203
+ padding-right : 45 px ;
211
204
212
205
background : var (--bsg-color );
213
206
214
207
--arrow-setting : 50px ;
215
- clip-path : polygon (100% 0% , 85 % 50% , 100% 100% ,
208
+ clip-path : polygon (100% 0% , 80 % 50% , 100% 100% ,
216
209
var (--arrow-setting ) 100% , 10% 50% , var (--arrow-setting ) 0% );
217
210
}
218
211
@@ -228,14 +221,14 @@ export default class extends Vue {
228
221
229
222
/* Each character in the total is in a span; setting width so the numbers appear monospaced. */
230
223
#Total > span {
231
- font-variant-numeric : tabular-nums ;
224
+ width : 0.50 em ;
232
225
color : white ;
233
- padding-top : 14 px ;
226
+ padding-top : 18 px ;
234
227
display : inline-block ;
235
228
text-align : center ;
236
229
background : var (--bsg-color );
230
+ // background: cornflowerblue;
237
231
position : relative ;
238
- font-size : 50px ;
239
232
}
240
233
241
234
#Total > .Comma {
0 commit comments