made everything more responsive

This commit is contained in:
Steffen 2020-06-07 23:43:26 +02:00
parent 539f3c0b76
commit 20b95e4a61
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
5 changed files with 74 additions and 44 deletions

View File

@ -213,9 +213,9 @@ ul {
text-shadow: 1px 1px rgba(0, 0, 0, 0.5); text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
line-height: 40px; line-height: 40px;
margin: 5px auto; margin: 5px auto;
font-size: 1em;
cursor: pointer; cursor: pointer;
transition: all 200ms; transition: all 200ms;
white-space: nowrap;
&:hover { &:hover {
color: red; color: red;
} }

View File

@ -153,7 +153,7 @@
'.png')})` '.png')})`
}" }"
></span> ></span>
{{ reminder.name }} <span class="text">{{ reminder.name }}</span>
</div> </div>
</template> </template>
<div class="reminder add" @click="$emit('trigger', ['openReminderModal'])"> <div class="reminder add" @click="$emit('trigger', ['openReminderModal'])">
@ -234,6 +234,7 @@ export default {
const reminders = [...this.player.reminders]; const reminders = [...this.player.reminders];
reminders.splice(this.player.reminders.indexOf(reminder), 1); reminders.splice(this.player.reminders.indexOf(reminder), 1);
this.updatePlayer("reminders", reminders); this.updatePlayer("reminders", reminders);
this.isMenuOpen = false;
}, },
updatePlayer(property, value) { updatePlayer(property, value) {
if (this.session.isSpectator && property !== "reminders") return; if (this.session.isSpectator && property !== "reminders") return;
@ -287,15 +288,20 @@ export default {
/***** Player token *****/ /***** Player token *****/
.circle .player { .circle .player {
margin-bottom: 10px; margin-bottom: 10px;
padding-top: $token + 6px;
padding-bottom: 5px; padding-bottom: 5px;
&:before {
content: " ";
display: block;
padding-top: 100%;
}
.shroud { .shroud {
top: 0; top: 0;
left: 0; left: 0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 2/3 * $token; height: 45%;
cursor: pointer; cursor: pointer;
transform: rotateX(0deg); transform: rotateX(0deg);
transform-origin: top center; transform-origin: top center;
@ -306,13 +312,13 @@ export default {
&:before { &:before {
content: " "; content: " ";
background: url("../assets/shroud.png") center -10px no-repeat; background: url("../assets/shroud.png") center -10px no-repeat;
background-size: auto 100%; background-size: auto 110%;
position: absolute; position: absolute;
margin-left: -2/6 * $token; margin-left: -50%;
width: 2/3 * $token; width: 100%;
height: 2/3 * $token; height: 100%;
left: 50%; left: 50%;
top: -30px; top: -30%;
opacity: 0; opacity: 0;
transform: perspective(400px) scale(1.5); transform: perspective(400px) scale(1.5);
transform-origin: top center; transform-origin: top center;
@ -343,8 +349,7 @@ export default {
z-index: 2; z-index: 2;
.life { .life {
border-radius: 50%; border-radius: 50%;
height: $token + 6px; width: 100%;
width: $token + 6px;
background: url("../assets/life.png") center center; background: url("../assets/life.png") center center;
background-size: 100%; background-size: 100%;
border: 3px solid black; border: 3px solid black;
@ -354,9 +359,14 @@ export default {
transform: perspective(400px) rotateY(180deg); transform: perspective(400px) rotateY(180deg);
backface-visibility: hidden; backface-visibility: hidden;
position: absolute; position: absolute;
left: 50%; left: 0;
top: 0; top: 0;
margin-left: ($token + 6) / -2;
&:before {
content: " ";
display: block;
padding-top: 100%;
}
} }
&.dead { &.dead {
@ -375,7 +385,7 @@ export default {
width: 100%; width: 100%;
background: url("../assets/vote.png") center center no-repeat; background: url("../assets/vote.png") center center no-repeat;
background-size: 50%; background-size: 50%;
height: $token + 3px; height: 100%;
pointer-events: none; pointer-events: none;
} }
} }
@ -412,8 +422,7 @@ export default {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: $token + 6px; width: 100%;
width: $token + 6px;
transition: transform 200ms ease-in-out; transition: transform 200ms ease-in-out;
transform: perspective(400px) rotateY(0deg); transform: perspective(400px) rotateY(0deg);
backface-visibility: hidden; backface-visibility: hidden;
@ -745,21 +754,32 @@ li.move:not(.from) .player > svg.move {
.circle .reminder { .circle .reminder {
background: url("../assets/reminder.png") center center; background: url("../assets/reminder.png") center center;
background-size: 100%; background-size: 100%;
width: $token / 2; width: 50%;
height: $token / 2; display: flex;
color: black; align-items: center;
font-size: 45%; justify-content: center;
font-weight: bold; margin: 5px 0 0 -25%;
display: block;
margin: 5px ($token / -4) 0;
text-align: center;
padding: ($token * 0.3 + 5px) 5px 0;
border-radius: 50%; border-radius: 50%;
line-height: 90%;
border: 3px solid black; border: 3px solid black;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
transition: all 200ms; transition: all 200ms;
cursor: pointer; cursor: pointer;
&:before {
content: " ";
display: block;
padding-top: 100%;
}
.text {
line-height: 90%;
color: black;
font-size: 45%;
font-weight: bold;
position: absolute;
width: 90%;
text-align: center;
margin-top: 25%;
}
.icon, .icon,
&:after { &:after {
@ -790,16 +810,14 @@ li.move:not(.from) .player > svg.move {
} }
&.custom { &.custom {
padding: 5px;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
font-size: 70%;
word-break: break-word;
.icon { .icon {
display: none; display: none;
} }
.text {
font-size: 70%;
word-break: break-word;
margin-top: 0;
}
} }
&:hover:before { &:hover:before {

View File

@ -57,7 +57,7 @@ export default {
return {}; return {};
}, },
filters: { filters: {
nameToFontSize: name => (name && name.length > 10 ? "20px" : "24px") nameToFontSize: name => (name && name.length > 10 ? "85%" : "110%")
}, },
methods: { methods: {
setRole() { setRole() {
@ -70,7 +70,6 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.token { .token {
border-radius: 50%; border-radius: 50%;
height: 100%;
width: 100%; width: 100%;
background: url("../assets/token.png") center center; background: url("../assets/token.png") center center;
background-size: 100%; background-size: 100%;

View File

@ -177,9 +177,13 @@ export default {
z-index: 25 !important; z-index: 25 !important;
} }
> * { > .player {
margin-left: -78px; margin-left: -50%;
width: 156px; width: 100%;
}
> .reminder {
margin-left: -25%;
width: 50%;
} }
} }
} }
@ -188,6 +192,17 @@ export default {
$angle: (360 / $item-count); $angle: (360 / $item-count);
$rot: 0; $rot: 0;
// general token size depending on player count
@if $item-count < 7 {
width: 8vw;
} @else if($item-count < 10) {
width: 7vw;
} @else if($item-count < 15) {
width: 6vw;
} @else {
width: 5vw;
}
@for $i from 1 through $item-count { @for $i from 1 through $item-count {
&:nth-child(#{$i}) { &:nth-child(#{$i}) {
transform: rotate($rot * 1deg); transform: rotate($rot * 1deg);
@ -221,11 +236,11 @@ export default {
$x: $i - 1; $x: $i - 1;
@if $x < $q or ($x >= $item-count / 2 and $x < $q * 3) { @if $x < $q or ($x >= $item-count / 2 and $x < $q * 3) {
.player { .player {
margin-bottom: -10px + 20px * (1 - ($x % $q / $q)); margin-bottom: -15% + 20% * (1 - ($x % $q / $q));
} }
} @else { } @else {
.player { .player {
margin-bottom: -10px + 20px * ($x % $q / $q); margin-bottom: -15% + 20% * ($x % $q / $q);
} }
} }
} }
@ -284,11 +299,10 @@ export default {
margin-top: 5px; margin-top: 5px;
} }
li { li {
width: 120px; width: 6vw;
height: 120px; height: 6vw;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
font-size: 18px;
} }
} }
</style> </style>

View File

@ -1,4 +1,3 @@
$token: 150px;
$townsfolk: #1f65ff; $townsfolk: #1f65ff;
$outsider: #46d5ff; $outsider: #46d5ff;
$minion: #ff6900; $minion: #ff6900;