-
Notifications
You must be signed in to change notification settings - Fork 4
/
CouncilComponent.vue
142 lines (131 loc) · 2.91 KB
/
CouncilComponent.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<template>
<div align="center">
<div class="InfoContainer">
<council-participant-component
v-if="councilId != null"
class="ELement Info"
:council="council"
/>
<council-info-component
v-if="councilId != null"
class="ELement Info"
:council="council"
/>
<info-component
v-if="councilId != null"
class="ELement Info"
:card="card"
/>
<div
v-if="councilId != null"
class="ELement"
>
<CardComponent
:model="card"
:image-u-r-l="card.image"
/>
</div>
<div
v-if="councilId == null"
class="ELement"
>
<img
style="max-width:25em;"
src="@/assets/icon/noCard.png"
>
<br><br>
<p>
It seams like you have voted on all cards you've encountered. Come back here, when you've played more matches.
</p>
</div>
</div>
</div>
</template>
<script>
import CardComponent from "@/components/elements/CardComponent";
import InfoComponent from "@/components/elements/VotingComponents/InfoComponent.vue";
import CouncilParticipantComponent from "@/components/elements/VotingComponents/CouncilParticipantComponent.vue";
import CouncilInfoComponent from "@/components/elements/VotingComponents/CouncilInfoComponent.vue";
import { Council } from "@/model/Council";
import { Card } from "@/model/Card";
export default {
name: "CouncilComponent",
components: { InfoComponent, CardComponent, CouncilParticipantComponent, CouncilInfoComponent },
props: {
councilId: {
type: Number,
default() {
return null;
}
}
},
data() {
return {
council: new Council(),
card: new Card(),
};
},
watch: {
councilId: {
handler() {
this.init();
},
deep: true
}
},
mounted() {
this.init()
},
methods: {
init() {
if (this.councilId != null) {
this.$cardChain.getCouncil(this.councilId)
.then(res => {
this.council = res;
console.log("####", res)
this.$cardChain.getCard(this.council.cardId)
.then(res => {
this.card = res
})
});
}
},
}
};
</script>
<style scoped lang="scss">
@import "@/scss/variables";
.InfoContainer {
padding: 2em;
background-color: $main-color-c;
display: grid;
box-shadow: $border-thickness-bold * 1.5 $border-thickness-bold * 1.5 0 $minor-color-c;
grid-template-columns: repeat(auto-fit, minmax(15em, 25em));
grid-template-rows: auto;
grid-column-gap: 2rem;
grid-row-gap: 2rem;
width: max-content;
max-width: 100%;
}
.Info {
text-align: left;
width: 15em;
h3 {
color: black;
}
}
.ELement {
position: relative;
flex-grow: 1;
max-width: 25em;
}
.voter {
min-height: 10vh;
}
.FlavourText {
font-style: italic;
}
:deep(p) {
color: black;
}
</style>