Skip to content

Commit 9898ade

Browse files
committed
Cleanup
1 parent e14c18f commit 9898ade

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

src/components/ChampionBanList.vue

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export default {
3838
},
3939
4040
props: {
41+
active: {
42+
type: Boolean,
43+
default: false,
44+
},
45+
4146
bans: {
4247
type: Array,
4348
required: true,

src/components/ChampionPickList.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export default {
3636
},
3737
3838
props: {
39+
active: {
40+
type: Boolean,
41+
default: false,
42+
},
43+
3944
champions: {
4045
type: Array,
4146
required: true,
@@ -67,4 +72,4 @@ export default {
6772
.champion-hovered {
6873
animation: champion-hovered 2s infinite ease-in-out;
6974
}
70-
</style>
75+
</style>

src/components/Game.vue

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
<div v-if="state !== null && champions !== null" class="d-flex flex-column h-100">
33
<div class="row" style="height: 65px;">
44
<div class="col-5 bg-info d-flex justify-content-between align-items-baseline">
5-
<h1 class="d-inline-block">{{ state.teams[0].name }}</h1>
5+
<h1 class="d-inline-block text-nowrap overflow-hidden text-truncate">{{ state.teams[0].name }}</h1>
66
<h5 class="d-inline-block">{{ getTeamAction(0) }}</h5>
77
</div>
8-
<div class="col-2 d-flex justify-content-center" :class="['ready', 'done'].includes(currentAct) ? '' : (currentTeam === 0 ? 'blue-act-gradient' : 'red-act-gradient')">
9-
<h1>{{ currentAct === 'done' ? 'Done' : timer }}</h1>
8+
<div class="col-2 d-flex justify-content-center" :class="['ready', 'done'].includes(currentAct) ? 'blue-red-gradient' : (currentTeam === 0 ? 'blue-act-gradient' : 'red-act-gradient')">
9+
<h1>{{ timer }}</h1>
1010
</div>
1111
<div class="col-5 bg-danger d-flex justify-content-between align-items-baseline">
1212
<h5 class="d-inline-block">{{ getTeamAction(1) }}</h5>
13-
<h1 class="d-inline-block">{{ state.teams[1].name }}</h1>
13+
<h1 class="d-inline-block text-nowrap overflow-hidden text-truncate">{{ state.teams[1].name }}</h1>
1414
</div>
1515
</div>
1616
<div class="row" style="height: calc(100% - 65px - 80px);">
17-
<champion-pick-list class="col-xl-2 col-sm-3 bg-info p-3" :champions="champions" :picks="state.picks[0]" :hovered="getHovered(0, 'pick')"></champion-pick-list>
17+
<champion-pick-list class="col-xl-2 col-sm-3 bg-info p-3" :champions="champions" :picks="state.picks[0]" :hovered="getHovered(0, 'pick')" :active="getActive(0, 'pick')"></champion-pick-list>
1818
<div class="col-xl-8 col-sm-6 overflow-hidden h-100">
1919
<champion-picker ref="championPicker" :champions="champions" :banned-ids="bannedChampionIds" :picked-ids="pickedChampionIds" :disabled="team === null || ['ready', 'done'].includes(currentAct)" v-model="input.champion"></champion-picker>
2020
</div>
21-
<champion-pick-list class="col-xl-2 col-sm-3 bg-danger p-3" :champions="champions" :picks="state.picks[1]" :hovered="getHovered(1, 'pick')"></champion-pick-list>
21+
<champion-pick-list class="col-xl-2 col-sm-3 bg-danger p-3" :champions="champions" :picks="state.picks[1]" :hovered="getHovered(1, 'pick')" :active="getActive(1, 'pick')"></champion-pick-list>
2222
</div>
2323
<div class="row" style="height: 80px;">
2424
<div class="col-5 bg-info d-flex justify-content-end">
25-
<champion-ban-list :champions="champions" :bans="state.bans[0]" :team="0" :hovered="getHovered(0, 'ban')"></champion-ban-list>
25+
<champion-ban-list :champions="champions" :bans="state.bans[0]" :team="0" :hovered="getHovered(0, 'ban')" :active="getActive(0, 'ban')"></champion-ban-list>
2626
</div>
2727
<div class="col-2">
2828
<div class="py-3 h-100">
2929
<button type="button" class="rounded-0 btn w-100 h-100" :class="['ready', 'done'].includes(currentAct) ? 'btn-secondary' : (currentTeam === 0 ? 'btn-info' : 'btn-danger')" :disabled="!canAct" @click="lock">{{ actButtonText }}</button>
3030
</div>
3131
</div>
3232
<div class="col-5 bg-danger d-flex justify-content-start">
33-
<champion-ban-list :champions="champions" :bans="state.bans[1]" :team="1" :hovered="getHovered(1, 'ban')"></champion-ban-list>
33+
<champion-ban-list :champions="champions" :bans="state.bans[1]" :team="1" :hovered="getHovered(1, 'ban')" :active="getActive(1, 'ban')"></champion-ban-list>
3434
</div>
3535
</div>
3636
</div>
@@ -126,6 +126,10 @@ export default {
126126
});
127127
},
128128
129+
getActive(team, act) {
130+
return this.currentTeam === team && this.currentAct === act;
131+
},
132+
129133
getHovered(team, act) {
130134
if(this.currentTeam !== team || this.currentAct !== act) {
131135
return null;
@@ -152,6 +156,8 @@ export default {
152156
153157
endTimer() {
154158
cancelAnimationFrame(this.timerFrame);
159+
this.timerFrame = null;
160+
this.timer = null;
155161
},
156162
157163
hover(champion) {
@@ -175,7 +181,6 @@ export default {
175181
}
176182
177183
this.timer = displaySeconds;
178-
179184
this.timerFrame = requestAnimationFrame(updateTimer);
180185
};
181186

src/style.scss

+4
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ button:disabled {
1212
.red-act-gradient {
1313
background: linear-gradient(90deg, $info 10%, $danger 35%);
1414
}
15+
16+
.blue-red-gradient {
17+
background: linear-gradient(90deg, $info, $danger);
18+
}

0 commit comments

Comments
 (0)