townsquare/src/components/modals/Modal.vue
Steffen 300395de08
v2.13.0 (#168)
* add support for custom fabled (closes #110)

* 2.13.0

* show custom fabled first

* add recordVoteHistory & clearVoteHistory to session menu

* Update CHANGELOG.md

* socket part of toggle recordVoteHistory

analogous to isNight

* remove accidental

* Add files via upload

* add custom fabled

* Add option to reduce night animations to save power.

* add fallback icon for fabled

* changelog

* disable all animations now

* linter

* add 'on the block' indicator

- after vote, ST chooses to put onto block / empty block / no change to block
- player menu has add / remove from block
- players are automatically removed from the block when (i) they die (ii) another player is put onto block
- fixed crash on add/remove/etc player mid vote

* hide rounded corners on maximized modals

(barely visible anyway)

* ST always sees vote history

i.e. toggle affects only players

* empty block at night

* avoid clashing with seat icon

* nlc: toggle within session.js

* lint

* minor

* Use proper "Exile" terminology for exile

* Add info about "Banishment"->"Exile" to CHANGELOG

* requested changes

* remove direct ST control of block

* player menu order

* move block/night logic from socket to menu

* minor fix to previous

* on block -> marked

* requested changes

* requested change

Co-authored-by: Steffen <steffen@baumgart.biz>

* fix players being moved or removed during a nomination (closes #164)
add vue linter

* let's try adding a lint error

* linter adjusted

* it's working!

* requested change

record marked player id in session

* feedback implemented
npm audit

* prepare develop branch

* adjust linter config

* revert version bump

* fixes & visuals

* Update CHANGELOG.md

* restore old lint command (fixes #170)

* minor fix default

* show jinxed interactions on character reference modal

* 2.13.0

* changelog

Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com>
Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com>
Co-authored-by: Adrian Irving-Beer <wisq@wisq.net>
Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 20:07:54 +02:00

142 lines
2.5 KiB
Vue

<template>
<transition name="modal-fade">
<div class="modal-backdrop" @click="close">
<div
class="modal"
:class="{ maximized: isMaximized }"
role="dialog"
aria-labelledby="modalTitle"
aria-describedby="modalDescription"
@click.stop=""
>
<div class="top-right-buttons">
<font-awesome-icon
@click="isMaximized = !isMaximized"
class="top-right-button"
:icon="['fas', isMaximized ? 'window-minimize' : 'window-maximize']"
/>
<font-awesome-icon
@click="close"
class="top-right-button"
icon="times-circle"
/>
</div>
<div class="slot">
<slot></slot>
</div>
</div>
</div>
</transition>
</template>
<script>
export default {
data: function() {
return {
isMaximized: false
};
},
methods: {
close() {
this.$emit("close");
}
}
};
</script>
<style lang="scss">
.modal-backdrop {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}
.modal {
background: rgba(0, 0, 0, 0.8);
padding: 10px 20px;
border-radius: 10px;
box-shadow: 2px 2px 20px 1px #000;
display: flex;
flex-direction: column;
max-height: 80%;
max-width: 80%;
.vote-history &,
.night-reference &,
.characters & {
overflow-y: auto;
}
.roles &,
.characters & {
max-height: 100%;
max-width: 60%;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
align-content: center;
align-items: center;
justify-content: center;
line-height: 100%;
}
> .top-right-buttons {
position: absolute;
z-index: 100;
top: 15px;
right: 20px;
> .top-right-button {
cursor: pointer;
width: 28px;
&:hover {
color: red;
}
}
}
> .slot {
max-height: 100%;
position: initial;
}
}
.maximized {
background: rgba(0, 0, 0, 0.95);
padding: 0;
border-radius: 0;
height: 100%;
width: 100%;
max-width: 100%;
max-height: 100%;
display: flex;
align-content: center;
justify-content: center;
.roles &,
.characters & {
max-width: 100%;
padding: 10px;
}
}
.modal-fade-enter,
.modal-fade-leave-active {
opacity: 0;
}
.modal-fade-enter-active,
.modal-fade-leave-active {
transition: opacity 0.2s ease;
}
</style>