Skip to content

Commit

Permalink
Add multi standings overlay and add option to go full-width on the ge…
Browse files Browse the repository at this point in the history
…neric overlay
  • Loading branch information
slmnio committed Oct 15, 2022
1 parent 32b76f6 commit ae0d5ee
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 16 deletions.
4 changes: 2 additions & 2 deletions website/src/apps/BroadcastApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="broadcast-app" :class="broadcastClass">
<!-- <div style="font-size: 5em; color: black">{{ $root.activeScene }}</div>-->
<router-view id="overlay" :class="bodyClass" :broadcast="broadcast" :client="client" :title="title" :top="top" :active="active"
:animation-active="animationActive"/>
:animation-active="animationActive" :full="full"/>
<v-style v-if="broadcast && broadcast.event">
{{ broadcast.event.broadcast_css }}

Expand All @@ -21,7 +21,7 @@ import StingerWrap from "@/components/broadcast/StingerWrap";
export default {
name: "BroadcastApp",
props: ["id", "title", "top", "code", "client", "noAnimation", "noStinger", "bodyClass"],
props: ["id", "title", "top", "code", "client", "noAnimation", "noStinger", "bodyClass", "full"],
components: {
StingerWrap
},
Expand Down
4 changes: 2 additions & 2 deletions website/src/apps/ClientApp.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BroadcastApp v-if="broadcastID" :id="broadcastID" :title="title" :client="_client" :no-animation="noAnimation"
:no-stinger="noStinger" :body-class="bodyClass" />
:no-stinger="noStinger" :body-class="bodyClass" :full="full" />
</template>

<script>
Expand All @@ -9,7 +9,7 @@ import { ReactiveRoot, ReactiveThing } from "@/utils/reactive";
export default {
name: "ClientApp",
components: { BroadcastApp },
props: ["client", "title", "noAnimation", "noStinger", "bodyClass"],
props: ["client", "title", "noAnimation", "noStinger", "bodyClass", "full"],
computed: {
_client() {
return ReactiveRoot(`client-${this.client}`, {
Expand Down
9 changes: 6 additions & 3 deletions website/src/components/broadcast/Standings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="teams">
<div class="team-group" v-for="(group, i) in standings.standings" v-bind:key="i">
<div class="team" v-for="team in group" v-bind:key="team.id">
<StandingsTeam :team="team" :tie-text="tieText" :showColumns="showColumns" icon-size="w-60" />
<StandingsTeam :team="team" :tie-text="tieText" :showColumns="showColumns" icon-size="w-60" :use-codes="useCodes" />
</div>
</div>
</div>
Expand Down Expand Up @@ -50,7 +50,9 @@ export default {
stage: String,
title: String,
tieText: String,
showMapDiff: Boolean
showMapDiff: Boolean,
useCodes: Boolean,
overrideShowColumns: Array
},
components: { StandingsTeam },
methods: {
Expand Down Expand Up @@ -119,7 +121,7 @@ export default {
return (this.blocks?.standings || []).find(s => s.group === this.stage);
},
showColumns() {
return this.standingsSettings?.show || [
return this.overrideShowColumns || this.standingsSettings?.show || [
"Matches", "Maps", "MapDiff"
];
},
Expand Down Expand Up @@ -350,6 +352,7 @@ export default {
.standings-header, .top-standings-name {
font-weight: bold;
text-transform: uppercase;
line-height: 1;
}
.team-name {
margin-left: 2em;
Expand Down
7 changes: 4 additions & 3 deletions website/src/components/broadcast/StandingsTeam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<div class="standings-team d-flex">
<div class="team-rank flex-shrink-0">{{ tieText && !teamStats["tie_show_number"] ? tieText : teamStats["rank"] }}</div>
<ThemeLogo class="team-logo flex-shrink-0" :theme="team.theme" icon-padding="0.2em" border-width="0.15em" :logo-size="iconSize || 'w-30'" />
<router-link :to="url('team', team)" class="team-name ct-passive flex-grow-1 text-left d-none d-md-flex">{{ team.name }}</router-link>
<router-link :to="url('team', team)" class="team-name team-code ct-passive flex-grow-1 text-left d-md-none">{{ team.code }}</router-link>
<router-link v-if="!useCodes" :to="url('team', team)" class="team-name ct-passive flex-grow-1 text-left d-none d-md-flex">{{ team.name }}</router-link>
<router-link v-if="!useCodes" :to="url('team', team)" class="team-name team-code ct-passive flex-grow-1 text-left d-md-none">{{ team.code }}</router-link>
<router-link v-if="useCodes" :to="url('team', team)" class="team-name team-code ct-passive flex-grow-1 text-left">{{ team.code }}</router-link>
<div class="team-stats d-flex">
<div class="team-stat text-center" v-for="(stat, i) in stats" v-bind:key="stat + i" v-bind:class="{'d-none d-md-block': ['omw'].includes(stat) }">
{{ teamStats[stat] }}
Expand All @@ -25,7 +26,7 @@ function diffString(val) {
export default {
name: "StandingsTeam",
components: { ThemeLogo },
props: ["team", "tieText", "showColumns", "iconSize"],
props: ["team", "tieText", "showColumns", "iconSize", "useCodes"],
data: () => ({
// stats: ["diff", "map_diff"/*, "points" */]
Expand Down
7 changes: 5 additions & 2 deletions website/src/components/broadcast/roots/GenericOverlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="generic-overlay flex-center flex-column">
<div class="generic-overlay flex-center flex-column" :class="{'full': full}">
<TourneyBar class="st4-top" v-if="top === 'st4'" :broadcast="broadcast" left="Schedule" :right="title"/>
<div class="g-title-wrapper">
<theme-transition :theme="theme" :active="$root.animationActive" end="middle" :duration="500" :inner-delay="150" one-color="true">
Expand Down Expand Up @@ -29,7 +29,7 @@ import ThemeTransition from "@/components/broadcast/ThemeTransition";
export default {
name: "GenericOverlay",
components: { ThemeTransition, TourneyBar },
props: ["title", "accentColor", "bodyColor", "top", "broadcast", "noBottom", "noBottomAnimate", "titleStyle", "customTheme"],
props: ["title", "accentColor", "bodyColor", "top", "broadcast", "noBottom", "noBottomAnimate", "titleStyle", "customTheme", "full"],
methods: {
nbr(text) {
if (!text) return "";
Expand Down Expand Up @@ -74,6 +74,9 @@ export default {
padding: 60px 320px;
}
.generic-overlay.full {
padding: 60px 120px;
}
.schedule-overlay .generic-overlay-body {
padding: 0;
Expand Down
72 changes: 72 additions & 0 deletions website/src/components/broadcast/roots/MultiStandingsOverlay.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<template>
<GenericOverlay class="multi-standings-overlay" :title="title || 'Standings'" :full="full">
<div class="all-standings-holder">
<div class="standings-holder" v-for="standings in standingsGroups" :key="standings.title">
<Standings :event="event" :stage="standings.group" :use-codes="useCodes" :override-show-columns="showColumns"
:tie-text="standings && standings.tieText" :title="standings.short || standings.title"></Standings>

<!-- event: Object,-->
<!-- stage: String,-->
<!-- title: String,-->
<!-- tieText: String,-->
<!-- showMapDiff: Boolean-->
</div>
</div>
</GenericOverlay>
</template>

<script>
import { ReactiveArray, ReactiveRoot, ReactiveThing } from "@/utils/reactive";
import GenericOverlay from "@/components/broadcast/roots/GenericOverlay";
import Standings from "@/components/broadcast/Standings";
export default {
name: "MultiStandingsOverlay",
components: { GenericOverlay, Standings },
props: ["broadcast", "title", "stageCodes", "showColumns", "useCodes", "full"],
computed: {
event() {
if (!this.broadcast || !this.broadcast.event) return null;
return ReactiveRoot(this.broadcast.event.id, {
theme: ReactiveThing("theme"),
teams: ReactiveArray("teams", {
theme: ReactiveThing("theme")
})
});
},
blocks() {
if (!this.event || !this.event.blocks) return null;
try {
const blocks = JSON.parse(this.event.blocks);
return blocks || null;
} catch (e) {
return null;
}
},
standingsGroups() {
if (!this.stageCodes?.length) return this.blocks?.standings;
return (this.blocks?.standings || []).filter(standings => this.stageCodes.some(code => standings.group === code || standings.key === code));
}
},
metaInfo() {
return {
title: `Multi Standings ${this.stageCodes} | ${this.broadcast?.code || this.broadcast?.name || ""}`
};
}
};
</script>
<style scoped>
.standings >>> .team-name {
color: inherit !important;
}
.all-standings-holder {
display: flex;
justify-content: space-around;
align-items: flex-start;
width: 100%;
}
.standings >>> .standings-header .team-name {
margin-right: 1.5em;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
return (this.blocks?.standings || []).find(s => s.group === this._stage);
},
stageTitle() {
return this.standingsSettings?.title || this._stage;
return this.standingsSettings?.short || this.standingsSettings?.title || this._stage;
}
},
metaInfo() {
Expand Down
13 changes: 12 additions & 1 deletion website/src/router/broadcast.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import MVPOverlay from "@/components/broadcast/roots/MVPOverlay";
const MVPOverlay = () => import("@/components/broadcast/roots/MVPOverlay");
const MultiStandingsOverlay = () => import("@/components/broadcast/roots/MultiStandingsOverlay");

const IngameOverlay = () => import("@/components/broadcast/roots/IngameOverlay");
const BreakOverlay = () => import("@/components/broadcast/break/BreakOverlay");
Expand Down Expand Up @@ -96,6 +97,16 @@ export default [
{ path: "schedule", component: ScheduleOverlay, props: route => ({ secondary: !!route.query.secondary }) },
{ path: "iframe", component: IframeOverlay, props: route => ({ url: route.query.url }) },
{ path: "standings", component: StandingsOverlay, props: route => ({ stage: route.query.stage || route.query.group }) },
{
path: "multi-standings",
component: MultiStandingsOverlay,
props: route => ({
stageCodes: (route.query.stage || route.query.group || route.query.stages || route.query.groups || "").split(",").filter(t => t),
useCodes: !!route.query.codes,
showColumns: (route.query.columns || route.query.show || "").split(",").filter(t => t)
})
},
{ path: "multistandings", redirect: "multi-standings" },
{ path: "roster", redirect: "rosters" },
{
path: "rosters",
Expand Down
6 changes: 4 additions & 2 deletions website/src/router/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default [
top: route.query.top,
noAnimation: (route.query.noAnimate || route.query.dontAnimate || route.query.noAnimation),
noStinger: (route.query.noStinger || route.query.stinger === "false"),
bodyClass: route.query.class || route.query.bodyClass
bodyClass: route.query.class || route.query.bodyClass,
full: !!route.query.full
}),
children: BroadcastRoutes
},
Expand All @@ -83,7 +84,8 @@ export default [
title: route.query.title,
noAnimation: (route.query.noAnimate || route.query.dontAnimate || route.query.noAnimation),
noStinger: (route.query.noStinger || route.query.stinger === "false"),
bodyClass: route.query.class || route.query.bodyClass
bodyClass: route.query.class || route.query.bodyClass,
full: !!route.query.full
}),
children: BroadcastRoutes
}
Expand Down

0 comments on commit ae0d5ee

Please sign in to comment.