Skip to content

Commit 6eb6866

Browse files
committed
#52 Fennec: Clock red at <= 10 seconds
1 parent 23c43e1 commit 6eb6866

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

src/themes/fennec/theme.json

+21
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,27 @@
247247
"label": "Show map name and screenshot in the Series Graph, even if there is only a single match in the series"
248248
},
249249

250+
"preferences.topBar.clock.tenSecondsRedInFreezetime": {
251+
"type": "boolean",
252+
"fallback": false,
253+
"section": "Preferences",
254+
"label": "Show clock in red at less than 10 seconds in Freezetime"
255+
},
256+
257+
"preferences.topBar.clock.tenSecondsRedInTacticalTimeout": {
258+
"type": "boolean",
259+
"fallback": false,
260+
"section": "Preferences",
261+
"label": "Show clock in red at less than 10 seconds during Tactical Timeouts"
262+
},
263+
264+
"preferences.topBar.clock.tenSecondsRedInRoundRestartDelay": {
265+
"type": "boolean",
266+
"fallback": false,
267+
"section": "Preferences",
268+
"label": "Show clock in red at less than 10 seconds after round end"
269+
},
270+
250271
"css.base-scale-factor": {
251272
"type": "text",
252273
"section": "Style Overrides",

src/themes/fennec/top-bar/center/current-round/clock/clock.css

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ img.planted-bomb-icon {
88
font-size: 2.25rem;
99
}
1010

11+
.clock.--red {
12+
color: var(--red);
13+
}
14+
1115
img.bombsite-icon {
1216
height: 1.75rem;
1317
margin-left: 0.75rem;

src/themes/fennec/top-bar/center/current-round/clock/clock.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<img v-else-if="$bomb.bombsite === 'b'" class="bombsite-icon --b" src="/hud/img/icons/bombsite-b.svg" alt="">
88
</div>
99

10-
<!-- TODO configurable: 10 seconds in red -->
11-
<div v-else class="clock">
10+
<div v-else :class="['clock', { '--red': isClockRed }]">
1211
<Digits :value="clockMinutes" digits="1"></Digits>:<Digits :value="clockSeconds" digits="2" pad="0"></Digits>
1312
</div>

src/themes/fennec/top-bar/center/current-round/clock/clock.js

+9
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,14 @@ export default {
1313
clockSeconds() {
1414
return Math.ceil(this.$round.phaseEndsInSec % 60)
1515
},
16+
17+
isClockRed() {
18+
if (this.$round.phase === 'freezetime' && ! this.$opts['preferences.topBar.clock.tenSecondsRedInFreezetime']) return false
19+
if ((this.$round.phase === 'timeout_ct' || this.$round.phase === 'timeout_t') && ! this.$opts['preferences.topBar.clock.tenSecondsRedInTacticalTimeout']) return false
20+
if (this.$round.phase === 'over' && ! this.$opts['preferences.topBar.clock.tenSecondsRedInRoundRestartDelay']) return false
21+
22+
return this.clockMinutes === 0
23+
&& this.clockSeconds <= 10
24+
},
1625
},
1726
}

0 commit comments

Comments
 (0)