diff --git a/package-lock.json b/package-lock.json index 47d43ee..60e4301 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "vue": "^3.2.13", "vue-chartjs": "^5.2.0", "vue-class-component": "^8.0.0-0", + "vue-multiselect": "^3.0.0-beta.1", "vue-router": "^4.0.3", "vuex": "^4.0.0" }, @@ -12498,6 +12499,15 @@ "node": ">=8" } }, + "node_modules/vue-multiselect": { + "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-3.0.0-beta.1.tgz", + "integrity": "sha512-V+jpydtjyHcQ+yjHsEWEBrDAopOx/pufNkSAXNVDAGQ+ESDEJ7wYejNd9H1RiCnFOYK4yf1XSGqE+Mp3HJXmdg==", + "engines": { + "node": ">= 4.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/vue-router": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.6.tgz", diff --git a/package.json b/package.json index 3aa0dc5..f30fc61 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "vue": "^3.2.13", "vue-chartjs": "^5.2.0", "vue-class-component": "^8.0.0-0", + "vue-multiselect": "^3.0.0-beta.1", "vue-router": "^4.0.3", "vuex": "^4.0.0" }, diff --git a/src/App.vue b/src/App.vue index 3fea330..ddbb3a0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,11 +2,11 @@
@@ -31,7 +31,7 @@ body { #app { height: 100vh; width: 100vw; - font-family: Avenir, Helvetica, Arial, sans-serif; + font-family: 'Helvetica', 'Arial', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; @@ -46,6 +46,17 @@ body { grid-template-rows: auto 1fr auto auto; } +@media only screen and (max-width: 922px) { + #app{ + grid-template-areas: + 'header header' + 'filters filters' + 'body body '; + grid-template-rows: auto auto 1fr; + } + +} + header { grid-area: header; height: 64px; diff --git a/src/components/PlayerChart.vue b/src/components/PlayerChart.vue index dcc7260..12c8fe6 100644 --- a/src/components/PlayerChart.vue +++ b/src/components/PlayerChart.vue @@ -44,7 +44,9 @@ export default defineComponent({ if (this.$refs.container) { const style = getComputedStyle(this.$refs.container as Element) colors.fg = style.getPropertyValue('--foreground') + colors.bg = style.getPropertyValue('--bg-color') colors.orange = style.getPropertyValue('--orange') + colors.cyan = style.getPropertyValue('--cyan') colors.currentLine = style.getPropertyValue('--current-line') } else { colors.fg = '#ffffff' @@ -78,7 +80,7 @@ export default defineComponent({ }) chartData.datasets[0].pointRadius = Array(chartData.datasets[0].labels.length).fill(1) chartData.datasets[0].pointStyle = Array(chartData.datasets[0].labels.length).fill('dot') - chartData.datasets[0].borderColor = Array(chartData.datasets[0].labels.length).fill(this.colors.fg) + chartData.datasets[0].borderColor = Array(chartData.datasets[0].labels.length).fill(this.colors.cyan) chartData.datasets[0].backgroundColor = chartData.datasets[0].borderColor chartData.datasets[0].hoverRadius = Array(chartData.datasets[0].labels.length).fill(4) if (this.$props.playerHighlighted) { @@ -102,13 +104,21 @@ export default defineComponent({ y: { title: { text: 'Kills', - display: true + display: true, + color: this.colors.fg + }, + ticks: { + color: this.colors.fg } }, x: { title: { text: 'Deaths', - display: true + display: true, + color: this.colors.fg + }, + ticks: { + color: this.colors.fg } } }, @@ -128,6 +138,7 @@ export default defineComponent({ } }, annotation: {}, + legend: { display: false }, datalabels: { formatter: (value:any, context:any) => { return this.players[this.playerIdList[context.dataIndex]].username @@ -139,7 +150,8 @@ export default defineComponent({ display: Array(this.playerIdList.length).fill('auto'), align: '-45', anchor: 'end', - clamp: true + clamp: true, + color: Array(this.playerIdList.length).fill(this.colors.fg) } }, onClick: (e:Event, element:any) => { @@ -183,6 +195,7 @@ export default defineComponent({ options.plugins.datalabels.display[index] = true options.plugins.datalabels.backgroundColor[index] = this.colors.orange options.plugins.datalabels.borderWidth[index] = 1 + options.plugins.datalabels.color[index] = this.colors.bg } return options }, @@ -203,4 +216,9 @@ export default defineComponent({ canvas { background: var(--accent); } +@media only screen and (max-width: 922px) { + canvas{ + display:none !important + } +} diff --git a/src/components/PlayerList.vue b/src/components/PlayerList.vue index bb7cd58..0ab620c 100644 --- a/src/components/PlayerList.vue +++ b/src/components/PlayerList.vue @@ -2,22 +2,22 @@
- username - kills - deaths - k/d - max kill distance - average kill distance + Username + K + D + K/D + max distance + average distance
- {{ index }} - {{ players[playerId].username }} - {{ players[playerId].kills }} - {{ players[playerId].deaths }} - {{ Math.round(players[playerId].kills / players[playerId].deaths * 100) / 100 }} - {{ players[playerId].max_kill_distance }} - {{ Math.round(players[playerId].avg_kill_distance * 100) / 100 }} +
{{ index }}
+
{{ players[playerId].username }}
+
{{ players[playerId].kills }}
+
{{ players[playerId].deaths }}
+
{{ Math.round(players[playerId].kills / players[playerId].deaths * 100) / 100 }}
+
{{ players[playerId].max_kill_distance }}
+
{{ Math.round(players[playerId].avg_kill_distance * 100) / 100 }}
@@ -147,21 +147,30 @@ export default defineComponent({ height: 100%; } -.playerHeaders { - position: sticky; - top: 0px; -} - .playerRow, .playerHeaders { + box-sizing: border-box; display: grid; - grid-template-columns: 4ch 2fr 6ch 6ch 6ch 10ch 1fr; + grid-template-columns: 4ch 20ch 6ch 6ch 6ch 10ch 1fr; background: var(--bg-color); text-align: left; cursor: pointer; margin: 0; /* border: 2px solid transparent; */ transition: border .25s; + height:2em; +} +.playerHeaders{ + position:sticky; + top:0; + height:3em; +} + +.playerHeaders>span{ + padding:.5em .8em 0 .25em; +} +.playerRow>div { + padding:.5em .8em 0 .25em; } .playerHeaders, @@ -173,13 +182,13 @@ export default defineComponent({ background: var(--accent); } -.playerHeaders span:hover, +.playerHeaders div:hover, .playerRow:hover { background: var(--bg-color); } -.playerRow>span:not(:last-child), -.playerHeaders>span:not(:last-child) { +.playerRow>div:not(:last-child), +.playerHeaders>div:not(:last-child) { border-right: solid var(--bg-color) 2px; } @@ -187,10 +196,14 @@ export default defineComponent({ width:100%; } -span { - text-overflow: ellipsis; - overflow: hidden; - user-select: none; +@media only screen and (max-width: 600px) { + .playerRow>div:nth-child(6), .playerHeaders>span:nth-child(6),.playerRow>div:nth-child(7), .playerHeaders>span:nth-child(7) { + display: none; + } + .playerRow, +.playerHeaders{ + grid-template-columns: 4ch 20ch 6ch 6ch 1fr; +} } .player span { @@ -199,4 +212,6 @@ span { .selected { background: var(--comment) !important; -} +} + + diff --git a/src/router/index.ts b/src/router/index.ts index b020099..a912bb1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,21 +6,21 @@ const routes: Array = [ { path: '/', name: 'home', - component: HomeView - }, - { - path: '/players', - name: 'players', component: PlayerView - }, - { - path: '/about', - name: 'about', - // route level code-splitting - // this generates a separate chunk (about.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') } + // { + // path: '/players', + // name: 'players', + // component: PlayerView + // }, + // { + // path: '/about', + // name: 'about', + // // route level code-splitting + // // this generates a separate chunk (about.[hash].js) for this route + // // which is lazy-loaded when the route is visited. + // component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') + // } ] const router = createRouter({ diff --git a/src/views/PlayerView.vue b/src/views/PlayerView.vue index 7812ce0..5497084 100644 --- a/src/views/PlayerView.vue +++ b/src/views/PlayerView.vue @@ -1,8 +1,8 @@