Skip to content

Commit

Permalink
Merge branch 'feature/history' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
maldestor95 committed May 8, 2024
2 parents 91aab2e + b116017 commit 4788b36
Show file tree
Hide file tree
Showing 9 changed files with 307 additions and 34 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ Live version: https://maldestor95.github.io/score
## How to publish
execute in CLI, on a master branch
* `npm run build`
* `deploy.bat`
* `deploy.bat`


## link to libraries
* chartjs
* https://vue-chartjs.org/guide/
* https://www.chartjs.org/docs/latest/
*
102 changes: 91 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"version": "0.1.1",
"type": "module",
"homepage": "https://github.com/maldestor95/score",
"description": "Online Scoreboard tool","license":"MIT",
"description": "Online Scoreboard tool",
"license": "MIT",
"scripts": {
"dev": "vite --host",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"chart.js": "^4.4.1",
"chartjs-plugin-zoom": "^2.0.1",
"markdown-it": "^13.0.1",
"pinia": "^2.1.7",
"vue": "^3.4.5",
"vue-chartjs": "^5.3.0",
"yaml": "^2.3.1"
},
"devDependencies": {
Expand Down
8 changes: 0 additions & 8 deletions src/pages/wizard/bets.vue

This file was deleted.

12 changes: 7 additions & 5 deletions src/pages/wizard/editscore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
</div>

<div class="border border-black border-solid container" v-if="editable">
<div class="flex justify-evenly py-2 text-white" v-for="step in props.steps">
<button @click="emitupdate(phase, -step)" class="bg-red-500 w-20 h-14">
{{ -step }}
</button>
<button @click="emitupdate(phase, +step)" class="bg-green-500 w-20 h-14">
<div class="flex flex-row flex-wrap gap-4 justify-evenly py-2 text-white">
<button
v-for="step in props.steps"
@click="emitupdate(phase, step)"
class="w-20 h-14"
:class="{ 'bg-red-500 ': step < 0, 'bg-green-500': step >= 0 }"
>
{{ step }}
</button>
</div>
Expand Down
50 changes: 50 additions & 0 deletions src/pages/wizard/history.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<div>History</div>
<div class="flex flex-row justify-center gap-2">
<button @click="setGraph = 'total'">Total</button>
<button @click="setGraph = 'table'">Table</button>
<button @click="setGraph = 'cumulative'">cumulative</button>
</div>
<container
class="grid grid-cols-[56px_1fr] overflow-y-auto max-h-[300px]"
v-if="setGraph == 'table'"
>
<div class="font-semibold">
<div class="firstLine">Round</div>
<div v-for="(item, index) in store.getRoundNumber" :key="index">
{{ item }}
</div>
</div>
<div class="overflow-x-scroll">
<div class="flex flex-row gap-2 alternateBlue">
<div v-for="(player, playerId) in store.userList" :key="playerId" class="w-32">
<div class="font-semibold firstLine">{{ player.name }}</div>
<div v-for="roundIScore in player.scorePerRound">
{{ roundIScore }}
</div>
</div>
</div>
</div>
</container>
<historychart :graph-type="<graphType><unknown>setGraph"></historychart>
</template>

<script setup lang="ts">
import { useScoreStore } from "./store";
import container from "../../components/container.vue";
import historychart, { Props as graphType } from "./historychart.vue";
import { ref } from "vue";
const setGraph = ref<"total" | "cumulative" | "table" | undefined>("total");
const store = useScoreStore();
</script>

<style scoped>
.alternateBlue > :nth-child(even) {
@apply bg-blue-400 text-white px-2;
}
.firstLine {
/* @apply bg-blue-500 text-white px-2 font-semibold; */
/* @apply sticky top-0; */
}
</style>
Loading

0 comments on commit 4788b36

Please sign in to comment.