From a26cc7aa4147f94e8b3237196ea8b0456d50ae91 Mon Sep 17 00:00:00 2001 From: Settel Date: Wed, 31 Aug 2022 14:39:13 +0200 Subject: [PATCH] feat: reveal vote count and source --- client/src/assets/css/colors.scss | 8 +++++ client/src/components/Playground.vue | 34 ++++++++++++++---- client/src/components/SourceCard.vue | 54 +++++++++++++++++++++++++--- client/src/composables/engine.d.ts | 6 ++-- client/src/stores/RoundStore.ts | 18 +++++----- 5 files changed, 98 insertions(+), 22 deletions(-) diff --git a/client/src/assets/css/colors.scss b/client/src/assets/css/colors.scss index 4d58a8a..ff210c1 100644 --- a/client/src/assets/css/colors.scss +++ b/client/src/assets/css/colors.scss @@ -78,6 +78,14 @@ $sourcecard-selected-background-color: #ffffff; $sourcecard-selected-text-color: $background-primary-color; $sourcecard-selected-border: 3px solid #ffffff; $sourcecard-selected-box-shadow: 0 0 10px #ffffff; +$sourcecard-disabled-background-color: $sourcecard-background-color; +$sourcecard-disabled-text-color: darken($text-primary-color, 60%); +$sourcecard-disabled-border: 3px solid #606060; + +// Source Card Badge +$sourcecardbadge-background-color: #ffff88; +$sourcecardbadge-border: 2px solid #384048; +$sourcecardbadge-text-color: #384048; // Engine Debug $debug-background-color: lighten($background-primary-color, 10%); diff --git a/client/src/components/Playground.vue b/client/src/components/Playground.vue index 4cacebf..2e9ce00 100644 --- a/client/src/components/Playground.vue +++ b/client/src/components/Playground.vue @@ -2,8 +2,9 @@
- +
@@ -18,20 +19,21 @@ \ No newline at end of file diff --git a/client/src/composables/engine.d.ts b/client/src/composables/engine.d.ts index 8fc5006..efa7f93 100644 --- a/client/src/composables/engine.d.ts +++ b/client/src/composables/engine.d.ts @@ -19,7 +19,7 @@ export type Source = { name: string } -export type Sources = Array +export type Sources = Array export type Selection = { id: string @@ -35,7 +35,7 @@ export type RevelationSources = { [key: string]: boolean } -export type Revelations = { +export type Revelation = { votes: RevelationVotes sources: RevelationSources } @@ -44,5 +44,5 @@ export type Round = { quote: string sources: Sources selections: Selections - revelations: Revelations + revelation: Revelation } diff --git a/client/src/stores/RoundStore.ts b/client/src/stores/RoundStore.ts index e7a8079..4da06e8 100644 --- a/client/src/stores/RoundStore.ts +++ b/client/src/stores/RoundStore.ts @@ -1,17 +1,17 @@ import { defineStore } from 'pinia' -import type { Round, Sources, Selections, RevelationVotes, RevelationSources } from '@/composables/engine.d' +import type { Round, Sources, Selections, Revelation, RevelationVotes, RevelationSources } from '@/composables/engine.d' export const useRoundStore = defineStore('RoundStore', { state: () => { return { round: { quote: '', - sources: [], - selections: [], - revelations: { - votes: {}, - sources: {}, - }, + sources: [] as Sources, + selections: [] as Selections, + revelation: { + votes: {} as RevelationVotes, + sources: {} as RevelationSources, + } as Revelation, } as Round, } }, @@ -21,8 +21,8 @@ export const useRoundStore = defineStore('RoundStore', { this.round.quote = round.quote || '' this.round.sources = round.sources || [] as Sources this.round.selections = round.selections || [] as Selections - this.round.revelations.votes = round.revelations?.votes || {} as RevelationVotes - this.round.revelations.sources = round.revelations?.sources || {} as RevelationSources + this.round.revelation.votes = round.revelation?.votes || {} as RevelationVotes + this.round.revelation.sources = round.revelation?.sources || {} as RevelationSources }, }, })