Skip to content

Commit

Permalink
Update auction for VVL
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed May 16, 2022
1 parent ea89f4a commit 7b11f8d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
6 changes: 3 additions & 3 deletions server/src/discord/new_auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function money(num) {
return `$${num || 0}k`;
}
function getAuctionMax() {
return 8;
return 7;
}

function deAirtable(obj) {
Expand Down Expand Up @@ -62,7 +62,7 @@ const Auction = {
activePlayer: null,
wait: {
afterInitial: 20,
afterBid: 12
afterBid: 15
},
stats: {},
timeouts: {},
Expand Down Expand Up @@ -172,7 +172,7 @@ const Auction = {
getBroadcast: async function() {
try {
return await select("Broadcasts", {
filterByFormula: "{Key} = \"bpl3\""
filterByFormula: "{Key} = \"vvl\""
});
} catch (e) {
console.error(e);
Expand Down
12 changes: 6 additions & 6 deletions server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ function corsHandle(origin, callback) {

const io = require("socket.io")(http, {cors: { origin: corsHandle, credentials: true}, allowEIO3: true});

// const auction = require("./discord/new_auction.js")({
// to: (...a) => io.to(...a),
// emit: (...a) => io.emit(...a),
// on: (...a) => io.on(...a),
// test: ["hi"]
// });
const auction = require("./discord/new_auction.js")({
to: (...a) => io.to(...a),
emit: (...a) => io.emit(...a),
on: (...a) => io.on(...a),
test: ["hi"]
});


const Cache = (require("./cache.js")).setup(io);
Expand Down
36 changes: 27 additions & 9 deletions website/src/components/broadcast/auction/AuctionOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<div class="player-info w-100 flex-center flex-column">
<div v-if="player">
<div class="player-name">{{ player.name }}</div>
<div class="player-teams d-flex flex-wrap flex-center">
<PlayerTeamDisplay :team="team" v-for="team in playerTeams" v-bind:key="team.id" />
<div class="player-teams d-flex flex-wrap flex-center" v-for="group in groupedTeams" :key="group.group" :class="`group-${group.group}`">
<PlayerTeamDisplay :team="team" v-for="team in group.teams" v-bind:key="team.id" />
</div>
</div>
</div>
Expand Down Expand Up @@ -126,6 +126,22 @@ export default {
return true;
}).sort((a, b) => sortEvents(a.event, b.event));
},
groupedTeams() {
if (!this.broadcast?.event?.game) return [{ teams: this.playerTeams, group: "all" }];
const sameGame = [];
const diffGame = [];
this.playerTeams.forEach(team => {
if (team.game?.[0] === this.broadcast.event.game) {
sameGame.push(team);
} else {
diffGame.push(team);
}
});
return [
{ teams: sameGame, group: "same" },
{ teams: diffGame, group: "diff" }
];
},
eventLogo() {
if (!this._broadcast?.event?.theme) return {};
return resizedImage(this._broadcast.event.theme, ["default_logo", "default_wordmark"], "h-200");
Expand Down Expand Up @@ -174,12 +190,13 @@ export default {
},
displayTeams() {
if (!this.teams?.length) return [];
let teams = this.teams;
if (this.teams.length > 8) {
if (this.rightDisplay === "teams-1") teams = teams.slice(0, 8);
if (this.rightDisplay === "teams-2") teams = teams.slice(8, 16);
}
const teams = this.teams;
return teams;
// if (this.teams.length > 8) {
// if (this.rightDisplay === "teams-1") teams = teams.slice(0, 8);
// if (this.rightDisplay === "teams-2") teams = teams.slice(8, 16);
// }
// return teams;
},
signedTeam() {
if (!this.justSigned?.id) return null;
Expand Down Expand Up @@ -338,6 +355,7 @@ export default {
.event-stats div {
margin: 2px 0;
}
.group-diff {
transform: scale(0.75);
}
</style>

0 comments on commit 7b11f8d

Please sign in to comment.