2020-04-15 20:40:58 +00:00
|
|
|
<template>
|
|
|
|
<div class="token" @click="setRole" :class="[role.id]">
|
2020-04-26 18:11:29 +00:00
|
|
|
<span
|
|
|
|
class="icon"
|
|
|
|
v-if="role.id"
|
|
|
|
v-bind:style="{
|
|
|
|
backgroundImage: `url(${require('../assets/icons/' +
|
|
|
|
role.id +
|
|
|
|
'.png')})`
|
|
|
|
}"
|
|
|
|
></span>
|
2020-04-15 20:40:58 +00:00
|
|
|
<span class="leaf-left" v-if="role.firstNight"></span>
|
|
|
|
<span class="leaf-right" v-if="role.otherNight"></span>
|
|
|
|
<span
|
|
|
|
v-if="role.reminders && role.reminders.length"
|
|
|
|
v-bind:class="['leaf-top' + role.reminders.length]"
|
|
|
|
></span>
|
|
|
|
<span class="leaf-orange" v-if="role.setup"></span>
|
2020-04-26 18:11:29 +00:00
|
|
|
<svg viewBox="0 0 150 150" class="name">
|
|
|
|
<path
|
|
|
|
d="M 13 75 C 13 160, 138 160, 138 75"
|
|
|
|
id="curve"
|
|
|
|
fill="transparent"
|
|
|
|
/>
|
|
|
|
<text
|
|
|
|
width="150"
|
|
|
|
x="66.6%"
|
|
|
|
text-anchor="middle"
|
|
|
|
class="label"
|
|
|
|
v-bind:font-size="role.name | nameToFontSize"
|
|
|
|
>
|
|
|
|
<textPath xlink:href="#curve">
|
|
|
|
{{ role.name }}
|
|
|
|
</textPath>
|
|
|
|
</text>
|
|
|
|
</svg>
|
|
|
|
<div
|
|
|
|
class="edition"
|
|
|
|
v-bind:class="[`edition-${role.edition}`, role.team]"
|
|
|
|
></div>
|
2020-04-18 18:05:45 +00:00
|
|
|
<div class="ability" v-if="role.ability">
|
|
|
|
{{ role.ability }}
|
|
|
|
</div>
|
2020-04-15 20:40:58 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: "Token",
|
|
|
|
props: {
|
|
|
|
role: {
|
|
|
|
type: Object,
|
2020-05-03 21:05:17 +00:00
|
|
|
default: () => ({})
|
2020-04-15 20:40:58 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {};
|
|
|
|
},
|
2020-04-26 18:11:29 +00:00
|
|
|
filters: {
|
|
|
|
nameToFontSize: name => (name && name.length > 10 ? "20px" : "24px")
|
|
|
|
},
|
2020-04-15 20:40:58 +00:00
|
|
|
methods: {
|
|
|
|
setRole() {
|
|
|
|
this.$emit("set-role");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.token {
|
|
|
|
border-radius: 50%;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
background: url("../assets/token.png") center center;
|
|
|
|
background-size: 100%;
|
|
|
|
text-align: center;
|
|
|
|
border: 3px solid black;
|
|
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
|
|
cursor: pointer;
|
2020-04-22 21:07:25 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-04-26 18:11:29 +00:00
|
|
|
justify-content: center;
|
2020-04-15 20:40:58 +00:00
|
|
|
|
2020-04-26 18:11:29 +00:00
|
|
|
.icon {
|
2020-04-15 20:40:58 +00:00
|
|
|
background-size: 100%;
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2020-04-26 18:11:29 +00:00
|
|
|
margin-top: 3%;
|
2020-04-15 20:40:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-size: 100%;
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
&.leaf-left {
|
|
|
|
background-image: url("../assets/leaf-left.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-orange {
|
|
|
|
background-image: url("../assets/leaf-orange.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-right {
|
|
|
|
background-image: url("../assets/leaf-right.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-top1 {
|
|
|
|
background-image: url("../assets/leaf-top1.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-top2 {
|
|
|
|
background-image: url("../assets/leaf-top2.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-top3 {
|
|
|
|
background-image: url("../assets/leaf-top3.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-top4 {
|
|
|
|
background-image: url("../assets/leaf-top4.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
&.leaf-top5 {
|
|
|
|
background-image: url("../assets/leaf-top5.png");
|
|
|
|
}
|
|
|
|
}
|
2020-04-18 18:05:45 +00:00
|
|
|
|
2020-04-26 18:11:29 +00:00
|
|
|
.name {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
.label {
|
|
|
|
fill: black;
|
|
|
|
stroke: white;
|
|
|
|
stroke-width: 2px;
|
|
|
|
paint-order: stroke;
|
|
|
|
font-family: "Papyrus", serif;
|
|
|
|
font-weight: bold;
|
|
|
|
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
|
|
|
letter-spacing: 1px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.edition {
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
bottom: 5px;
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
|
|
|
background-size: 100%;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2020-04-18 18:05:45 +00:00
|
|
|
.ability {
|
2020-04-18 18:21:26 +00:00
|
|
|
display: flex;
|
2020-04-18 18:05:45 +00:00
|
|
|
position: absolute;
|
|
|
|
padding: 5px 10px;
|
2020-04-22 21:07:25 +00:00
|
|
|
left: 120%;
|
2020-04-18 18:05:45 +00:00
|
|
|
width: 250px;
|
|
|
|
z-index: 25;
|
|
|
|
font-size: 80%;
|
2020-04-18 18:21:26 +00:00
|
|
|
background: rgba(0, 0, 0, 0.5);
|
2020-04-18 18:05:45 +00:00
|
|
|
border-radius: 10px;
|
|
|
|
border: 3px solid black;
|
2020-04-18 19:03:58 +00:00
|
|
|
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
|
2020-04-18 18:05:45 +00:00
|
|
|
text-align: left;
|
2020-04-18 18:21:26 +00:00
|
|
|
justify-items: center;
|
|
|
|
align-content: center;
|
|
|
|
align-items: center;
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
|
|
|
transition: opacity 200ms ease-in-out;
|
2020-04-18 18:05:45 +00:00
|
|
|
|
2020-04-18 18:21:26 +00:00
|
|
|
&:before {
|
2020-04-18 18:05:45 +00:00
|
|
|
content: " ";
|
|
|
|
border: 10px solid transparent;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-right-color: black;
|
2020-04-18 18:21:26 +00:00
|
|
|
position: absolute;
|
|
|
|
margin-right: 2px;
|
|
|
|
right: 100%;
|
2020-04-18 18:05:45 +00:00
|
|
|
}
|
2020-04-22 19:21:54 +00:00
|
|
|
|
|
|
|
#app.screenshot & {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-04-18 18:05:45 +00:00
|
|
|
}
|
2020-04-18 19:03:58 +00:00
|
|
|
|
2020-04-18 18:05:45 +00:00
|
|
|
&:hover .ability {
|
2020-04-18 18:21:26 +00:00
|
|
|
opacity: 1;
|
2020-04-18 18:05:45 +00:00
|
|
|
}
|
2020-04-15 20:40:58 +00:00
|
|
|
}
|
|
|
|
</style>
|